Re: Adding default gateway breaks networking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Antti,

You might try setting your routing like this:

Destination  Gateway     Genmask         Flags Metric Ref    Use Iface
10.0.0.0     10.0.0.2    255.0.0.0       UG    0      0        0 eth0
0.0.0.0      10.0.0.1    0.0.0.0         UG    1      0        0 eth0

Obviously you'll need to adjust netmask and network address for your
system.

The top line says that eth0 on the local box using address 10.0.0.2 is the
gateway address for network 10.0.0.0.  The bottom line states that
10.0.0.1, the IP address of the other machine, is the default gateway
address to network 0.0.0.0 (any destination not already listed in the
local routing table).

Note that Metric on the bottom line is set to 1.  This tells the kernel
that to access addresses in the 0.0.0.0 network that there is 1 hop to the
10.0.0.1 machine, with the top line telling the kernel how to access that
specific machine.  This creates a closed circuit for the kernel so it knows
the path to 0.0.0.0:

1st hop to  ->   gateway  to ->  destination
10.0.0.2  --->   10.0.0.1  --->   0.0.0.0

route add -net 10.0.0.0 gw 10.0.0.2 netmask 255.0.0.0 dev eth0
route add -net 0.0.0.0 gw 10.0.0.1 netmask 0.0.0.0 metric 1 dev eth0

Glen


On Thu, 12 Oct 2000, Antti Honkela wrote:

>
>I'm having strange network problems.  When I bring eth0 up with
>  ifconfig eth0 x.y.z.1 netmask 255.255.255.240 up
>everything works as it should: I can ping my own IP and the only
>other machine in the same network (x.y.z.14).
>
>When I try to add the other machine as default gateway with
>  route add default gw x.y.z.14
>everything breaks down: I can't even ping my own IP.
>
>To be precise I can ping the gateway, the replies just don't get back
>to ping in any reasonable time.  tcpdump shows that the packets
>actually do get out and I can even see the replies with
>  tcpdump -ni eth0
>but they don't seem get any further than that.  If I wait long enough
>the first packet comes back to ping after 74 seconds and the next ones
>after that each 74 seconds after the previous one.
>
>The same behaviour occurs with three different machines all running
>2.2.16 kernel (RedHat 6.2/7.0 stock) with different NICs (eepro100 and
>3c59x).  All the machines work fine in another network x.y.z'.0/24.
>
>Removing the default gateway restores the normal functionality for the
>network x.y.z.0/28, but other traffic is obviously impossible.
>
>
>Antti
>-
>: send the line "unsubscribe linux-net" in
>the body of a message to majordomo@vger.kernel.org
>

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org


[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux