2

如何让 TCP 包从指定网卡出口

 2 years ago
source link: https://www.v2ex.com/t/805880
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

V2EX  ›  Linux

如何让 TCP 包从指定网卡出口

  bybyte · 11 小时 25 分钟前 · 777 次点击

linux 下多张网卡(都能通外网),想从指定网卡口出去 HTTP 请求。 网上的一个办法是创建 socket 的时候 bind 在某个网卡的 IP 上,但是我测试过了,这样只是源 IP 地址改变了(变成 bind 的那个网卡上的 IP 地址),但是最终出口就是包上的源 MAC 地址不变, 还是由路由表上的出口网卡决定的。。想问下 V 友有啥办法没


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK