PDA

View Full Version : [ubuntu] How to configure Linux as a Gateway ?



honey_bee
October 13th, 2010, 11:09 AM
Hi,
I want to know the configuration steps for building Linux machine as a gateway.


Network A 192.168.1.0 .......<...Gateway......> Network B 176.16.0.0

thanks in advance
honey

alphacrucis2
October 13th, 2010, 12:33 PM
Hi,
I want to know the configuration steps for building Linux machine as a gateway.


Network A 192.168.1.0 .......<...Gateway......> Network B 176.16.0.0

thanks in advance
honey

The first thing you have to do is enable ip forwarding to turn the machine into a router. This is a setting in /etc/sysctl.conf which you will need to edit (requires admin rights) e.g gksudo gedit

Namely this bit:


# Uncomment the next line to enable packet forwarding for IPv4
#net.ipv4.ip_forward=1

Then you just configure your ethernet interfaces with the addresses and subnet masks you want and add any static routes via the route command.

Forgot to say. I believe the /etc/sysctl.conf file is only read during boot up or network restart. Probably easiest to reboot to make the change effective.