The sshin the command translates to the port number 22, which the protocol uses by default. In this article we will setup and configure Basic iptables on Linux systems (Debian Family “Debian 8 “jessie”/Ubuntu 14.04, and higher”). [root@server ~]# iptables -A INPUT -p tcp --dport 80 -j ACCEPT [root@server ~]# iptables -L Chain INPUT (policy DROP) target prot opt source destination ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED ACCEPT icmp -- anywhere anywhere ACCEPT all -- anywhere anywhere ACCEPT tcp -- anywhere anywhere state NEW tcp dpt:ssh ACCEPT tcp -- … But this can also be applied on other Debian based OSes like Ubuntu and Knoppix. sudo iptables -A INPUT -p tcp --dport ssh -j ACCEPT. To enable access to an HTTP web server, use the following command. – Messa Jan 16 '17 at 10:15 debian下iptables输入命令后即时生效,但重启之后配置就会消失,可用iptables-save快速保存配置,因为Debian上iptables是不会保存规则的,然后在开机自动的时候让iptables自动加载刚刚导出的配置文件,方法如下: 若要停止iptables,iptables -F清空所有配置效果等同于停止。 This is equivalent to deleting all the rules one by one. Iptables is a Linux command line firewall system that system administrators use to allow or block traffic into their networks. You show execute all these commands as the root user or use the sudo command to do it. If you are doing some changes and want them to apply manually from console, there is a safer command iptables-apply - after a timeout it reverts all changes back if you accidentally cut yourself out of your server. iptables-restore is good for OS start scripts.
Lets see how to configure iptables on linux This article explains how to make IPtables firewall rules sustain a boot in Debian. The same command structure can be used to allow traffic to other ports as well. iptables options iptables -X iptables -F iptables -t table -X iptables -t table -F iptables -P chain ACCEPT To flush the selected chain or all the chains in the table pass the -F option to iptables command.
This is the first step every experienced sysadmin must do Just after finishing installing the Linux OS “any member in any Family of Linux systems”.