Beruflich Dokumente
Kultur Dokumente
Here is good news for you, if you have an old PC hardware. Dont throw it away. It can eliminate the
need of purchasing a router for your small network.
A Linux system could work as a powerful router in small network. You only have to install a Linux Distro
on your PC/Laptop and install an extra NIC if you only have one. It only takes two minutes to configure a
Linux machine as a router. This blog show you how to configure Linux as a router in few simple steps.
Prerequisites
1.
2.
3.
4.
5.
Topology
Figure 1 Topology
Linux as a Router
Steps
1. Configuring ip address
edit network connection setting from the setting menu
Figure 2 Config IP
address
Figure 3 Config IP
address
2. Enable ip forwarding
Run this command in terminal
sudo echo 1 /proc/sys/net/ipv4/ip_forward
This will give output as
1 /proc/sys/net/ipv4/ip_forward
To make the change permanent so after next boot you don't have to enable ip forwarding again. Edit
/etc/systcl.conf
and uncomment the line
net.ipv4.ip_forward=1
Linux as a Router
Figure 4
Linux as a Router
(NOTE: if you have a DHCP serer already in your environment you need not to follow this step just
configure your DHCP to provide gateway ip address as the ip address of LAN facing interface of Linux
machine or set "option 3 " as the ip address of Linux machine.)
6. Test the connectivity to internet on test pc
Figure 5
(NOTE: The interface used here i.e. eth0 & eth1 could be different on your machine i.e. the machine can
be connected to internet via a PPP (point to point) or wireless connection, so make change in
configuration according to your need.)