开发者

multiple IP addresses, chooce the sender

开发者 https://www.devze.com 2023-01-30 07:13 出处:网络
I have eth0 and eth1. I am creating a simple tcp program with gsoap. the endpoint is 1.2.3.4. The endpoint receives my data, but the IP of eth0 is shown in the sender det开发者_Go百科ails. I would li

I have eth0 and eth1. I am creating a simple tcp program with gsoap. the endpoint is 1.2.3.4.

The endpoint receives my data, but the IP of eth0 is shown in the sender det开发者_Go百科ails. I would like my receiver to see eth1 instead of eth0.

Is this possible?


Use the bind(2) call to select the source IP, or create an explicit route(8) to the server via eth1. Second option is probably preferable since you don't need to modify the client source code.

0

精彩评论

暂无评论...
验证码 换一张
取 消