Find the answer to your Linux question:
Results 1 to 6 of 6
Hi, before all, sorry if my english is bad This is my problem: I have one server, with double NICs connected to one switch with the same gateway. Behind the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jan 2011
    Posts
    4

    Unhappy Debian server: 2 NICs load-balancing, same gateway


    Hi,

    before all, sorry if my english is bad

    This is my problem:

    I have one server, with double NICs connected to one switch with the same gateway. Behind the switch we have internet.

    |Debian| -> eth0 -> switch -> internet
    -> eth1 -> same

    I don't understand how to load-balancing between eth0 and eth1.
    The inbound/outbound traffic always use eth1.

    This is the config:


    # The primary network interface
    allow-hotplug eth0
    auto eth0
    iface eth0 inet static
    address 192.168.248.82
    netmask 255.255.255.240
    network 192.168.248.80
    broadcast 192.168.248.95
    gateway 192.168.248.81

    allow-hotplug eth1
    auto eth1
    iface eth1 inet static
    address 192.168.248.83
    netmask 255.255.255.240
    network 192.168.248.80
    broadcast 192.168.248.95
    gateway 192.168.248.81

    Kernel IP routing table
    Destination Gateway Genmask Flags Metric Ref Use Iface
    192.168.248.80 0.0.0.0 255.255.255.240 U 0 0 0 eth1
    192.168.248.80 0.0.0.0 255.255.255.240 U 0 0 0 eth0
    0.0.0.0 192.168.248.81 0.0.0.0 UG 0 0 0 eth1
    0.0.0.0 192.168.248.81 0.0.0.0 UG 0 0 0 eth0

    Ips aren't real, it's just for the example.

    Anybody have an idea on correct routing to use eth0 on 192.168.248.82 and eth1 on 192.168.248.83 ?
    I have many example for multiple gateway but here it's the same.

    Thanks all.

    Regards

  2. #2
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,763

  3. #3
    Just Joined!
    Join Date
    Jan 2011
    Posts
    4
    Hi,

    i already try without success, bonding mode 0 results as half packets loss, bonding mode 3 works but with only one interface, and mode 4 & 6 results as total timeout.

    That's why i just want to route opened connection respectively on their interface.

    I don't know if it can be done with 'ip' or 'route' easily.

    Regards,

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,763
    I don't know if it can be done with 'ip' or 'route' easily.
    No, it's not possible to easily do what you're suggesting. That's *not* how the routing table works.

    i already try without success, bonding mode 0 results as half packets loss, bonding mode 3 works but with only one interface, and mode 4 & 6 results as total timeout.
    Then you did not do it correctly. Reviewing your problems/errors and implementing a correct solution is far better than making up a "workaround."

  6. #5
    Just Joined!
    Join Date
    Jan 2011
    Posts
    4
    Okay.

    Is this is a correct configuration ?

    auto bond0
    iface bond0 inet static
    address 192.168.248.82
    netmask 255.255.255.240
    network 192.168.248.80
    broadcast 192.168.248.95
    gateway 192.168.248.81
    slaves eth0 eth1
    bond_mode 0
    bond_miimon 100
    bond_downdelay 200
    bond_updelay 200
    I need to modprobe bonding module ? and mii module before ?
    And can i have under bond0 interface eth0 and eth1 in order to have backup interface ?

    Thanks

  7. #6
    Linux Guru
    Join Date
    Nov 2007
    Posts
    1,763
    Google: linux nic bonding "debian 5"

    Guide above works fine. Mode=4 requires configuration on the switch. Running mode=0 below.

    Code:
    bond0     Link encap:Ethernet  HWaddr 00:0c:29:33:27:db  
              inet addr:XX.XX.XX.XX  Bcast:XX.XX.XX.XX  Mask:255.255.254.0
              inet6 addr: fe80::20c:29ff:fe33:27db/64 Scope:Link
              UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
              RX packets:826 errors:0 dropped:0 overruns:0 frame:0
              TX packets:265 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:87092 (85.0 KiB)  TX bytes:41108 (40.1 KiB)
    
    eth0      Link encap:Ethernet  HWaddr 00:0c:29:33:27:db  
              UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
              RX packets:580 errors:0 dropped:0 overruns:0 frame:0
              TX packets:133 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:61316 (59.8 KiB)  TX bytes:19775 (19.3 KiB)
              Interrupt:18 Base address:0x1400 
    
    eth1      Link encap:Ethernet  HWaddr 00:0c:29:33:27:db  
              UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
              RX packets:246 errors:0 dropped:0 overruns:0 frame:0
              TX packets:132 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:25776 (25.1 KiB)  TX bytes:21333 (20.8 KiB)
              Interrupt:19 Base address:0x1480

Posting Permissions

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