Linux System as a Router
Before you start
Understanding working of Linux Router
We all know that router is a network device and used to communicate between two different networks. So, we must have a system which has minimum two network interfaces. We will assign static IP on one interface and on the other interface we will use DHCP to get IP address.
Steps to configure Ubuntu as Router:
Configure Network Interface :
sudo nano /etc/network/interfaces
Now, Check the Configuration of Interfaces :
ifconfig
Configure IP forward rule for IPv4 addresses :
sudo nano /etc/sysctl.conf Here you have to type "net.ipv4.ip_forward=1".
Now this is the final step and we have to create rules for iptables:
sudo iptables -t nat -A POSTROUTING -o ens33 -j MASQUERADE
Now, finally we have to restart the service of networking:
sudo /etc/init.d/networking restart
Finally, Verify our client machine configuration and reachability of WAN address :
Now, we have done our configuration and have to check the configuration and reachability of our WAN IP addresses on our click machine(i.e Windows XP in this case). We will find that we easily reach to any of the network through our Linux System.
Hence, our Linux working smootly without any problem and reachability is also fine.
No comments:
Post a Comment