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
2 hours 8 min ago
3 hours 51 min ago
6 hours 17 min ago
6 hours 23 min ago
10 hours 57 min ago
12 hours 57 min ago
16 hours 21 min ago
18 hours 28 min ago
18 hours 39 min ago
21 hours 5 min ago