How To Start iptables
You can start, stop, and restart iptables after booting by using the commands:
# service iptables start
# service iptables stop
# service iptables restart
To get iptables configured to start at boot, use the chkconfig command:.
# chkconfig iptables on
Determining The Status of iptables
# service iptables status
Firewall is stopped.
How to backup running iptables scripts
This example exports the iptables-save output to a text file named firewall-config.
# iptables-save > firewall-config
After editing the firewall-config file with the commands you need, you can reload it into the active firewall rule set with the iptables-restore command.
# iptables-restore < firewall-config
Finally, you should permanently save the active configuration so that it will be loaded automatically when the system reboots:
# service iptables save
If desired, you can eventually convert this firewall-config file into a regular iptables script so that it becomes more easily recognizable and manageable
Tips for Linux Ubuntu Fedora Centos RHEL Unix etc Some special Tips for Open source OS
Tuesday, November 11, 2008
Monday, November 10, 2008
How to make you Linux as Router
On linux You just need to run this command to act ur linux as router. Frist configure your both network interface. then run this command from terminal.
here I guess eth0 is ur Internet interface. If not then change it ti eth1
#echo "1" > /proc/sys/net/ipv4/ip_forward
#/sbin/iptables -t nat -A POSTROUTING -o -eth0 -J MASQUERADE
#/sbin/iptables save
#/sbin/chkconfig iptables on
here I guess eth0 is ur Internet interface. If not then change it ti eth1
Subscribe to:
Posts (Atom)