Ubuntu gateway

I’ve always known Linux was easy to setup as a router but until just now I’d never actually gotten round to figure out how to turn a box into a gateway. I knew how to setup the network side, setting up the routes etc. but the bit where you tell a box to forward packets from one network to another I just never got around to finding. It’s dead simple so I figured I’d better jot it down for the next time.

Edit the /etc/sysctl.conf and uncomment out the net.ipv4.ip_forward=1 line.

To set forwarding right now without a reboot or restart of anything you should then do this,

echo 1 > /proc/sys/net/ipv4/ip_forward

If you’re after a more detailed guide covering setting up your own gateway I found this information from http://technology.ezinemark.com/ubuntu-firewall-router-gateway-31d0966f5c3.html which covers the whole subject in more detail.

 

About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 64 other followers