Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'd like to get my Ubuntu 11.04 server to route packet between its two network interfaces.

The two ethernet interfaces (eth0, eth1) work apparently well as such. Both have static IP addresses (192.168.2.15 & 192.168.3.15) and both are reachable from their respective network. All IP services as well as the Samba server are reachable from both sides.

sysctl -p returns "net.ipv4.ip_forward=1" and I can even ping the interface "on the other side" from both networks. In other words: I can ping 192.168.2.15 from all PCs on the 192.168.3.0 network and 192.168.3.15 from all systems on the 192.168.2.0 net. But I cannot reach any other address on the respective "other side"

I've already read numerous "how to" articles and Forum threads on this very topic of setting up Ubuntu as a router, but I just don't find the final solution to my problem.

Here are also some further information on the setup.

Kernel IP routing table shows:

Destination Gateway     Genmask     Flags   Metric  Ref Use Iface
default 192.168.3.1 0.0.0.0     UG  100 0   0   eth0
192.168.2.0 *       255.255.255.0   U   0   0   0   eth1
192.168.3.0 *       255.255.255.0   U   0   0   0   eth0

interfaces shows:

iface eth0 inet static
    address 192.168.3.15
    netmask 255.255.255.0
    broadcast 192.168.3.255
    network 192.168.3.0
    gateway 192.168.3.1


iface eth1 inet static
    address 192.168.2.15
    netmask 255.255.255.0
    broadcast 192.168.2.255
    network 192.168.2.0

I do not need any NAT or DHCP. There is no firewall running (no ufw, no iptables settings). Both networks have their own firewall protected internet connection and the connected devices get their IP addresses from the respective internet routers. I just want to be able to reach for example printers on one network from clients on the other.

What am I missing? Does anyone have any idea?

Many thanks in advance!

share|improve this question
add comment

1 Answer

I've noticed that IP forwarding seems to fail if network manager is managing the interfaces involved in the forwarding. Maybe someone else could explain why?

try adding:

[keyfile]
# interfaces not to manage with Network Manager
unmanaged-devices=mac:00:22:68:1c:59:b1;mac:00:1E:65:30:D1:C4

to your /etc/NetworkManager/NetworkManager.conf where you replace the mac addresses above with the ones of your network cards.

or disabling network manager entirely if you don't need it.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.