Add new comment
Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
|
Step 8 is completely useless--don't try this at home kids...or at work for that matter.
"iptables --table nat --flush"
This will remove all chains from your current running netfilter table (firewall rules)...you just dropped your pants.
"iptables --delete-chain"
This will remove all chains from your current running nat table
"iptables --delete-chain"
No need to do this after a flush! There are no chains in your current running netfilter table because you already flushed it.
"iptables --table nat --delete-chain"
No need to do this after a flush! There are no chains in your current running nat table because you already flushed it.
"iptables --table nat --append POSTROUTING --out-interface eth0 -j MASQUERADE"
This will enable nat in your current running nat table until we get down to the restart below.
"iptables --append FORWARD --in-interface eth1 -j ACCEPT"
This is useless because forwarding is accepted because you flushed your netfilter table
"echo 1 > /proc/sys/net/ipv4/ip_forward"
This will turn on routing. To bad next time you boot, it will not be enabled. Use sysctl!!!!
"service iptables restart"
I love this one. This command will un-do every "iptable" command above. Now NAT is no longer running. When the iptables service is restarted, it reads the saved config and anything was in "current running" is gone. Instead, use iptables-save!
Congratulations, you have a router with no NAT. But don't worry, it will no longer be a router after you reboot it. It will go back to the way it was before you started...thankfully
Tim Martin, RHCE
Reply |





Recent comments
9 hours 43 min ago
15 hours 31 min ago
17 hours 22 min ago
19 hours 7 min ago
22 hours 58 min ago
1 day 4 hours ago
1 day 4 hours ago
1 day 9 hours ago
1 day 14 hours ago
1 day 20 hours ago