Professional Documents
Culture Documents
Centos Iptables
Centos Iptables
# vi /etc/sysconfig/iptables
Press i for insert mode
*filter
:INPUT DROP [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
# Accept Packets from Trusted IP on specific port of your switch, add both origination & termination IP with port
-A INPUT -p udp --dport port -s IP/32 -j ACCEPT
# Insert add both origination & termination IP with port before COMMIT
COMMIT
Press Esc for command mode
To save & exit type- :wq
To exit without saving type- :!q
You need to restart iptables service after any change
To restart service:
# service iptables restart