using a Ubuntu server as a gateway

Asked by bill purvis on 2008-08-22

I've been running a server/firewall for some time using Mandrake and have decided to
switch to Ubuntu, which I have been using on my front-end/laptop. I have installed
Ubuntu server on the new server box and configured it all (as I thought) to match,
as near as possible, the configuration on the old server. Today I finally bit the bullet
and switched the cable to my ADSL modem. The server seemed to be able to
access the outside world OK, but my laptop, despite modifying the gateway
information to route via the new server, gets no response from the outside world.
I have set up iptables on the new server to allow incoming traffic on the ADSL port (eth1)
only for ssh,ftp and http, all else should be blocked. Traffic from local network (eth0)
should be accepted or forwarded. As near as I can determine the setup on my two
servers is the same (apart from distribution and age) but the Ubuntu server is
blocking any through traffic, while the Mandrake one is fine.

Any suggestions as to how to fix it would be most welcome!

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu gnome-nettool Edit question
Assignee:
No assignee Edit question
Solved by:
bill purvis
Solved:
2008-08-22
Last query:
2008-08-22
Last reply:
2008-08-22
Dave Walker (davewalker) said : #1

Hi Bill,

Have you enabled packet forwarding?

If not, try it with:
# echo 1 > /proc/sys/net/ipv4/ip_forward

bill purvis (bill-billp) said : #2

Thanks, Dave.
That works fine.

Can you now tell me the best way to get this automatically?

Dave Walker (davewalker) said : #3

Hi Bill,

Add to /etc/sysctl.conf:
net.ipv4.ip_forward=1

bill purvis (bill-billp) said : #4

Excellent, many thanks!