how do I enable packet forwarding for an ethernet dsl modem? Must this be done with iptables?
4 Answers
You enable packet forwarding on a Linux (2.6.x kernel) router by executing the following command as root ...
# echo "1" >/proc/sys/net/ipv4/ip_forward
You will need to execute this command every time you start/reboot your machine. Add the command to your equivalent of /etc/rc.local so that it is automatically executed for you.

- 1,613
- 10
- 8
-
1or put "net.ipv4.ip_forward=1" in /etc/sysctl.conf, which is the easiest way of setting values in proc. – David Pashley Jun 10 '09 at 07:05
Log in as root. Type the following exactly as it appears
echo 1 > /proc/sys/net/ipv4/ip_forward
Then type this exactly as it appears
echo "net.ipv4.ip_forward = 1" >> /etc/sysctl.conf
The first line sets packet forwarding in the kernel; the second line ensures that it survives a reboot.

- 14,536
- 1
- 51
- 88
I'm assuming this is an DSL router presented as an ethernet device. Are you able to ping the internal interface of the router? If not, there's a configuration problem on the lan side of the device.
Does the router have diagnostic tools built in? Can you ping out from the router? Can you ping an internal device? If you can, then the problem lies in the forwarding between the two interfaces. It could be a firewall or a possible NAT problem.
If you can't ping out, then there is a problem with the DSL connection. If you can't ping in, then there's a problem with the LAN interface.

- 23,497
- 2
- 46
- 73
-
-
-
-
1It hasn't logged onto your ISP properly, I'm guessing it hasn't been given the external gateway address. Use it's admin screen to disconnect and then reconnect. – staticsan Jun 10 '09 at 06:01
-
Yes, it would appear that some settings were not correctly set on the new modem. I'd contact the ISP support and get them to help you check all your settings. – David Pashley Jun 10 '09 at 07:04
If I understand your question correctly, iptables
won't help you. It sounds like you can ping your ethernet router, but nothing beyond it. To figure this out, you need to tell us what router model you have and whether you have static or dynamic IP addresses.

- 11,432
- 8
- 37
- 48