Find the answer to your Linux question:
Results 1 to 5 of 5
Hi all, I'm working on an embedded Linux system 2.6.29.6-rt24 equipped with 2 NIC eth0 and eth1. I need to set them on the same subnet eth0 = 192.168.1.87 sub ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    hki
    hki is offline
    Just Joined! hki's Avatar
    Join Date
    Nov 2012
    Location
    Padova
    Posts
    3

    2 NIC on same subnet Linux Embedded


    Hi all, I'm working on an embedded Linux system 2.6.29.6-rt24 equipped with 2 NIC eth0 and eth1. I need to set them on the same subnet
    eth0 = 192.168.1.87 sub 255.255.255.0
    eth1 = 192.168.1.88 sub 255.2555.255.0

    I tried temporary with
    echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore
    echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce

    but it doesn't' work!
    all traffic (ping) come from eth0, if i disconnect eth0, then eth1 is not able to answer to ping


    (the same command into a #! linux works properly..)

    some suggestion?
    Thanks

  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,356
    Hi and welcome.

    There are at least two ways.

    First is to use bonding. http://www.kernel.org/doc/Documentat...ng/bonding.txt
    You define a new interface bind0 with eth0 and eth1 as slaves.
    This bind0 can then have alias IPs

    The second is to use source based routing.
    Aka: What comes in via eth0, comes out via eth0 and the same for eth1.
    This code is untested. For details look here: Routing for multiple uplinks/providers
    Code:
    ip route add 192.168.1.0/24 dev eth0 src 192.168.1.87 
    ip route add 192.168.1.0/24 dev eth1 src 192.168.1.88
    ip route add default scope global nexthop via <YOUR_GW_IP> dev eth0 weight 1  nexthop via <YOUR_GW_IP> dev eth1 weight 1
    In general, I prefer bonding where possible.
    It seems more obvious too me and offers failover, but ymmv.
    You must always face the curtain with a bow.

  3. #3
    hki
    hki is offline
    Just Joined! hki's Avatar
    Join Date
    Nov 2012
    Location
    Padova
    Posts
    3
    I'm pretty newbie with Linux.. is it possible to test bonding in runtime without make system modifications? (my embedded box is an industrial automation device and I prefer void "hard" testing on it..)

  4. #4
    hki
    hki is offline
    Just Joined! hki's Avatar
    Join Date
    Nov 2012
    Location
    Padova
    Posts
    3
    the strange thins is using "arp_ignore" and "arp_announce" it works properly on a crunchbang distro, the same settings in my embedded linux box, do not..why? Some settings to check?

  5. #5
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    Location
    Munich
    Posts
    3,356
    To play around, you can use the ifconfig (or ip) command together with ifenslave.
    ifenslave potentially needs installation.

    e.g.
    Code:
    modprobe bonding
    ifconfig bond0 192.168.1.87 up
    ifconfig bond0:0 192.168.1.88 up
    ifenslave bond0 eth0
    ifenslave bond0 eth1
    
    ifconfig bond0:0 down
    ifconfig bond0 down
    ifenslave -d bond0 eth0 eth1
    Debian has a short howto
    http://wiki.debian.org/Bonding

    Not sure about the difference in behaviour between crunchbang and your embedded linux.
    Maybe different kernel versions and/or config.
    You must always face the curtain with a bow.

Posting Permissions

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