[NTLUG:Discuss] setting routes with mandrake 9.0
robert apodaca
rapodaca at raacc.com
Tue Feb 3 08:36:51 CST 2004
On Tue, 03 Feb 2004 08:15:53 -0600
Jay Urish <j at unixwolf.net> wrote:
> Ok I think my big problem is that I can't get the default gateway for the
> b.b.b.b net to be 192.168.1.1
And rightfully so... your current route table does not allow you to reach 192.168.1.1
>
> It keeps wanted to make it 0.0.0.0
0.0.0.0 is used to broadcast for addresses on this network instead of routing through another IP
>
> Kernel IP routing table
> Destination Gateway Genmask Flags Metric Ref Use Iface
> 192.168.11.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
> 216.59.195.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
> 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
> 0.0.0.0 216.59.195.1 0.0.0.0 UG 0 0 0 eth0
> root at ns:~>
Let's break this down by each line.
Line 1 says that if you intend to reach any host whose ip address is 192.168.11.1 - 192.168.11.254 then broadcast via ethernet interface 1.
Line 2 says that if you intend to reach any host whose ip address is 216.59.195.1 - 216.59.195.254 then broadcast via ethernet interface 0.
Line 3 says that if you intend to reach any host whose ip address is 127.0.0.1 - 127.254.254.254 then broadcast via loopback device 0.
Line 4 says that if you intend to reach any host whose ip address doesn't fall within the ranges of the above 3 lines, then ask 216.59.195.1 if it can route it.
Since 192.168.1.1 does not fall within the above ranges nor can be reached via your default gw (216.59.195.1), you can't reach it.
You need to either have a way to broadcast directly to 192.168.1.1 or route to it.
Here are a few ways you can reach 192.168.1.1:
1. Broadcast for it:
Change the ip address of eth1 to something in the 192.168.1.0 network. (unless theres some compelling reason not to)
OR
Change the netmask of eth1 so that it will broadcast 192.168.0.0 - 255.255.0.0 instead of 192.168.11.0 255.255.255.0 (note that you would have to change the netmask of your entire network in order for this to work)
OR
Add an aliased ethernet device - eth1:1 192.168.1.X 255.255.255.0
OR
Add a third ethernet device - eth2 192.168.1.X 255.255.255.0
2. Route to it:
Add a router with interfaces to all networks you need to reach.
Once you can reach 192.168.1.1, then you can add a static route for b.b.b.b via 192.168.1.1.
example:
route add -net b.b.b.b netmask bbb.bbb.bbb.bbb gw 192.168.1.1
Cheers,
-Rob
More information about the Discuss
mailing list