WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Redundant Ethernet NIC setup.  (Read 3100 times)

Offline VuduMagic

  • Newbie
  • *
  • Posts: 5
Redundant Ethernet NIC setup.
« on: May 12, 2016, 02:32:26 PM »
This is my OS version/build info
    edgar@NTPTestDevice:~$ uname -a
    Linux NTPTestDevice 2.6.33.3-tinycore #2 SMP Wed Jun 29 21:10:56 UTC 2011 i686 GNU/Linux

I have eth0 thru eth3.
We currently use eth0 and use DHCP to obtain an IP address.
There is no /etc/sysconfig/network-scripts/ directory like on CentOS.

I want to make eth0 and eth1 redundant for high-availability where one is them is active on a given IP (gotten from DHCP), but when that NIC or network fails, the other NIC takes over with the same IP address (not sure if it needs the same MAC address too).

We are going to potentially place each NIC on different redundant networks so that there is not a single point of failure.

How do I bond these two NICs together and where do I place that code in the bootup process?
I assume it might go in /etc/init.d/rcS. I am assuming the bonding needs to happen prior to dhcp being started.

After the IP is obtained, however, if the failover occurs, the redundant NIC needs to have the same IP.

What I'm looking for are the exact commands to issue and what file to place them in the bootup process.
« Last Edit: May 12, 2016, 03:00:38 PM by VuduMagic »

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Redundant Ethernet NIC setup.
« Reply #1 on: May 12, 2016, 02:35:25 PM »
Custom code, including network setup belongs in /opt/bootlocal.sh or /opt/bootsync.sh.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Redundant Ethernet NIC setup.
« Reply #2 on: May 12, 2016, 03:02:35 PM »
To disable the automatic DHCP, use the nodhcp bootcode.
The only barriers that can stop you are the ones you create yourself.

Offline VuduMagic

  • Newbie
  • *
  • Posts: 5
Re: Redundant Ethernet NIC setup.
« Reply #3 on: May 12, 2016, 03:10:12 PM »
I want to keep DHCP. Lets say the network fails on eth0, I want to be able to DHCP via eth1 still bonded to eth0 (redundantly).

Offline andyj

  • Hero Member
  • *****
  • Posts: 1036
Re: Redundant Ethernet NIC setup.
« Reply #4 on: May 12, 2016, 06:41:45 PM »
So the NICs are on redundant (separate?) networks? But you want the second NIC to be issued the same IP address as the first NIC if the first NIC goes down, but if they are on different networks you would need a dual homed DHCP server and some custom code there, or two DHCP servers that are sharing and coordinating an IP address pool? If they are on different networks, why do they need to be teamed in the first place? If they are bonded, the pair looks like a single NIC to the IP and above layers in the network stack so no IP address kludgery needs to happen. This plan has a lot of gaps and doesn't seem very well thought out.

Offline VuduMagic

  • Newbie
  • *
  • Posts: 5
Re: Redundant Ethernet NIC setup.
« Reply #5 on: May 12, 2016, 06:55:27 PM »
So the NICs are on redundant (separate?) networks? But you want the second NIC to be issued the same IP address as the first NIC if the first NIC goes down, but if they are on different networks you would need a dual homed DHCP server and some custom code there, or two DHCP servers that are sharing and coordinating an IP address pool? If they are on different networks, why do they need to be teamed in the first place? If they are bonded, the pair looks like a single NIC to the IP and above layers in the network stack so no IP address kludgery needs to happen. This plan has a lot of gaps and doesn't seem very well thought out.

The NICs are on separate (redundant) physical networks, but the DHCP server is the same device with two NICs as well. Basically, I just want to configure eth0 and eth1 bonded with mode=1 (active-backup), I believe. I just don't know how to do this on Tinycore.

On CentOS, we just used the scripts in /etc/sysconfig/network-scripts, but this doesn't exist on tinycore.
e.g.

Quote
$ cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
USERCTRL=no
BOOTPROTO=none
IPV6INIT=no
ONBOOT=yes
IPADDR=10.128.3.230
NETMASK=255.255.255.0
GATEWAY=10.128.3.254
BONDING_OPTS="mode=active-backup fail_over_mac=1 miimon=100"
DNS1=10.2.0.15
DNS2=10.2.0.16

Quote
$ cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
HWADDR=00:0c:29:94:97:07
ONBOOT=yes
USERCTL=no
BOOTPROTO=none
MASTER=bond0
SLAVE=yes

Quote
# cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
HWADDR=00:0c:29:94:97:11
ONBOOT=yes
USERCTL=no
BOOTPROTO=none
MASTER=bond0
SLAVE=yes



Offline andyj

  • Hero Member
  • *****
  • Posts: 1036
Re: Redundant Ethernet NIC setup.
« Reply #6 on: May 12, 2016, 07:49:54 PM »
So, it is a dual homed DHCP server, but the IP address is hard coded in your example, no DHCP involved, and it's assigned to the bonded NIC, not to each individual NIC in the pair. So, it looks like you have all the configuration information you need, you just need to put it in /opt/bootlocal.sh like gerald_clark said. Modprobe appropriate kernel modules, create the bonded NIC and assign eth0 and eth1 to it, give it an IP address, set up some routes and populate /etc/resolv.conf. Sorry, TC isn't CentOS. No handholding here, you'll need to know some linux. As I've never set up a bonded NIC in TC, you'll need to do what I would do. GIYF.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Redundant Ethernet NIC setup.
« Reply #7 on: May 13, 2016, 01:57:23 AM »

The NICs are on separate (redundant) physical networks, but the DHCP server is the same device with two NICs as well.


You wrote that in your design there is no single point of failure, but using one common DHCP server IS. In practice DHCP servers causing much more troubles than physical network. Also a question how are you detecting failure of one route.

I suggest design your system architecture first involving a networking expert, reading relevant docs before asking how to implement something.

Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."