0
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.

1 Answers1

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.

womble
  • 95,029
  • 29
  • 173
  • 228