开发者

multiple IP addresses, chooce the sender

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜