Find the answer to your Linux question:
Results 1 to 3 of 3
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2012
    Posts
    85

    if there are 2 NIC on the same machine, can a tcp client on one NIC co


    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!

  2. #2
    Linux User
    Join Date
    Dec 2011
    Location
    Turtle Island West
    Posts
    340
    Yeah. Bridge networks cards. Mostly it involves and computer that everyone can rely on. Something that sits in it's own little air-conditioned cupboard. And then you get them proliferating into whole rooms, and energy hungry sprawling fields of them, and nameless corporations in other countries ruling your life.

    On the plus side, facebook can spam the world. And twitter exists.

  3. #3
    Just Joined!
    Join Date
    Dec 2009
    Posts
    2
    You need to enable IP Forwarding on said machine and apply routing policy. A routing rule must exist between the two network/hosts to be able to communicate. Been so long since I've thinker with a linux box so I don't know whether IP Forwarding is still off by default nowadays.

    Check the routing table (route -n) if there already a routing information on your tun0 network. If not then add it yourself.

    The command for adding a routing rule to the routing table would look something like this: "route add -host <TUN IP ADDR> dev tun0"

    This rule will be gone when you reboot, refer to your distro documentation to make it stick.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •