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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM