Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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, and I have a real NIC eth0 with IP

    then I run a tcp client which binds its socket to and a tcp server binding 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?


  2. #2
    Linux Enthusiast
    Join Date
    Dec 2011
    Turtle Island West
    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
    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