linux - Two TCP client application with virtual interface ip -
here requirement.
2 tcp client connection/emulation single eth port
i created 2 virtual interface.
ifconfig eth1:0 10.0.0.2 ifconfig eth1:1 10.0.0.3
is possible create tcp client code such particular interface used tcp client establishment.
for example
./client_app eth1:0 - -- client ip 10.0.0.2
./client_app eth1:1 -- client ip 10.0.0.3
to enumerate local interfaces , ip address associated these interfaces use system call getifaddrs()
.
then use bind()
system call bind local side of connection local interface's ip-address.
Comments
Post a Comment