Linux 指定网卡 ping

1、系统环境

 2、指定网卡ping检测网络

网卡 en0

$ ifconfig en0                                                                                    
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    options=400<CHANNEL_IO>
    ether 38:f9:d3:2a:5a:f1
    inet6 fe80::c89:bb6c:4e55:2030%en0 prefixlen 64 secured scopeid 0x6
    inet 192.168.28.40 netmask 0xffffff00 broadcast 192.168.28.255
    nd6 options=201<PERFORMNUD,DAD>
    media: autoselect
    status: active

使用[-I iface]报错

$ ping -I en0 www.baidu.com                                                                       
ping: invalid multicast interface: `en0'

使用[-S src_addr]检测指定网卡网络

 通过iNodeClient代理的ip:

utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1500
    inet 10.14.0.51 --> 10.14.255.255 netmask 0xffff0000

 

posted @ 2020-11-06 00:46  charseki  阅读(2614)  评论(0编辑  收藏  举报