Operating System - Linux
1821534 Members
2970 Online
109633 Solutions
New Discussion юеВ

Re: two default working route and one nic

 
hturker
Frequent Advisor

two default working route and one nic

hello i have ont 1:10Gb Ethernet blade switch and a bl465

i wated to give two different ip two nic

which
eth0 150.150.220.38
netmask 255.255.255.0
gw 150.150.220.1

eth1 150.150.200.31
netmask 255.255.255.0
gw 150.150.200.1

if i did not give any route command they work very nice

but i wanted to give route command
route add -net 150.150.200.0 netmask 255.255.255.0 gw 150.150.200.1 dev eth1

route add -net 150.150.220.0 netmask 255.255.255.0 gw 150.150.220.1 dev eth0

and add two default gw

route add default gw 150.150.200.1 dev eth1
route add default gw 150.150.220.1 dev eth0

after this i make a control

i can ping 150.150.200.1 and i can ping 150.150.200.38 from a machine in the same network with 150.150.200.0/24

i can ping 150.150.220.1 and i can ping 150.150.220.31 from a machine in the same network with 150.150.220.0/24

and from a other network which is connected froma backbone 150.150.218.0/24
i can ping 150.150.220.38 but i cant ping 150.150.200.31


why?
8 REPLIES 8
Hakki Aydin Ucar
Honored Contributor

Re: two default working route and one nic

can you issue the commands:

in your server:
netstat -rn

from backbone:
# traceroute 150.150.200.31
hturker
Frequent Advisor

Re: two default working route and one nic

this is a pic from my desktop

http://img28.imageshack.us/img28/4331/53595831.jpg


netstat -rn
route -n

and when i tracert from 150.150.218.1 blok icant reach there

but in the below youu see secure crt and i am in 150.150.200.1 blok there ica ping that ip
hturker
Frequent Advisor

Re: two default working route and one nic

Hakki Aydin Ucar
Honored Contributor

Re: two default working route and one nic

As far as I got the picture this is windows OS and not able to access to unix ;

you need a route add from machine that cannot reach this I address like this:

route -p add 150.150.200.0 mask 255.255.255.0 metric 1

By the way you can access from unix to windows ; I mean from IP 150.150.200.31 you are able to access to machine in backbone ?
hturker
Frequent Advisor

Re: two default working route and one nic

no not look at the os

i can reach my 150.150.200.31 machine from every type of machine in the same blok but i cant reach from 150.150.218.0/24 blok

in that pic windows is in 218 blok and at the back the secure crt is in 200 blok
Matti_Kurkela
Honored Contributor

Re: two default working route and one nic

If you specify two default gateways, the one that happens to be listed first in the routing table will get all the traffic that has no more specific route. The second gateway will be used only if the first one fails.

If you have two independent routes to the Internet and want to load-balance your outgoing traffic between them, you should read the Advanced-Routing-HOWTO (find it in the HOWTO document collection packages for your distribution, or just google for it).

> route add -net 150.150.200.0 netmask 255.255.255.0 gw 150.150.200.1 dev eth1

By your configuration, the eth1 NIC is already directly connected to the 150.150.200.* network and can communicate directly with any host in it. There should be no need to go through the gateway: it only generates unnecessary traffic to the gateway. This route makes no sense.

> route add -net 150.150.220.0 netmask 255.255.255.0 gw 150.150.220.1 dev eth0

The same argument seems to apply to the eth0 NIC too. There should be no need to use any gateway to access any host in the 150.150.220.* network, because eth0 is directly connected to that network.

If you _need_ to specify the routes listed above to make things work, your network may have other problems you should fix instead of working around them. Maybe an incorrect netmask or something?

> from a other network which is connected froma backbone 150.150.218.0/24
i can ping 150.150.220.38 but i cant ping 150.150.200.31

Have you told _the gateway_ that brings in the traffic from the backbone to 150.150.218.* that 150.150.200.31 can be found by going through 150.150.220.38? If you haven't the gateway has no reason to send the traffic in that way and the traffic will never reach your blade.

In other words, the gateway 150.150.220.1 should be configured with a route like this:

route add -host 150.150.200.31 gw 150.150.220.38 dev

And the gateway 150.150.200.1 should be configured with this:

route add -host 150.150.220.38 gw 150.150.200.31 dev

If you want your bl465 to act as a router between the two networks, you should enable IP forwarding and instead of the two routes listed above, you should configure your gateways with routes that allow the entire opposite segment to be reached through your blade:

Route for 150.150.220.1:
route add -net 150.150.200.0 netmask 255.255.255.0 gw 150.150.220.38 dev

Route for 150.150.200.1:
route add -net 150.150.220.0 netmask 255.255.255.0 gw 150.150.200.31 dev

NOTE: before allowing traffic to pass through your blade from one network segment to the other, talk with your network admins.

If you join together two segments that are designed to be separate for e.g. security reasons, the network admins will be very unhappy with you.

The same will be true if you accidentally create a routing loop that brings the network to its knees.

MK
MK
Rob Leadbeater
Honored Contributor

Re: two default working route and one nic

Hi,

Can you give us some more information about the network infrastructure that you're connected to ?

The output of "netstat -rn" from both the Linux box and your Windows machine would be useful to see - (as text not a picture !)

As Matti says, some of the routes that you have entered are not necessary. It's also not usually advisable to have two default gateways, as it can be difficult if not impossible to determine what traffic will go over what interface...

Cheers,

Rob
Hakki Aydin Ucar
Honored Contributor

Re: two default working route and one nic