Find the answer to your Linux question:
Results 1 to 2 of 2
Okay I am not a master of Linux; but thanks to help from forums I have most of my Linux box setup to run a program my team has been ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2009
    Posts
    10

    setting up two ethernet cards and routing via IP


    Okay I am not a master of Linux; but thanks to help from forums I have most of my Linux box setup to run a program my team has been developing Our program includes multiple VNC's running at once with clients connecting to any available VNC when needed. Due to hardware setup once deployed some clients will only have access to full functionality if connected to VNC 1-7 and the rest if connected to 8-14.

    Now I (sort of) know how to use IPTables to block any clients with specific IP ranges from accessing the wrong VNC's. The problem is I'm not certain if the IP's will stay constant after being deployed and I'm afraid I could end up with a client that needs to connect to VNC 1-7 has an IP that is blocked from connecting to those VNC's. What I would rather is to make use of the two Ethernet cards to provide two IP's with those connecting to one IP having access to VNC 1-7 and those on the other IP connecting to 8-14.

    That would mean that I need to set up my Ethernet ports to be independent. Currently eth0 works correctly but eth1 is detected but doesn’t respond to ping, and if I try to send a ping from my Linux box it attempts to ping using eth0 IP instead of eth1 even if eth0 has no connection and eth1 does. If i disable eth0 eth1 works fine. I had read previously that this was common problem and I believe the solution had something to do with setting up the routing tables, but I can't seem to find any details on Google.

    So I have two questions.
    1) Would setting up my Ethernet cards to have two separate IP be a functional and best way of getting the functionality I want?
    2) If yes then how do I get the two IP to function at the same time?

  2. #2
    Linux Engineer Freston's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    1,049
    Quote Originally Posted by dsollen
    1) Would setting up my Ethernet cards to have two separate IP be a functional and best way of getting the functionality I want?
    Well, yes, I think so. I'm just not sure whether I understand your setup correctly. The clients, are they remote over the internet or are they on your LAN? The server we're talking about, it is the server that runs the apps you need or are we talking about the gateway that sends the signal elsewhere?

    Quote Originally Posted by dsollen
    2) If yes then how do I get the two IP to function at the same time?
    Again, it depends a bit on your setup. But in the most general terms this should work:
    Code:
    ifconfig eth0 up
    ifconfig eth0 ipaddress0
    # or
    dhcpcd eth0
    ifconfig eth1 up
    ifconfig eth1 ipaddress1
    # or
    dhcpcd eth1
    Code:
    ping -I eth0 someipaddress
    ping -I eth1 someipaddress
    Where -I is a capital i, not a small L

    From another machine:
    Code:
    ping ipaddress0
    ping ipaddress1
    This should Just Work(tm), although I think it is only the first part of the story.
    The thing is, if I do this on my box... I can (for example) ssh into the box using either ipaddress0 or ipaddress1, but both end up on the same box. It doesn't make a difference
    Getting a different response, such as in your case where you want to feed certain VNC sessions to NIC0 and others to NIC1. How to do that is a different story all together. You may have a better idea about how that would work than I have.

    You can, however, provide different iptables rules for each NIC, so if that is needed, that is not a problem.
    Can't tell an OS by it's GUI

Posting Permissions

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