[NBLUG/talk] Interface Aliases
gandalf at sonic.net
Fri Apr 9 15:44:40 PDT 2004
Fast typing / slow thinking (on my part)
I had to run to the server after knocking myself off of ssh
Anyways it didn't work, but perhaps I misunderstood. I took everything off
route except for lo, then I did the four steps and got:
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.254 * 255.255.255.255 UH 0 0 0 eth0
192.168.33.1 * 255.255.255.255 UH 0 0 0 eth0
192.168.0.0 192.168.0.254 255.255.255.0 UG 0 0 0 eth0
192.168.33.0 192.168.33.1 255.255.255.0 UG 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
I then quickly modified httpd.conf and restarted httpd and checked
everything. I was dead in the water, so I quickly put it back to a known
I think perhaps I was supposed to leave up the default route.
Also this morning I was fooling arround with setting the default route to
the 192.168.33.1 gateway with the http requests coming over the
192.168.0.0 network and I had it working, but when I tested from outside
it was broken. Perhaps it was also sending replies to traffic from
192.168.0 to 192.168.33. The idea was to have it serve web pages on the
192.168.0 network while using the 192.168.33 network connection for
information for the served pages. I was able to shave off 25% of the wait
from a report in this manner.
This whole mess got started as a way to make a network migration from
192.168.0 to 192.168.33 simpler and a little less switch everything
off/switch everything on.
Soon we will have a single router ballancing the two internet connections
and then going to two seperate routers that in turn serve the 192.168.0
and 192.168.33 networks. Then the web server will be back to it's normal
life on the new 33 network.
>> You were right about the multiple gateway entries. I removed
>> the one from
>> the interface and it whent on blazing away. However I wonder about
>> defining two gateways with the two routers. I'll have to experiment.
>> However it still doesn't seem to be working correctly. I can reach the
>> webserver on the 192.168.33.0 network, but the router doesn't
>> seem to be
>> port forwarding correctly. I'm sure I had that working at one
>> point, but
>> this is not a linux issue but a router issue. Perhaps I
>> should re-install
>> the OS on the router.
> Oh silly me. I didn't see this the first time but now I see the routing
> table isn't correct.
>> 192.168.0.0 * 255.255.255.0 U 0 0
>> 0 eth0 192.168.33.0 * 255.255.255.0 U 0 0
>> 0 eth0 127.0.0.0 * 255.0.0.0 U 0
>> 0 0 lo default 192.168.0.254 0.0.0.0 UG
>> 0 0 0 eth0
> Now what this is going to do is tell "if you have any address in network
> 192.168.0, send it out eth0 and assume the host is directly reachable
> out eth0. if you have any address in network 192.168.33, do the same
> Of course this will fail because the host isn't reachable directly off
> of eth0. It must be forwarded through the correct gateway.
> What you want it do to is force it to send to the correct gateway
> instead of directly sending out on eth0. So you'll need something like
> remove entries for 192.168.0.0 and 192.168.33.0, then add the following
> (1) route add -host 192.168.0.254 dev eth0
> (2) route add -host 192.168.33.xxx dev eth0:0 (replace 'xxx' with actual
> gateway address)
> (3) route add -net 192.168.0.0 netmask 255.255.255.0 gw 192.168.0.254
> (4) route add -net 192.168.33.0 netmask 255.255.255.0 gw 192.168.33.xxx
> #1 and #2 tell your node how to reach the respective gateways (via eth0
> and eth0:0). Even though for both cases the routing table will display
> 'eth0', it matters that you specify the ":0" for the second gateway
> because that determines the source address sent out from your node. #3
> and #4 add the routes for each network, forcing traffic destined for
> each network to go to the specific gateway.
> This way, traffic destined for 192.168.0.* will go to gateway
> 192.168.0.254, and the traffic destined for 192.168.33.* will go to
> gateway 192.168.33.xxx (where xxx is the other gateway).
> Once you've set your routing table correctly, try the command
> 'traceroute' to some address in each subnet, and you'll be able to
> clearly see if it is being routed through the correct gateway.
> For example, if you see:
> % traceroute 192.168.0.23
> 1 192.168.0.254 ...
> 2 192.168.0.23 ...
> Then that address is being routed correctly. Vice-versa for the other
> network. If an address in both networks goes to the same gateway or no
> gateway at all, then there is a configuration problem.
> talk mailing list
> talk at nblug.org
More information about the talk