linux - ip route command with source option -
linux - ip route command with source option -
i have multiple interfaces on scheme catering different subnets. have pseudo interface p-to-p driver tunneling packets. trying add together routes using ip route command utilize specific interfaces' source ip when sending packets out on tunnel interface.
in example, want utilize 11.11.11.1 source ip set on eth1.100 when sending packets 60.60.60.1 reachable on tunnel. how route table looks like.
/tmp # ip route show 60.60.60.1 dev tsgw scope link src 11.11.11.1 >> added route. 11.11.11.0/24 dev eth1.100 proto kernel scope link src 11.11.11.1 default via 192.168.1.254 dev eth1.4094 metric 10 192.168.1.0/24 dev eth1.4094 proto kernel scope link src 192.168.1.3
if ping 60.60.60.1, still picks interface through default route programmed.
ping 60.60.60.1 (60.60.60.1): 56 info bytes 19:35:32.848428 ip 192.168.1.3 > 60.60.60.1: icmp echo request, id 16986, seq 0, length 64 19:35:33.848621 ip 192.168.1.3 > 60.60.60.1: icmp echo request, id 16986, seq 1, length 64 19:35:34.848819 ip 192.168.1.3 > 60.60.60.1: icmp echo request, id 16986, seq 2, length 64
am doing wrong setting source? whats right way go this? looking send packets taking tsgw interface utilize specific private source ip.
eth1.100 link encap:ethernet hwaddr 00:0b:86:b8:91:10 inet addr:11.11.11.1 bcast:11.11.11.255 mask:255.255.255.0 broadcast running multicast mtu:1602 metric:1 rx packets:560 errors:0 dropped:0 overruns:0 frame:0 tx packets:12 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 rx bytes:97395 (95.1 kib) tx bytes:704 (704.0 b) tsgw link encap:point-point protocol inet addr:127.0.0.2 p-t-p:127.0.0.2 mask:255.255.255.255 pointopoint running noarp multicast mtu:960 metric:1 rx packets:0 errors:0 dropped:0 overruns:0 frame:0 tx packets:6240 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 rx bytes:0 (0.0 b) tx bytes:1121650 (1.0 mib)
you should ping source interface eth1.100
ping 60.60.60.1 -i eth1.100
linux networking
Comments
Post a Comment