Showing posts with label bonding. Show all posts
Showing posts with label bonding. Show all posts

Monday, February 4, 2013

[Ubuntu] After upgrade cannot access internet despite connection is up

I upgraded our server last night via apt-get update & apt-get upgrade, when the server reboot it cannot connect to internet and other network segment. It can access only all the resources in the same subnet.

There are a few solutions worth to try:

  • ifdown the network interface and ifup it again
  • when perform upgrade of Ubuntu, the system might modified /etc/resolv.conf to include 127.0.0.1 as nameserver. Sometimes this will mess thing up and you can't get online. You can either delete everything inside, or use google DNS: nameserver 8.8.8.8
  • if you have bonding, you might want to add dns-nameserver 8.8.8.8 8.8.4.4 under your bond0
  • restart your networking: restart networking (this could be different from reboot Ubuntu. Because my connection got fix by restarting the network, while reboot doesn't help at all
If you do not wish to tackle with all this stupid problem, my advice is only upgrade when you need it. As long as your server is running fine and the upgrade is not going to fix any issues, just keep it as it is.

Friday, December 21, 2012

[Ubuntu] Bonding - ALB and 802.3ad

Update 31/07/13: Be sure to install ifenslave before configuring the bonding.

Office network switch was upgraded to layer 3 switch recently, play around with bonding to create link aggregation. This can be done easily under Windows, but in Linux it is really big headache. Not because the steps are complicated and redundant, but you simply can't proof whether the configuration is working or not because Linux doesn't have a friendly way for user to check whether the bonding is up and running fine.

We can check under /proc/net/bonding/bonding, but even if it is up and running, it doesn't mean the networking is actually well connected.

By the time I write this article, I still unable to get it run fine, probably due to the switch is not well configured yet, waiting for technician to do a check on that. Meanwhile, I would like to share my /etc/networking/interfaces configuration here, so whoever encountered Linux bonding problem can refer to here, without the need to search for thousand solutions online but none of those are beginner friendly or prove working.

I would say the configuration below "should be working", due to the fact that such configuration appear working when we do "netstat -i" or "ifconfig". There are a lot of solutions online, some help you to understand the concept but can never get the "bond0" interface up.

Without more words, here we go:

Adaptive Load Balancing, bonding mode=6
 auto lo  
 iface lo inet loopback  
 auto bond0  
 iface bond0 inet static  
      slaves none  
      address 192.168.0.2  
      gateway 192.168.0.1  
      netmask 255.255.255.0  
      dns-nameservers 8.8.8.8  
      bond-mode 6  
      bond-miimon 100  
 auto eth0  
 iface eth0 inet manual  
      bond-master bond0  
      bond-primary eth0 eth1 eth2 eth3  
 auto eth1  
 iface eth1 inet manual  
      bond-master bond0  
      bond-primary eth0 eth1 eth2 eth3  
 auto eth2  
 iface eth2 inet manual  
      bond-master bond0  
      bond-primary eth0 eth1 eth2 eth3  
 auto eth3  
 iface eth3 inet manual  
      bond-master bond0  
      bond-primary eth0 eth1 eth2 eth3  
802.3ad Link Aggregation, bonding mode=4
 auto lo  
 iface lo inet loopback  
 auto bond0  
 iface bond0 inet static  
      slaves none  
      address 192.168.0.2  
      gateway 192.168.0.1  
      netmask 255.255.255.0  
      dns-nameservers 8.8.8.8  
      bond-mode 4  
      bond-lacp-rate 1  
      bond-miimon 100  
 auto eth0  
 iface eth0 inet manual  
      bond-master bond0  
      bond-primary eth0 eth1 eth2 eth3  
 auto eth1  
 iface eth1 inet manual  
      bond-master bond0  
      bond-primary eth0 eth1 eth2 eth3  
 auto eth2  
 iface eth2 inet manual  
      bond-master bond0  
      bond-primary eth0 eth1 eth2 eth3  
 auto eth3  
 iface eth3 inet manual  
      bond-master bond0  
      bond-primary eth0 eth1 eth2 eth3  

I hope the above will help one who stuck with bonding. If this doesn't work properly and better solution is found, I would greatly welcome feedback and input.

Enjoy bonding!

========================================

Update 24/12/12:
The bonding configuration above is proven working, the issue I encountered was caused by the Dell PowerConnect layer 3 switch, which has some unknown issue that made the ports reserved for LACP not working properly. Re-configure and restart has get it up and running.

One more matter to take note is that you can actually remove the "bond-primary" under each eth. As for the dns-nameservers, it is advisable to specify that. Without that we have encountered some strange issue with VMs:

  1. the host and guest OS cannot ping and see each others.
  2. there is a "ghost" IP address, 192.168.0.222 appeared and tie with one of the ethernet. Bring up/down the bonding as well as each ethernet cannot get rid of it. Not even after restart.
Issues above being solved once the dns-nameservers is specified.

Now my server is running @ 4 Gbps and the HDDs has now become the bottleneck. Sigh... it's time to upgrade!

Sunday, October 28, 2012

Bonding / Teaming in Ubuntu 12.10

For those who has 4 x Gbe (Intel NIC) configuration with 1 x IPMI network, here is what you can do:

  1. Install ifenslave
  2. Load up the driver for bonding (will add in info later, check reference link as for now)
  3. Locate "interface" /etc/network
  4. Change the content accordingly based on this sample:
=============================================
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

# Adaptive Load Balancing Teaming
auto eth0
iface eth0 inet manual
bond-master bond0

auto eth1
iface eth1 inet manual
bond-master bond0

auto eth2
iface eth2 inet manual
bond-master bond0

auto eth3
iface eth3 inet manual
bond-master bond0

auto bond0
iface bond0 inet static
address 192.168.0.11
gateway 192.168.0.1
netmask 255.255.255.0
bond-mode balance-alb
bond-miimon 100
bond-slaves eth0 eth1 eth2 eth3
=============================================
  • then use command sudo ifdown XXX to bring down all your existing network connection
  • next, sudo ifup bond0
  • in certain circumstance, you might need to do sudo -s, then bring up all the four Gbe LAN by using ifup eth0, ifup eth1, etc
  • to check whether the bonded network loaded up properly, you can go /proc/net/bonding/ and check the bond0
Some useful references: