I up a vlan device eth0.100 as 192.168.1.100. The eth0 have address 10.137.16.108
It looks work good when I ping with address.
$ ping 10.137.16.108 -I 192.168.1.1
PING 10.137.16.108 (10.137.16.108) from 192.168.1.100 : 56(84) bytes of data. 64 bytes from 10.137.16.108: icmp_seq=1 ttl=64 time=0.153 ms 64 bytes from 10.137.16.108: icmp_seq=2 ttl=64 time=0.058 ms 64 bytes from 10.137.16.108: icmp_seq=3 ttl=64 time=0.060 ms ^C --- 10.137.16.108 ping statistics --- 3 packets transmitted, 3 received, 0% packet loss, time 1998ms rtt min/avg/max/mdev = 0.058/0.090/0.153/0.045 ms
but if I use device name eth0.100 to do same ping got Destination Host Unreachable.
$ ping 10.137.16.108 -I eth0.100
PING 10.137.16.108 (10.137.16.108) from 192.168.1.100 eth0.100: 56(84) bytes of data. From 192.168.1.100 icmp_seq=1 Destination Host Unreachable From 192.168.1.100 icmp_seq=2 Destination Host Unreachable From 192.168.1.100 icmp_seq=3 Destination Host Unreachable ^C --- 10.137.16.108 ping statistics --- 5 packets transmitted, 0 received, +3 errors, 100% packet loss, time 4024ms
I guess that is a issue about arp table
$ arp
Address HWtype HWaddress Flags Mask Iface 10.137.16.108 (incomplete) eth0.100
Because I need the vlan device name to use SOL_SOCKET & SO_BINDTODEVICE to send raw socket Could you help me.
Thanks
ip addr show
andip route show
?