if there are 2 NIC on the same machine, can a tcp client on one NIC connect to a tcp
I use tun/tap to create a tun NIC tun0 with IP 10.10.10.2, and I have a real NIC eth0 with IP 202.112.34.49
then I run a tcp client which binds its socket to 202.112.34.49 and a tcp server binding 10.10.10.2. but I can't establish a tcp connection between them. so can a tcp client on one NIC connect to a tcp server on the other NIC? thanks! |
You can create two tun interface, one for client and another for server. These two tun0 can communicate each other. The packet on real NIC will send to wire and never come back except another device make it back.
|
Quote:
|
Dependant on what do you talk about? If you talk about whether the packet sending to interface is delivered to wire, no, tun/tap interface only exist in kernel and they never send the packet to wire. But loopback interface doesn't send packet to wire, either.
The advantage to use tun/tap interface is that you can create a network on same machine without any network device. Check following Website and it can help understand tun/tap interface. http://backreference.org/2010/03/26/...face-tutorial/ |
All times are GMT -5. The time now is 05:17 PM. |