||BERBAGI CERITA||
||SHARING BERITA||









Router Slack  

After We configure the network, exam:
eth0 ==> 202.155.0.187 netmask 255.255.255.248 and ISP's gateway 202.155.0.185
eth1 ==> 172.16.1.33 netmask 255.255.255.224
and you should add name server ...

vi /etc/resolv.conf
insert your own domain name server!
after it....We should make active ip forwarding, and run it with type:
/etc/rc.d/rc.ip_forward start
And then, you may create some firewall script.
iptables -A INPUT -i eth0 -j ACCEPT
iptables -A INPUT -i eth1 -j ACCEPT
And that rules will allow incoming packet from eth0 and eth1.

-iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
-iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT
and that rules will make some relation between network A and network B, so they can communicate together.

-iptables -A OUTPUT -o eth0 -j ACCEPT
-iptables -A OUTPUT -o eth1 -j ACCEPT
and that rules will allow outgoing connection or packet from eth0 and eth1.

Now, if you're really have the connection to the Internet. You should set your rule iptables, and using NAT (Network Address Translation) to make your private network get Internet access.
-iptables - t nat -A POSTROUTING -s (your network ip / subnet mask) -d 0.0.0.0/0 -j SNAT --to-source (your ip public)
Ok, finish and you've made some rule to put in your firewall. And now you have to save them.
Now, create a new file in specific directory, for example in /etc/firewall.scrpt and of course use text editor. examp "vi"
-vi /etc/firewall.scrpt
then save and exit!
-:wq!
Now, you have to save your iptables rule in that file.
-iptables-save > /etc/firewall.scrpt
Ok, Finish.......
Now you must test your PC Router that shown "work".
Ping to router.....if reply, that mean success
-ping to ISP's gateway.....if reply, you've succed too.
-ping to google.com.....if reply, you're really succes configure your PC to be PC Router.

Powered By Blogger