This article is a mirror article of machine translation, please click here to jump to the original article.

View: 3411|Reply: 2

[linux] Switch to open access to the specified port under Linux

[Copy link]
Posted on 4/3/2023 11:28:38 AM | | |
review


CentOS 7 prohibits an IP from accessing the server
https://www.itsvse.com/thread-10264-1-1.html


iptables firewall only allows certain IPs to access certain ports and specific websites
https://www.itsvse.com/thread-2535-1-1.html


CentOS7 View and turn off the firewall
https://www.itsvse.com/thread-7771-1-1.html

CentOS opens designated ports

CentOS 7.0 uses the firewall as the firewall by default, for example, to open port 8808, execute:

thereinto

--zone means scope;
--add-port=8808/tcp indicates a specified open port in the format of [Port/Protocol]
--permanent means that it will take effect forever, if this parameter is not configured, the configuration will expire after restart.

Then restart the firewall

To view the firewall rules, use the following command:


Debian is open to designated ports

First, you need to install iptables, execute:

Suppose you want to open port 8088, execute

Then save the rule

After the setting, the specified port has been opened, but it will be invalid after restarting.

install iptables-persistent

Then execute the following two commands

Once the setup is complete, the configuration will not be invalid even if it is restarted.

Original:The hyperlink login is visible.





Previous:Nginx:413 Request Entity Too Large
Next:Enable dark (dark) mode based on Bootstrap
Posted on 4/3/2023 2:01:23 PM |
Learn it!!
Posted on 4/3/2023 4:57:13 PM |
Learn to learn
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com