Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.156.16.0     0.0.0.0         255.255.252.0   U     0      0        0 eth0
168.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
0.0.0.0         10.156.16.1     0.0.0.0         UG    0      0        0 eth0

this is current kernel routing table.

I want to add entry by following command.

route add -net 14.1.0.0 netmask 255.255.255.0 gw 10.156.149.144

14.1.0.0/24 is subnet that i configure using Honeyd that is running on 10.156.149.144.

but route command gives error- SIOCDELRT: No such process.

so help me to add this entry in routing table.

share|improve this question

1 Answer 1

You can only set gateways on local subnets. This is because once you give a packet to another machine, it's free to route the packet any way it wants. So you might say "look, I want to route this packet destined for 14.1.0.1 via 10.156.149.144, so to get the packet there I'll pass it to 10.156.16.1", and then when you hand the packet to 10.156.16.1, it says "nah, I reckon packets to 14.1.0.1 should be routed to 192.0.2.254", and the packet doesn't go where you need it to go.

What you need to do is either get a direct connection to 10.156.149.144, or else tell 10.156.16.1 (and any other routers along the way) that it should route traffic to 14.1.0.0/24 in the direction of 10.156.149.144. Luckily, the "direct connection" can be a tunnel of some sort (VPN, GRE, etc), so you don't necessarily have to lay any cable.

share|improve this answer
    
but I'm able to add entry by following command- route add -net 14.1.0.0 netmask 255.255.255.0 gw 10.156.16.144 –  Avinesh Kumar Jul 13 '12 at 10:15
    
so why I can not add 10.156.149.144 as gateway . –  Avinesh Kumar Jul 13 '12 at 10:19
    
The first sentence of my answer covers that question. –  womble Jul 13 '12 at 10:24
    
so Is there another way of doing this other than configure router routing table?. –  Avinesh Kumar Jul 13 '12 at 10:27
    
can you elaborate this line - Luckily, the "direct connection" can be a tunnel of some sort (VPN, GRE, etc). because i'm not aware of deep knowledge of networking. –  Avinesh Kumar Jul 13 '12 at 10:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.