Please go through the below network diagram
Here Linux PC has four NIC cards and all four are diffrent networks. Linux Box can act as a router that manages 4 different networks.
Step1:First of all make sure you have firewall enabled.
[root@server ~#]service iptables status
[root@server ~#]service iptables start
[root@server ~#]chkconfig iptables on
Step2: Go to GUI mode and select System->Administration->Firewall
then select "Masquerading" and tick the WAN interface,here "eth3" (internet connected).
and save the firewall changes.(masquerading also can be done in command line interface)
Step3:restart iptables
[root@server ~#]service iptables restart
Step4: In all client machines set local ipaddress of Linux machine of the same network as "default router"
(Here in the pc with ipaddress 192.168.10.50, set 192.168.10.1 as default gateway ) also set DNS addresses of the ISP in all client computers as Prefered DNS and alternative DNS(or use google's public DNS servers 8.8.8.8 and 8.8.4.4.)
Do this in all PCs.
Now ping google.com from client PCs or/and browse internet in web browsers.
You can also masquerade other interfaces inthe same way, and make your perfect router.
You can also masquerade other interfaces inthe same way, and make your perfect router.
0 comments:
Post a Comment