How to Configure Linux as a Router - Tech CCNA

Tech CCNA

Today E - Learning , is a best idea to study , therefore this website is best for network and network security concepts.

Breaking

Post Top Ad

Responsive Ads Here

Wednesday 3 January 2018

How to Configure Linux as a Router

How to Configure Linux/Ubuntu as a Router | Tech CCNA

Linux System as a Router



Before you start

Objectives : You will be able to configure your machine as a Router.

Prerequisites: You have to know the basic of Network and Linux System.

Tags : Linux as Router, Ubuntu as Router.


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.



http://www.techccna.com

Steps to configure Ubuntu as Router:



Configure Network Interface :
sudo nano /etc/network/interfaces
http://www.techccna.com


Now, Check the Configuration of Interfaces :
ifconfig
http://www.techccna.com


Configure IP forward rule for IPv4 addresses :
sudo nano /etc/sysctl.conf Here you have to type "net.ipv4.ip_forward=1".
http://www.techccna.com


Now this is the final step and we have to create rules for iptables:
sudo iptables -t nat -A POSTROUTING -o ens33 -j MASQUERADE
http://www.techccna.com


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.

http://www.techccna.com


http://www.techccna.com

Hence, our Linux working smootly without any problem and reachability is also fine.

No comments:

Post a Comment

Pages