Smokes your problems, coughs fresh air.

Tag: interfaces

Creating a Xen bridge with bonding on Debian

Like this, but then with bonding:

# The loopback network interface
auto lo
iface lo inet loopback
 
auto bond0
# The primary network interface
iface bond0 inet manual
  slaves eth0 eth1
  bond-mode active-backup
  bond-miimon 100
  bond-downdelay 200
  bond-updelay 200
 
auto xenbr0
iface xenbr0 inet static
  address 1.2.3.4
  netmask 255.255.255.0
  network 1.2.3.0
  gateway 1.2.3.4
  dns-nameservers 1.2.3.4 5.6.7.8
  bridge_ports bond0
  bridge_fd 0

I needed it because I had have a dedicated server that was setup with ethernet bonding that I wanted to install Xen on. Normally, you can let xen setup the network with “network-script network-bridge” in /etc/xen/xend-config.xsp, but that doesn’t work when you have bonding. And, it’s actually better to do it with Debian’s netconfig anyway.

Adding a virtual network interface on Debian

When clustering machines, you make it possible for a failover node to be accessible on the same address as the primary node by having a virtual network interface. In Debian, you can add one like this:

iface eth0:0 inet static
    address 192.168.1.75
    network 192.168.1.0
    broadcast 192.168.1.255
    netmask 255.255.255.0
    gateway 192.168.1.251

By leaving out the auto eth0:0, I prevent the interface from becoming active automatically. I can do “ifup eth0:0” to enable it. This can also be left to clustering software, but clustering software can also get in the way, so often you just want to do it by hand.

Configuring a static IP address on Debian

This is a simple netconfig for a static IP address on a Debian machine. In /etc/network/interfaces, replace your eth0 (or whatever) with this:

auto eth0
iface eth0 inet static
    address 192.168.1.65    
    netmask 255.255.255.0
    gateway 192.168.1.251

Edit: I removed the network and broadcast statements because they are superfluous.

© 2024 BigSmoke

Theme by Anders NorenUp ↑