iptables logs

Centos6.5 is configured with the nat function of iptables, but I don't know if the jump is normal. You need to check the log. You can

modify the .
# /etc/syslog.conf
#Configure the info level log
kern.info     /var/log/iptables.log


Modify firewall configuration
#/etc/sysconfig/iptables
-A PREROUTING -d 123.111.10.25/32 -p tcp -m tcp --dport 8080 -j DNAT --to-destination 192.168.1.1:8080
-A POSTROUTING -d 192.168.1.1/32 -p tcp -m tcp --dport 8310 -j SNAT --to-source 123.111.10.25

#Add info level log
-A PREROUTING -d 123.111.10.25/32 -p tcp  -j LOG --log-prefix "PREROUTING" --log-level info
-A POSTROUTING -d 192.168.1.1/32 -p tcp   -j LOG --log-prefix "POSTROUTING" --log-level info


#Restart firewall service
service iptables reload

#Relog service
service rsyslog restart

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326217482&siteId=291194637