On Fedora 20 x86_64.
According to "man ping", ping should work from a subinterface specifying either the interface name or its address:
-I interface interface is either an address, or an interface name. If inter‐ face is an address, it sets source address to specified inter‐ face address. If interface in an interface name, it sets source interface to specified interface.
I've got a subinterface and I'm trying to ping from it.
# ifconfig eth3:sub1 eth3:sub1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 172.17.30.143 netmask 255.255.254.0 broadcast 172.17.31.255 ether 90:e2:ba:34:46:41 txqueuelen 1000 (Ethernet) device memory 0xdc7e0000-dc800000
If I ping from the address, it works as specified. If I specify the interface name instead, I see:
# ping -I eth3:sub1 172.17.30.1 ping: SO_BINDTODEVICE: Invalid argument
Investigating a little deeper:
# strace ping -I eth3:sub1 172.17.30.1 execve("/usr/bin/ping", ["ping", "-I", "eth3:sub1", "172.17.30.1"], [/* 38 vars */]) = 0 ... setsockopt(4, SOL_SOCKET, SO_BINDTODEVICE, "eth3:sub1\0", 13) = -1 ENODEV (No such device) ... +++ exited with 2 +++
Any thoughts?
On 06/02/2014 11:18 AM, CLOSE Dave issued this missive:
On Fedora 20 x86_64.
According to "man ping", ping should work from a subinterface specifying either the interface name or its address:
-I interface interface is either an address, or an interface name. If inter‐ face is an address, it sets source address to specified inter‐ face address. If interface in an interface name, it sets source interface to specified interface.
I've got a subinterface and I'm trying to ping from it.
# ifconfig eth3:sub1 eth3:sub1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 172.17.30.143 netmask 255.255.254.0 broadcast 172.17.31.255 ether 90:e2:ba:34:46:41 txqueuelen 1000 (Ethernet) device memory 0xdc7e0000-dc800000
If I ping from the address, it works as specified. If I specify the interface name instead, I see:
# ping -I eth3:sub1 172.17.30.1 ping: SO_BINDTODEVICE: Invalid argument
Investigating a little deeper:
# strace ping -I eth3:sub1 172.17.30.1 execve("/usr/bin/ping", ["ping", "-I", "eth3:sub1", "172.17.30.1"], [/* 38 vars */]) = 0 ... setsockopt(4, SOL_SOCKET, SO_BINDTODEVICE, "eth3:sub1\0", 13) = -1 ENODEV (No such device) ... +++ exited with 2 +++
Any thoughts?
"eth3:sub1" isn't an interface, it's an alias. The interface name is the bit before the ":" (or "." in the case of a VLAN).
If you were to do a "netstat -rn", you'd only see "eth3" as a network device. You wouldn't see "eth3:sub1" listed. ---------------------------------------------------------------------- - Rick Stevens, Systems Engineer, AllDigital ricks@alldigital.com - - AIM/Skype: therps2 ICQ: 22643734 Yahoo: origrps2 - - - - First Law of Work: - - If you can't get it done in the first 24 hours, work nights. - ----------------------------------------------------------------------
I wrote:
# ping -I eth3:sub1 172.17.30.1 ping: SO_BINDTODEVICE: Invalid argument
Rick Stevens responded:
"eth3:sub1" isn't an interface, it's an alias. The interface name is the bit before the ":" (or "." in the case of a VLAN).
If you were to do a "netstat -rn", you'd only see "eth3" as a network device. You wouldn't see "eth3:sub1" listed.
Thanks. And you are obviously correct, technically. But this command worked as I expected on earlier versions of Fedora. We now have many procedures with such commands embedded and were surprised to discover they no longer work on F20. Why was it changed?
I wrote:
Thanks. And you are obviously correct, technically. But this command worked as I expected on earlier versions of Fedora. We now have many procedures with such commands embedded and were surprised to discover they no longer work on F20. Why was it changed?
I take it back. I was led to believe things were working in the past. In fact, the difference is that F20 refuses to do the ping whereas earlier versions complained and then fell back to pinging from the interface address.
F20: # ping -I eth3:sub1 172.17.30.1 ping: SO_BINDTODEVICE: Invalid argument
F14: # ping -I eth3:sub1 172.17.30.1 Warning: cannot bind to specified iface, falling back: No such device PING 172.17.30.1 (172.17.30.1) from 172.17.30.161 eth3:sub1: 64 bytes from ...
Sorry for the confusion.