Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 04-20-2005, 05:05 PM   #1
Registered: Feb 2005
Location: Ottawa/Montréal
Distribution: Slackware + Darwin (MacOS X)
Posts: 468

Rep: Reputation: 30
My gateway can't route

EDIT: I needed this too
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
Why do I always notice these things seconds after I post. Mods: I won't be saddened if you delete/merge this thread.


eth1 is connected to a hub, eth0 to my DLink router through which it accesses the internet. No problems there as I can browse everything from the gateway machine (which I'm on right now).

I can connect a laptop to the hub and it gets an IP address, router and subnet

I can connect to's httpd but can't route to anything past the gateway like or even (DLink config page). `lynx` from the gateway also works.

Given what follows, why the fudge not? I've been racking my brain about this for days and I can't for the life of me figure out why it doesn't work properly. (The dhcp lease time was reduced to 5 seconds for debugging purposes).

root@gateway:/# cat /proc/sys/net/ipv4/ip_forward
root@gateway:/# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:11:09:E9:61:E0
          inet addr:  Bcast:  Mask:
          RX packets:3088 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2015 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1293423 (1.2 Mb)  TX bytes:318924 (311.4 Kb)
          Interrupt:10 Base address:0x4000

eth1      Link encap:Ethernet  HWaddr 00:11:09:E9:61:E1
          inet addr:  Bcast:  Mask:
          RX packets:411 errors:0 dropped:0 overruns:0 frame:0
          TX packets:170 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:58204 (56.8 Kb)  TX bytes:40497 (39.5 Kb)
          Interrupt:3 Base address:0xe000
root@gateway:/# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface        *        U     0      0        0 eth1     *        U     0      0        0 eth0
loopback        *            U     0      0        0 lo
default         UG    1      0        0 eth0
root@gateway:/# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
root@gateway:/etc# cat dhcpd.conf
ddns-update-style none;
default-lease-time 5;
max-lease-time 5;

subnet netmask {
        option routers;
#       option subnet-mask;
        option domain-name-servers,;
        option ip-forwarding on;
And, aplty:
root@gateway:/# fortune
Command, n: Statement presented by a human to a computer in such
     a manner as to make the human feel as if he were in control
Though I don't much feel it at the moment.

This is a continuation from this thread ( ).

I know it's bad practice to double post but the old thread was...less than pretty and contained lots of outdated and confusing information on my part.

I also claimed I found an answer by restting the netmask of eth1 to which doesn't work. That means I stumbled upon the answer by a fluke I haven't been able to reproduce.

Last edited by michaelsanford; 04-20-2005 at 05:10 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I keep gateway route across restarts? moonmoth Linux - Networking 3 09-04-2005 07:35 AM
default route without a gateway scylla Linux - Networking 1 10-21-2004 01:40 AM
/sbin/route -n and defautl gateway shanenin Linux - Networking 1 02-05-2004 01:10 PM
Route and Gateway Issues shaggz Linux - Networking 2 10-29-2003 12:33 PM
Ip Route Voice Gateway digicom Linux - Networking 1 08-22-2001 10:43 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:57 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration