1833802 Members
2451 Online
110063 Solutions
New Discussion

Can't add route to host

 
SOLVED
Go to solution
Dexuser
New Member

Can't add route to host

I got folling sitation. Machine has multiply network cards and route table are

Destination Gateway Flags Refs Interface Pmtu
127.0.0.1 127.0.0.1 UH 0 lo0 4136
192.2.1.23 192.2.1.23 UH 0 lan5 4136
10.168.0.31 10.168.0.31 UH 0 lan0:1 4136
10.168.0.23 10.168.0.23 UH 0 lan0 4136
10.168.0.0 10.168.0.23 U 3 lan0 1500
10.168.0.0 10.168.0.31 U 3 lan0:1 1500
127.0.0.0 127.0.0.1 U 0 lo0 0
default 10.168.0.1 UG 0 lan0 0

I connect the some host with crossover cable via new ethernet card with ip 172.16.0.3/255.255.0.0 and run following command

route add 172.16.0.2 172.16.0.3 0
And new route table becomes

Destination Gateway Flags Refs Interface Pmtu
127.0.0.1 127.0.0.1 UH 0 lo0 4136
172.16.0.3 172.16.0.3 UH 0 lan2 4136
192.2.1.23 192.2.1.23 UH 0 lan5 4136
10.168.0.31 10.168.0.31 UH 0 lan0:1 4136
10.168.0.23 10.168.0.23 UH 0 lan0 4136
172.16.0.2 172.16.0.3 UH 0 lan2 0
10.168.0.0 10.168.0.23 U 3 lan0 1500
10.168.0.0 10.168.0.31 U 3 lan0:1 1500
127.0.0.0 127.0.0.1 U 0 lo0 0
default 10.168.0.1 UG 0 lan0 0

But when I trying to traceroute I got folowing warning
traceroute: Warning: Multiple interfaces found; using 10.168.0.31 @ lan0:1
traceroute to 172.16.0.2 (172.16.0.2), 30 hops max, 40 byte packets

And I could not send packets via 172.16.0.3 interface.

Wnat did I do wrong ?
2 REPLIES 2
TTr
Honored Contributor
Solution

Re: Can't add route to host

You did not do anything wrong. The traceroute commnad picks one of the IPs of the default lan0 and tries to find a route to the destination.

You should use the -i option in traceroute. Or forget about traceroute and see if you can connect to the crossover host via whatever and then verify the connection with netstat on either side.
Jeeshan
Honored Contributor

Re: Can't add route to host

try like this

#route add net 172.16.0.2 netmask 255.255.0.0 172.16.0.3 1
a warrior never quits