[Novalug] Ubuntu Router

Kevin Dwyer kevin at pheared.net
Wed Mar 21 10:15:45 EDT 2007


On Wed, Mar 21, 2007 at 09:32:23AM -0400, Brian Steisslinger wrote:
> Has anyone got any tips for setting up an ubuntu box to route between two
> segments.
> 
> I've got two wired NICS
> 
> 10.1.1.1
> and
> 10.1.2.1
> 
> I am trying to set up a host on the 10.1.2.1 subnet and route the traffic to
> the 10.1.1.1 subnet
> 
> Any ideas?

Make sure the netmask is set properly on both interfaces.  I'm assuming
you want 10.1.1/24 and 10.1.2/24.  (The netmask is 255.255.255.0 in both
cases.)

You need to turn on IP forwarding.
echo 1 > /proc/sys/net/ipv4/ip_forward

(This isn't persistent across reboots.)

Barring anything more complicated, you probably don't need much more
configuration than that.  Make sure your iptables rules are configured
how you want them.  Read up on using Linux as a router for more
interesting configurations.

-kpd



More information about the Novalug mailing list