How to Configure Linux as a Router - Tech CCNA

Papermag-smooth

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

Post Top Ad

Wednesday, 3 January 2018

demo-image

How to Configure Linux as a Router

Responsive Ads Here
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.



Lab+setup

Steps to configure Ubuntu as Router:



Configure Network Interface :
sudo nano /etc/network/interfaces
interface


Now, Check the Configuration of Interfaces :
ifconfig
ifconfig


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


Now this is the final step and we have to create rules for iptables:
sudo iptables -t nat -A POSTROUTING -o ens33 -j MASQUERADE
restart+service


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.

verify1


verify2

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

No comments:

Post a Comment

Pages