看板 LinuxDev 關於我們 聯絡資訊
假設我在一台機器上 有兩個 network interface 一個是 eth0( 10.10.10.0 ) 一個是 使用 vpn 的 ppp0( 192.168.1.6 ) 請問一下我有沒有辦法用 C code 檢查出 哪一個 interface 可以讓我 將一個 destination address = 211.153.63.2( 任意一個 non-private IP ) 的封包可以經由這個 interface 成功送出 ?? 換句話說 就是要檢查現在的網路狀態是下面哪一種 ? eth0 ---- Host ---- ppp0 eth0 ---- Host ---- ppp0 | | | | | | | | | | X | | X Internet Internet 有沒有什麼測試的方法 or system call 感謝 !! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 122.116.238.93
Neo1978:我覺得這種情況通常是看目前 Default Gateway 的設定.. 11/01 20:13