How to Open a Port in Firewalld | InMotion Hosting (2024)

by InMotion Hosting Contributor

1 Minutes, 27 Seconds to Read

After you install Firewalld, the first thing you’ll likely want to do is open a port to connect with web applications on your Linux server. Only dhcp6-client and SSH are enabled by default. However, opening ports with Firewalld is an easy process. The first reason for this is the commands are straight-forward and easy to remember.

The second reason is that Firewalld allows you to manage well-known ports as predefined “services” for a more human-readable configuration. For example, instead of using 443/tcp, you can simply use the https service. Since services are easier to read than numbers and protocols, it’s best to check if a port is listed as a service before using the port option.

Below we cover how to open a port in Firewalld and check open ports.

Upgrade to VPS Hosting for Peak Performance

Upgrade to InMotion VPS Hosting today for top-notch performance, security, and flexibility, and save up to $2,493 – a faster, stronger hosting solution is just a click away!

How to Open a Port in Firewalld | InMotion Hosting (1)Dedicated Resources How to Open a Port in Firewalld | InMotion Hosting (2)NVMe SSD Storage How to Open a Port in Firewalld | InMotion Hosting (3)High-Availability How to Open a Port in Firewalld | InMotion Hosting (4)Ironclad Security How to Open a Port in Firewalld | InMotion Hosting (5)Premium Support

VPS Hosting Plans

Open a Port in Firewalld

  1. Log into SSH
  2. Check if the application port is defined as a service (e.g. IMAPS, Kerberos, MySQL):
    firewall-cmd -get-services
  3. If the service is listed, whitelist the service permanently in the current zone:
    sudo firewall-cmd --permanent --add-service=SERVICE

    If not, open the port permanently by specifying the port number and protocol (TCP or UDP):
    sudo firewall-cmd --permanent --add-port=1234/tcp
  4. Reload Firewalld to apply changes:
    firewall-cmd --reload

    Reloading will remove –-runtime changes to apply the –permanent configuration.

Check Open Ports in Firewalld

After you whitelist ports and services, you should ensure your changes are accurate.

  1. List whitelisted services in Firewalld:
    sudo firewall-cmd --list-services
  2. List currently open ports in Firewalld:
    sudo firewall-cmd --list-ports

We recommend Certbot for creating and maintaining free Let’s Encrypt SSL certificates on non-cPanel cloud servers.

For more in-depth security configurations, check out our article covering Firewalld commands. To learn more about VPS security, check out these 24 ways to harden your Linux server.

How to Open a Port in Firewalld | InMotion Hosting (2024)

FAQs

How to Open a Port in Firewalld | InMotion Hosting? ›

Open the Port:

Replace 80 with the port number you want to open, and tcp with the protocol you want to use (it can be tcp or udp). Reload the Firewall Rules: After adding the rule, reload the firewall for the changes to take effect.

How to open a port using firewalld? ›

Open the Port:

Replace 80 with the port number you want to open, and tcp with the protocol you want to use (it can be tcp or udp). Reload the Firewall Rules: After adding the rule, reload the firewall for the changes to take effect.

How do I open a port on my server firewall? ›

How to open a port on the firewall
  1. Click on Start then on Control Panel.
  2. Click on Windows Firewall and then click on Advanced Settings.
  3. Right click on Inbound Rules then on New Rule:
  4. Select Port and click on Next:
  5. Enter a specific local port (e.g. 8080) and click on Next:
  6. Click on Next:
  7. Name the rule and click on Finish:
Jun 16, 2023

How do I open a port in Linux host? ›

Ubuntu
  1. $ sudo apt install ufw.
  2. $ sudo systemctl status ufw.
  3. $ sudo ufw enable.
  4. $ sudo ufw allow (port)/tcp.
  5. $ sudo ufw allow 53/tcp.
  6. $ sudo ufw allow https.
  7. $ sudo ufw allow 21.
  8. $ sudo ufw allow from 190.34.21.113 to any port.

How do I check if a port is open on my host? ›

Easy Ways to Identify Open Ports

Open a command prompt and type “ipconfig.” Use the IP address and port number to locate an open port. For Mac devices, open a Terminal window. Type “netsat -nr | grep default” into the program. Then, type “nc -vs” + your IP + port number to locate.

How do I check if a port is open in my firewall? ›

If you would like to test ports on your computer, use the Windows command prompt and the CMD command netstat -ano. Windows will show you all currently existing network connections via open ports or open, listening ports that are currently not establishing a connection.

What is the command for open ports? ›

Press the 'windows' key and type 'cmd'. Press “Command Prompt”. Step 3: On the command prompt, type the command “telnet + IP address or hostname + port number” and check the status of the provided TCP port. Step 4: If only the blinking cursor is visible, then the port is open.

How to open port in Linux firewall command line? ›

Use the firewall-cmd command to open a port.

To make the change permanent, add the --permanent flag to the command: firewall-cmd --zone=public --permanent --add-port=22/tcp . To open a UDP port, replace tcp with udp . To open the port by service name, use firewall-cmd --zone=public --permanent .

How do I access my local host port? ›

On the mobile device, open a web browser and enter the IP address of the computer running the web server, followed by the port number if necessary. For example, if the IP address is 192.168. 1.100 and the web server is listening on port 8000, you would enter “http://192.168.1.100:8000” in the browser's address bar.

How to open port 443 in Linux? ›

How to Open Port 443 in Linux?
  1. Run the following command to allow traffic on port 80: sudo iptables -I INPUT -p tcp -m tcp –dport 80 -j ACCEPT.
  2. Run the following command to allow traffic on port 443: sudo iptables -I INPUT -p tcp -m tcp –dport 443 -j ACCEPT.
  3. Run the following command to save the iptables rules:
Apr 19, 2024

How do I check if a port is open in Linux? ›

Open Terminal on your Linux computer. Enter "telnet + IP address or hostname + port number" (e.g., telnet www.synology.com 1723 or telnet 10.17.xxx.xxx 5000) to run the telnet command and test the port status. If the port is open, a message will say Connected to 10.17.xxx.xxx.

How do I check my host and port connectivity? ›

Enter "telnet + IP address or hostname + port number" (e.g., telnet www.example.com 1723 or telnet 10.17.xxx.xxx 5000) to run the telnet command in Command Prompt and test the TCP port status. If the port is open, only a cursor will show. If the port is closed, a message will say Connect failed.

How to check if a port is blocked by a firewall? ›

To see if your firewall is blocking a website, app, or port on Windows, go to Windows Firewall > Advanced Settings and check your Outbound rules. On a Mac, click the Apple icon > System Settings > Network > Firewall > Options to check your firewall settings.

How do I open port 22 on my firewall? ›

  1. Step 1: Install OpenSSH Server on Windows. Enable OpenSSH Feature: Open the “Settings” app on your Windows machine. ...
  2. Step 2: Configure OpenSSH Server. Start SSH Service: ...
  3. Step 3: Allow SSH Through Windows Firewall. Allow SSH Service: ...
  4. Step 4: Accessing Windows SSH Server. Find Windows IP Address:
Apr 9, 2024

How do I open port 8000 in firewall? ›

Enable a port range in advance
  1. Click Advanced settings in the left column of the Windows Firewall window.
  2. Click Inbound Rules in the left column.
  3. Click New Rules in the right column.
  4. Select Port and click next.
  5. Select TCP and enter 8000, 8001, 8002, 8003, 9000, 80, 443 in the Specific local ports field.
  6. Click Next.
Sep 15, 2021

How do I open port 21 on my firewall? ›

To open FTP port 21 you need to change Windows Firewall settings.
  1. Click on Start > Settings > Control Panel > Click on Security center.
  2. At the bottom window (Manage security settings for:) ...
  3. Click on this option. ...
  4. Select Exceptions tab > Click on Add Port button.
  5. Add port 21 and 20 as follows.

Top Articles
XDC Web Wallet | XDC Network
Guide to Receiving Money From Overseas | Simples!
Cars & Trucks - By Owner near Kissimmee, FL - craigslist
Craigslist Campers Greenville Sc
Summit County Juvenile Court
South Park Season 26 Kisscartoon
PRISMA Technik 7-10 Baden-Württemberg
Hawkeye 2021 123Movies
Teenbeautyfitness
Comcast Xfinity Outage in Kipton, Ohio
The Idol - watch tv show streaming online
Hendersonville (Tennessee) – Travel guide at Wikivoyage
Yi Asian Chinese Union
Https E24 Ultipro Com
Directions To O'reilly's Near Me
House Party 2023 Showtimes Near Marcus North Shore Cinema
2024 U-Haul ® Truck Rental Review
VMware’s Partner Connect Program: an evolution of opportunities
7543460065
Bitlife Tyrone's
Gem City Surgeons Miami Valley South
Weather Rotterdam - Detailed bulletin - Free 15-day Marine forecasts - METEO CONSULT MARINE
Zalog Forum
V-Pay: Sicherheit, Kosten und Alternativen - BankingGeek
ZURU - XSHOT - Insanity Mad Mega Barrel - Speelgoedblaster - Met 72 pijltjes | bol
Crawlers List Chicago
Hdmovie 2
Teacup Yorkie For Sale Up To $400 In South Carolina
Yisd Home Access Center
8005607994
Watch Your Lie in April English Sub/Dub online Free on HiAnime.to
12 Facts About John J. McCloy: The 20th Century’s Most Powerful American?
Il Speedtest Rcn Net
Suspiciouswetspot
Cona Physical Therapy
2004 Honda Odyssey Firing Order
Poe T4 Aisling
Craigs List Tallahassee
The Hoplite Revolution and the Rise of the Polis
NIST Special Publication (SP) 800-37 Rev. 2 (Withdrawn), Risk Management Framework for Information Systems and Organizations: A System Life Cycle Approach for Security and Privacy
Flixtor Nu Not Working
Lucky Larry's Latina's
Everything You Need to Know About NLE Choppa
Delaware judge sets Twitter, Elon Musk trial for October
877-292-0545
Htb Forums
A Comprehensive 360 Training Review (2021) — How Good Is It?
All-New Webkinz FAQ | WKN: Webkinz Newz
Craigslist/Nashville
Rise Meadville Reviews
Arginina - co to jest, właściwości, zastosowanie oraz przeciwwskazania
Runelite Ground Markers
Latest Posts
Article information

Author: Allyn Kozey

Last Updated:

Views: 6197

Rating: 4.2 / 5 (43 voted)

Reviews: 90% of readers found this page helpful

Author information

Name: Allyn Kozey

Birthday: 1993-12-21

Address: Suite 454 40343 Larson Union, Port Melia, TX 16164

Phone: +2456904400762

Job: Investor Administrator

Hobby: Sketching, Puzzles, Pet, Mountaineering, Skydiving, Dowsing, Sports

Introduction: My name is Allyn Kozey, I am a outstanding, colorful, adventurous, encouraging, zealous, tender, helpful person who loves writing and wants to share my knowledge and understanding with you.