+ Post New Thread
Results 1 to 5 of 5
*nix Thread, Multiple Network Cards in Technical; I've got 3 network cards in my debian box, ive got two that are on the same subnet which are ...
  1. #1

    Join Date
    Jan 2007
    Durham, UK
    Thank Post
    Thanked 17 Times in 12 Posts
    Rep Power

    Multiple Network Cards

    I've got 3 network cards in my debian box, ive got two that are on the same subnet which are and

    When i send traffic to it goes through the card, i presume this is some sort of routing issue.

    How can i fix it so that the traffic for each ip goes through the correct network card for it?


  2. #2

    Join Date
    Sep 2008
    Thank Post
    Thanked 5 Times in 4 Posts
    Rep Power

    Default Gateway?

    Can you set up the Default Gateway on the cards individually?

  3. #3

    nephilim's Avatar
    Join Date
    Nov 2008
    Thank Post
    Thanked 2,016 Times in 1,465 Posts
    Blog Entries
    Rep Power
    You need to put each card on a different subnet or *nix will use one out of the 2. I learnt that the hard way

  4. #4

    Join Date
    Oct 2008
    Hedge End, Southampton
    Thank Post
    Thanked 10 Times in 10 Posts
    Rep Power
    This is actually the correct behavior, the problem is down to the arp replies coming from any interface on the box before you get to ping it.

    You can change the way it works by setting some options in /etc/sysctl.conf (example from a load balancer, but it's the same principle):

    # UltraMonkey requirements below
    # Enable configuration of arp_ignore option
    net.ipv4.conf.all.arp_ignore = 1
    # When an arp request is received on eth0, only respond if that address is
    # configured on eth0. In particular, do not respond if the address is
    # configured on lo
    net.ipv4.conf.eth0.arp_ignore = 1
    # Ditto for eth1, add for all ARPing interfaces
    net.ipv4.conf.eth1.arp_ignore = 1
    # Enable configuration of arp_announce option
    net.ipv4.conf.all.arp_announce = 2
    # When making an ARP request sent through eth0 Always use an address that
    # is configured on eth0 as the source address of the ARP request.  If this
    # is not set, and packets are being sent out eth0 for an address that is on
    # lo, and an arp request is required, then the address on lo will be used.
    # As the source IP address of arp requests is entered into the ARP cache on
    # the destination, it has the effect of announcing this address.  This is
    # not desirable in this case as adresses on lo on the real-servers should
    # be announced only by the linux-director.
    net.ipv4.conf.eth0.arp_announce = 2
    # Ditto for eth1, add for all ARPing interfaces
    net.ipv4.conf.eth1.arp_announce = 2
    # Enables packet forwarding
    net.ipv4.ip_forward = 1
    # UltraMonkey requirements above
    /sbin/sysctl -p
    will apply the changes.

  5. #5

    Join Date
    Jun 2006
    Belfast, N\'Ireland
    Thank Post
    Thanked 9 Times in 7 Posts
    Rep Power
    Dead right there.

    arp is ethernet technology while TCP/IP is a layer of abstraction above it. TCP/IP packets get sent down to the Ethernet layer which has no knowledge of the TCP/IP layer. Therefore as far as packets on your hardware network cards are concerned either card is a perfectly acceptable way into the device's TCP/IP stack where they then get routed to the correct address.

    Loadbalancing is what you need and the linux Kernel is great at and the instructions above should get you going.

    A machine can never successfully have 2 default gateways. You can specify 2 in Linux but only 1 will work. Default gateway is the default route to send a packet if you don't know the exact destination of that packet so there can be only 1. TCP/IP on LAN networks or internet follows a simple rule. It looks at the IP address, Splits it into Network address and Device address using the subnet mask and then asks itself the question. Do I know where that network is? If its does it send the packet out that interface to its intended recipient. If it doesn't it sends it to its defined default gateway which then makes the same choice.

    To use TCP/IP to send packets over particular interfaces requires a routing table and the interfaces have to be on different TCP/IP networks. The routing table can be an automatically generated one like the internet or in simpler LAN networks a static routing table manually configured.

+ Post New Thread

Similar Threads

  1. PCMCIA Network cards - whats the best?
    By sharkster in forum Hardware
    Replies: 5
    Last Post: 6th October 2008, 03:07 PM
  2. PCI 2.1 or 2.2 Gigabit Network Cards
    By mattx in forum Wireless Networks
    Replies: 7
    Last Post: 12th March 2008, 01:35 PM
  3. Utilising 2 network cards In a Server
    By defiance in forum Windows
    Replies: 18
    Last Post: 10th March 2008, 10:11 AM
  4. RIS Network Cards
    By edie209 in forum Hardware
    Replies: 10
    Last Post: 22nd May 2006, 06:27 PM
  5. Replies: 6
    Last Post: 23rd February 2006, 07:38 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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