Wednesday, March 18, 2009

Router Debian

First prepare your computer with 2 lan card is eth0 and eth1.

1. Make sure the program is installed iptables

2. And open the console

3. Remove the rules that already exist with the command as follows:

* Iptables-flush
* Iptables-table nat-flush
* Iptables-delete-chain
* Iptables-table nat-delete-chain

4. Then do the settings for the Masquerade and forwarding with the command as follows:

* Iptables-table nat-append POSTROUTING-out-interface eth0-j Masquerade
Iptables-append * Forward-in-interface eth1-j ACCEPT
* Echo 1> / proc/sys/net/ipv4/ip_forward

5. Save firewall rules have been made with the command as follows:

* Iptables-save> / etc / firewall.conf

6. Then, create a file with a name in the directory iptables / etc / network / if-up.d /
iptables:
* Vi / etc / network / if-up.d / iptables
* Inside type the command:

#! / bin / sh

iptables-restore
echo 1> / proc/sys/net/ipv4/ip_forward

* Then save the file

7. Provide access to execution so that firewall rules have been created that can be used since
the process of booting with the command:

chmod + x / etc / network / if-up.d / iptables

8. Restart your Computer to do the testing iptables rules.

9. Done.
Indonesian