Skip to contentSkip to conversation

Determine veth peer device?

DISCUSSION Ben Greear 1 participant 2 messages Jul 15, 2009 – Jul 16, 2009

Subsystems (2)
lore
Share & tools
lore

Ben Greear

author
#0 lore raw

Is there a way to determine the peer device for a
veth interface in user-space?

I didn't see anything obvious printed in 'ip link show'

[root@i7-1qc-1 ~]# ip link show dev veth0
7: veth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000

    link/ether 72:2e:4d:74:5b:a6 brd ff:ff:ff:ff:ff:ff

Thanks,
Ben

Signature · 2 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com
author
#1 lore raw
Quoted 9 lines · Ben Greear

Is there a way to determine the peer device for a
veth interface in user-space?

I didn't see anything obvious printed in 'ip link show'

[root@i7-1qc-1 ~]# ip link show dev veth0
7: veth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 72:2e:4d:74:5b:a6 brd ff:ff:ff:ff:ff:ff

For the record, can get it via ethtool ioctl:

[root@i7-1qc-1 ~]# ethtool -S veth1
NIC statistics:
peer_ifindex: 7

Take it easy,
Ben

Signature · 2 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com