Create Network Bonding On Debian 7

What is network bonding?

Network bonding is a method of combining (joining) two or more network interfaces together into a single interface. It will increase the network throughput, bandwidth and give redundancy. If one interface is down or unplugged, the other one will keep the network traffic alive. Network bonding can be used in situations wherever you need redundancy, fault tolerance or load balancing networks.

Linux allows us to bond multiple network interfaces into single interface using a special kernel module namedbonding. The Linux bonding driver provides a method for combining multiple network interfaces into a single logical “bonded” interface. The behavior of the bonded interfaces depends upon the mode; generally speaking, modes provide either hot standby or load balancing services. Additionally, link integrity monitoring may be performed.

Types of Network Bonding

According the to the official documentation, here is the types of network bonding modes.

mode=0 (balance-rr)

Round-robin policy: It the default mode. It transmits packets in sequential order from the first available slave through the last. This mode provides load balancing and fault tolerance.

mode=1 (active-backup)

Active-backup policy: In this mode, only one slave in the bond is active. The other one will become active, only when the active slave fails. The bond’s MAC address is externally visible on only one port (network adapter) to avoid confusing the switch. This mode provides fault tolerance.

mode=2 (balance-xor)

XOR policy: Transmit based on [(source MAC address XOR’d with destination MAC address) modulo slave count]. This selects the same slave for each destination MAC address. This mode provides load balancing and fault tolerance.

mode=3 (broadcast)

Broadcast policy: transmits everything on all slave interfaces. This mode provides fault tolerance.

mode=4 (802.3ad)

IEEE 802.3ad Dynamic link aggregation. Creates aggregation groups that share the same speed and duplex settings. Utilizes all slaves in the active aggregator according to the 802.3ad specification.

Prerequisites:

– Ethtool support in the base drivers for retrieving the speed and duplex of each slave.
– A switch that supports IEEE 802.3ad Dynamic link aggregation. Most switches will require some type of configuration to enable 802.3ad mode.

mode=5 (balance-tlb)

Adaptive transmit load balancing: channel bonding that does not require any special switch support. The outgoing traffic is distributed according to the current load (computed relative to the speed) on each slave. Incoming traffic is received by the current slave. If the receiving slave fails, another slave takes over the MAC address of the failed receiving slave.

Prerequisite:

– Ethtool support in the base drivers for retrieving the speed of each slave.

mode=6 (balance-alb)

Adaptive load balancing: includes balance-tlb plus receive load balancing (rlb) for IPV4 traffic, and does not require any special switch support. The receive load balancing is achieved by ARP negotiation. The bonding driver intercepts the ARP Replies sent by the local system on their way out and overwrites the sourcehardware address with the unique hardware address of one of the slaves in the bond such that different peers use different hardware addresses for the server.

Setup Network Bonding On Debian 7 / Ubuntu 13.10 Desktop

In this handy tutorial let us see how to setup network bonding on Debian 7. Though it was tested on Debian 7, it should work on Ubuntu and its derivatives.

We need atleast two or more network cards.

I have three network interfaces, namely eth0, eth1 and eth2 in my Debian 7 LXDE desktop. Let us combine two NICs (eth1 and eth2) and make them into one NIC named bond0.

Install Bonding Kernel Module

First, we have to install bonding kernel module using the command:

# apt-get install ifenslave-2.6

Before going further, stop networking service.

# /etc/init.d/networking stop

Warning: You should not enter the above command over SSH connection.

Configure Bond0 Interface

First, let us create a bond0 configuration file as shown below.

Go to the directory where Debian/Ubuntu stores the network configuration files. By default, Debian and its derivatives stores the network configuration files under /etc/network/ directory.

Create bond0 configuration file under the above mentioned directory.

# vi /etc/network/interfaces

Add the following lines marked in red color to create network bond for eth1 and eth2.

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The first network bond
auto bond0
iface bond0 inet static
address 192.168.1.200
netmask 255.255.255.0
gateway 192.168.1.1
slaves eth1 eth2
bond-mode 1
bond-miimon 100
bond_downdelay 200
bond_updelay 200

Save and close file.

Note: Here we will be configuring mode1(active-backup). 192.168.1.200 is bond0 IP address.

Next we have to load up the bond0 interface into the kernel. To do that, create a new file/etc/modprobe.d/bonding.conf,

# vi /etc/modprobe.d/bonding.conf

Add the following line in it.

alias bond0 bonding
options bonding mode=1 arp_interval=2000 arp_ip_target=192.168.1.1

Warning: Without this file, you’ll get warning message when you restart network service. Here 192.168.1.1 is my router(gateway) ip address. Save and close the file.

Now let us enable the bonding kernel module, using the command:

# modprobe -v options bonding mode=1 arp_interval=2000 arp_ip_target=192.168.1.1

Next Start/Restart network service to take effect the changes.

# service network start

Test Network Bonding

Now enter the following command to check whether the bonding interface bond0 is up and running:

# cat /proc/net/bonding/bond0

Sample output:

Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth1
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 200
Down Delay (ms): 200

Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:16:07:6a
Slave queue ID: 0

Slave Interface: eth2
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:60:18:bb
Slave queue ID: 0

As you see in the above output, the bond0 interface is up and running and it is configured as active-backup(mode1) mode. In this mode, only one slave in the bond is active. The other one will become active, only when the active slave fails.

To view the list of network interfaces and their IP address, enter the following command:

# ifconfig

Sample output:

bond0     Link encap:Ethernet  HWaddr 08:00:27:16:07:6a  
          inet addr:192.168.1.200  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe16:76a/64 Scope:Link
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:114 errors:0 dropped:31 overruns:0 frame:0
          TX packets:197 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:14269 (13.9 KiB)  TX bytes:29286 (28.5 KiB)

eth0      Link encap:Ethernet  HWaddr 08:00:27:ac:65:e9  
          inet addr:192.168.1.102  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:feac:65e9/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1164 errors:0 dropped:0 overruns:0 frame:0
          TX packets:42 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:89712 (87.6 KiB)  TX bytes:8706 (8.5 KiB)

eth1      Link encap:Ethernet  HWaddr 08:00:27:16:07:6a  
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:77 errors:0 dropped:0 overruns:0 frame:0
          TX packets:197 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:11459 (11.1 KiB)  TX bytes:29286 (28.5 KiB)

eth2      Link encap:Ethernet  HWaddr 08:00:27:16:07:6a  
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:37 errors:0 dropped:31 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2810 (2.7 KiB)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

As per the above output, bond0 is configured as master; eth1 and eth2 are configured as a slave.

Create Network Bonding On CentOS 7/6.5

What is Network bonding?

Network bonding is a method of combining (joining) two or more network interfaces together into a singleinterface. It will increase the network throughput, bandwidth and will give redundancy. If one interface is down or unplugged, the other one will keep the network traffic up and alive. Network bonding can be used in situations wherever you need redundancy, fault tolerance or load balancing networks.

Linux allows us to bond multiple network interfaces into single interface using a special kernel module namedbonding. The Linux bonding driver provides a method for combining multiple network interfaces into a single logical “bonded” interface. The behaviour of the bonded interfaces depends upon the mode; generally speaking, modes provide either hot standby or load balancing services. Additionally, link integrity monitoring, may be performed.

Types of Network Bonding

According the to the official documentation, here is the types of network bonding modes.

mode=0 (balance-rr)

Round-robin policy: It the default mode. It transmits packets in sequential order from the first available slave through the last. This mode provides load balancing and fault tolerance.

mode=1 (active-backup)

Active-backup policy: In this mode, only one slave in the bond is active. The other one will become active, only when the active slave fails. The bond’s MAC address is externally visible on only one port (network adapter) to avoid confusing the switch. This mode provides fault tolerance.

mode=2 (balance-xor)

XOR policy: Transmit based on [(source MAC address XOR’d with destination MAC address) modulo slave count]. This selects the same slave for each destination MAC address. This mode provides load balancing and fault tolerance.

mode=3 (broadcast)

Broadcast policy: transmits everything on all slave interfaces. This mode provides fault tolerance.

mode=4 (802.3ad)

IEEE 802.3ad Dynamic link aggregation. Creates aggregation groups that share the same speed and duplex settings. Utilizes all slaves in the active aggregator according to the 802.3ad specification.

Prerequisites:

– Ethtool support in the base drivers for retrieving the speed and duplex of each slave.
– A switch that supports IEEE 802.3ad Dynamic link aggregation. Most switches will require some type of configuration to enable 802.3ad mode.

mode=5 (balance-tlb)

Adaptive transmit load balancing: channel bonding that does not require any special switch support. The outgoing traffic is distributed according to the current load (computed relative to the speed) on each slave. Incoming traffic is received by the current slave. If the receiving slave fails, another slave takes over the MAC address of the failed receiving slave.

Prerequisite:

– Ethtool support in the base drivers for retrieving the speed of each slave.

mode=6 (balance-alb)

Adaptive load balancing: includes balance-tlb plus receive load balancing (rlb) for IPV4 traffic, and does not require any special switch support. The receive load balancing is achieved by ARP negotiation. The bonding driver intercepts the ARP Replies sent by the local system on their way out and overwrites the sourcehardware address with the unique hardware address of one of the slaves in the bond such that different peers use different hardware addresses for the server.

In this handy tutorial let us see how to setup network bonding on CentOS 7 and CentOS 6.5. Though it was tested on CentOS, it should work on RHEL and Scientific Linux 6.x versions.

First, we will setup network bonding on CentOS 7.

1. Setting up Network Bonding on CentOS 7

I have three network interfaces in my CentOS 7 system, namely:

  1. enp0s3;
  2. enp0s8;
  3. enp0s9.

Let us combine two NICs (enp0s8, and enp0s9) and make them into one NIC named bond0.

Configure Bond0 Interface

In CentOS 7, the bonding module is not loaded by default. Enter the following command as root user to enable it.

modprobe --first-time bonding

You can view the bonding module information using command:

modinfo bonding

Sample output:

filename:       /lib/modules/3.10.0-123.el7.x86_64/kernel/drivers/net/bonding/bonding.ko
alias:          rtnl-link-bond
author:         Thomas Davis, tadavis@lbl.gov and many others
description:    Ethernet Channel Bonding Driver, v3.7.1
version:        3.7.1
license:        GPL
srcversion:     E52AE00A79EA6FEFB5BF718
depends:        
intree:         Y
vermagic:       3.10.0-123.el7.x86_64 SMP mod_unload modversions 
signer:         CentOS Linux kernel signing key
sig_key:        BC:83:D0:FE:70:C6:2F:AB:1C:58:B4:EB:AA:95:E3:93:61:28:FC:F4
sig_hashalgo:   sha256
parm:           max_bonds:Max number of bonded devices (int)
parm:           tx_queues:Max number of transmit queues (default = 16) (int)
parm:           num_grat_arp:Number of peer notifications to send on failover event (alias of num_unsol_na) (int)
parm:           num_unsol_na:Number of peer notifications to send on failover event (alias of num_grat_arp) (int)
parm:           miimon:Link check interval in milliseconds (int)
parm:           updelay:Delay before considering link up, in milliseconds (int)
parm:           downdelay:Delay before considering link down, in milliseconds (int)
parm:           use_carrier:Use netif_carrier_ok (vs MII ioctls) in miimon; 0 for off, 1 for on (default) (int)
parm:           mode:Mode of operation; 0 for balance-rr, 1 for active-backup, 2 for balance-xor, 3 for broadcast, 4 for 802.3ad, 5 for balance-tlb, 6 for balance-alb (charp)
parm:           primary:Primary network device to use (charp)
parm:           primary_reselect:Reselect primary slave once it comes up; 0 for always (default), 1 for only if speed of primary is better, 2 for only on active slave failure (charp)
parm:           lacp_rate:LACPDU tx rate to request from 802.3ad partner; 0 for slow, 1 for fast (charp)
parm:           ad_select:803.ad aggregation selection logic; 0 for stable (default), 1 for bandwidth, 2 for count (charp)
parm:           min_links:Minimum number of available links before turning on carrier (int)
parm:           xmit_hash_policy:balance-xor and 802.3ad hashing method; 0 for layer 2 (default), 1 for layer 3+4, 2 for layer 2+3 (charp)
parm:           arp_interval:arp interval in milliseconds (int)
parm:           arp_ip_target:arp targets in n.n.n.n form (array of charp)
parm:           arp_validate:validate src/dst of ARP probes; 0 for none (default), 1 for active, 2 for backup, 3 for all (charp)
parm:           fail_over_mac:For active-backup, do not set all slaves to the same MAC; 0 for none (default), 1 for active, 2 for follow (charp)
parm:           all_slaves_active:Keep all frames received on an interfaceby setting active flag for all slaves; 0 for never (default), 1 for always. (int)
parm:           resend_igmp:Number of IGMP membership reports to send on link failure (int)

Let us create a bond0 configuration file as shown below.

Go to the directory where CentOS stores the network configuration files. By default RHEL and its clones such as CentOS, Scientific Linux stores the network configuration files under /etc/sysconfig/network-scripts/directory.

Log in as root user.

Create bond0 configuration file:

vi /etc/sysconfig/network-scripts/ifcfg-bond0

Add the following lines.

DEVICE=bond0
NAME=bond0
TYPE=Bond
BONDING_MASTER=yes
IPADDR=192.168.1.150
PREFIX=24
ONBOOT=yes
BOOTPROTO=none
BONDING_OPTS="mode=1 miimon=100"

Note: Here, BONDING_OPTS describes the bonding mode. In our case, we will be configuring mode1(active-backup). Save and close file. 192.168.1.150 is bond0 IP address.

Configure Network interfaces

Now, we should modify both(enp0s8 & enp0s9) configuration files as shown below. First, let us start fromenp0s8.

Edit file /etc/sysconfig/network-scripts/ifcfg-enp0s8,

vi /etc/sysconfig/network-scripts/ifcfg-enp0s8

Modify the file as shown below.

HWADDR="08:00:27:04:03:86"
TYPE="Ethernet"
BOOTPROTO="none"
DEFROUTE="yes"
PEERDNS="yes"
PEERROUTES="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
IPV6_FAILURE_FATAL="no"
NAME="enp0s8"
UUID="a97b23f2-fa87-49de-ac9b-39661ba9c20f"
ONBOOT="yes"
MASTER=bond0
SLAVE=yes

Then, Edit file /etc/sysconfig/network-scripts/ifcfg-enp0s9,

vi /etc/sysconfig/network-scripts/ifcfg-enp0s9

Modify the file as shown below.

HWADDR=08:00:27:E7:ED:8E
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=enp0s9
UUID=e2352c46-e1f9-41d2-98f5-af24b127b3e7
ONBOOT=yes
MASTER=bond0
SLAVE=yes

Save and close the files.

Now, activate the Network interfaces.

ifup ifcfg-enp0s8
ifup ifcfg-enp0s9

Now, enter the following command to make Network Manager aware the changes.

nmcli con reload

Restart network service to take effect the changes.

systemctl restart network

Test Network Bonding

Now enter the following command to check whether the bonding interface bond0 is up and running:

cat /proc/net/bonding/bond0

Sample output:

Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: enp0s8
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: enp0s8
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:5d:ad:75
Slave queue ID: 0

Slave Interface: enp0s9
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:48:93:cd
Slave queue ID: 0

As you see in the above output, the bond0 interface is up and running and it is configured as active-backup(mode1) mode. In this mode, only one slave in the bond is active. The other one will become active, only when the active slave fails.

To view the list of network interfaces and their IP address, enter the following command:

ip addr

Sample output:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:1f:3b:20 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.100/24 brd 192.168.1.255 scope global dynamic enp0s3
       valid_lft 86130sec preferred_lft 86130sec
    inet6 fe80::a00:27ff:fe1f:3b20/64 scope link 
       valid_lft forever preferred_lft forever
3: enp0s8: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP qlen 1000
    link/ether 08:00:27:5d:ad:75 brd ff:ff:ff:ff:ff:ff
4: enp0s9: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP qlen 1000
    link/ether 08:00:27:5d:ad:75 brd ff:ff:ff:ff:ff:ff
5: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP 
    link/ether 08:00:27:5d:ad:75 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.150/24 brd 192.168.1.255 scope global bond0
       valid_lft forever preferred_lft forever
    inet6 fe80::a00:27ff:fe5d:ad75/64 scope link 
       valid_lft forever preferred_lft forever

That’s it.

Configure multiple IP addresses for bond0

I want to assign multiple IP addresses to bond0 interface. What should i do? Very simple, just create an alias for the bond0 interface and assign multiple IP addresses.

Let me make it more clear. Say for example we want to assign IP address 192.168.1.151 to bond0. To create an alias for bond0, copy the existing configuration file(ifcfg-bond0) to a new configuration file(ifcfg-bond0:1).

cp /etc/sysconfig/network-scripts/ifcfg-bond0 /etc/sysconfig/network-scripts/ifcfg-bond0:1

Then edit the alias file /etc/sysconfig/network-scripts/ifcfg-bond0:1,

vi /etc/sysconfig/network-scripts/ifcfg-bond0:1

Modify the device name and IP address as shown below.

DEVICE=bond0:1
NAME=bond0
TYPE=Bond
BONDING_MASTER=yes
IPADDR=192.168.1.151
PREFIX=24
ONBOOT=yes
BOOTPROTO=none
BONDING_OPTS="mode=1 miimon=100"

Here,

  • bond0:1 – Device name
  • 192.168.1.151 – IP address of bond0:1

Save and close the file. Restart network service to take effect the saved changes.

systemctl restart network

Now list out the network interfaces and their IP address using the command:

ip addr

Sample output:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:1f:3b:20 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.100/24 brd 192.168.1.255 scope global dynamic enp0s3
       valid_lft 86388sec preferred_lft 86388sec
    inet6 fe80::a00:27ff:fe1f:3b20/64 scope link 
       valid_lft forever preferred_lft forever
3: enp0s8: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP qlen 1000
    link/ether 08:00:27:5d:ad:75 brd ff:ff:ff:ff:ff:ff
4: enp0s9: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond0 state UP qlen 1000
    link/ether 08:00:27:5d:ad:75 brd ff:ff:ff:ff:ff:ff
5: bond0: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP 
    link/ether 08:00:27:5d:ad:75 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.150/24 brd 192.168.1.255 scope global bond0
       valid_lft forever preferred_lft forever
    inet 192.168.1.151/24 brd 192.168.1.255 scope global secondary bond0:1
       valid_lft forever preferred_lft forever
    inet6 fe80::a00:27ff:fe5d:ad75/64 scope link 
       valid_lft forever preferred_lft forever

As you above the alias bond0:1 has been created and it’s up now.

2. Setting up Network Bonding on CentOS 6.5

We have seen Network bonding on CentOS 7. Now, we will see how to do it on CentOS 6.x.

I have three network interfaces, namely eth0, eth1 and eth2 in my CentOS 6.5 system. Let us combine two NICs (eth1 and eth2) and make them into one NIC named bond0.

Configure Bond0 Interface

First, let us create a bond0 configuration file as shown below.

Go to the directory where CentOS stores the network configuration files. By default RHEL and its clones such as CentOS, Scientific Linux stores the network configuration files under /etc/sysconfig/network-scripts/directory.

Run the following commands as root user.

Create bond0 configuration file under the above mentioned directory.

vi /etc/sysconfig/network-scripts/ifcfg-bond0

Add the following lines.

DEVICE=bond0
BOOTPROTO=none
ONBOOT=yes
IPADDR=192.168.1.200
NETWORK=192.168.1.0
NETMASK=255.255.255.0
USERCTL=no
BONDING_OPTS="mode=1 miimon=100"

Note: Here BONDING_OPTS describes the bonding mode. In our case, we will be configuring mode1(active-backup). Save and close file. 192.168.1.200 is bond0 IP address.

Next we have to load up the bond0 interface into the kernel. To do that, create a new file/etc/modprobe.d/bonding.conf,

vi /etc/modprobe.d/bonding.conf

Add the following line in it.

alias bond0 bonding

Save and close the file.

Configure Network interfaces

Now we should modify both(eth1 & eth2) configuration files as shown below. First, let us start from eth1.

Edit file /etc/sysconfig/network-scripts/ifcfg-eth1,

vi /etc/sysconfig/network-scripts/ifcfg-eth1

Modify the file as shown below.

DEVICE=eth1
MASTER=bond0
SLAVE=yes
USERCTL=no
ONBOOT=yes
BOOTPROTO=none

Then Edit file /etc/sysconfig/network-scripts/ifcfg-eth2,

# vi /etc/sysconfig/network-scripts/ifcfg-eth2

Modify the file as shown below.

DEVICE=eth2
MASTER=bond0
SLAVE=yes
USERCTL=no
ONBOOT=yes
BOOTPROTO=none

Save and close the files.

Enter the following command to load the bonding module.

modprobe bonding

Restart network service to take effect the changes.

service network restart

Test Network Bonding

Now enter the following command to check whether the bonding interface bond0 is up and running:

cat /proc/net/bonding/bond0

Sample output:

Ethernet Channel Bonding Driver: v3.6.0 (September 26, 2009)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth1
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:fe:6f:bf
Slave queue ID: 0

Slave Interface: eth2
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:34:17:c0
Slave queue ID: 0

As you see in the above output, the bond0 interface is up and running and it is configured as active-backup(mode1) mode. In this mode, only one slave in the bond is active. The other one will become active, only when the active slave fails.

To view the list of network interfaces and their IP address, enter the following command:

# ifconfig

Sample output:

bond0     Link encap:Ethernet  HWaddr 08:00:27:FE:6F:BF  
          inet addr:192.168.1.200  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fefe:6fbf/64 Scope:Link
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:379 errors:0 dropped:0 overruns:0 frame:0
          TX packets:167 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:32354 (31.5 KiB)  TX bytes:24078 (23.5 KiB)

eth0      Link encap:Ethernet  HWaddr 08:00:27:BE:25:49  
          inet addr:192.168.1.101  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:febe:2549/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1402 errors:0 dropped:0 overruns:0 frame:0
          TX packets:904 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:134823 (131.6 KiB)  TX bytes:124938 (122.0 KiB)

eth1      Link encap:Ethernet  HWaddr 08:00:27:FE:6F:BF  
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:285 errors:0 dropped:0 overruns:0 frame:0
          TX packets:156 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:24746 (24.1 KiB)  TX bytes:22956 (22.4 KiB)

eth2      Link encap:Ethernet  HWaddr 08:00:27:FE:6F:BF  
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:95 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:7674 (7.4 KiB)  TX bytes:1364 (1.3 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

As per the above output, bond0 is configured as master; eth1 and eth2 are configured as a slave.

Configure multiple IP addresses for bond0

I want to assign multiple IP addresses to bond0 interface. What should i do? Very simple, just create an alias for the bond0 interface and assign multiple IP addresses.

Let me make it more clear. Say for example we want to assign IP address 192.168.1.201 to bond0. To create an alias for bond0, copy the existing configuration file(ifcfg-bond0) to a new configuration file(ifcfg-bond0:1).

cp /etc/sysconfig/network-scripts/ifcfg-bond0 /etc/sysconfig/network-scripts/ifcfg-bond0:1

Then edit the alias file /etc/sysconfig/network-scripts/ifcfg-bond0:1,

vi /etc/sysconfig/network-scripts/ifcfg-bond0:1

Modify the device name and IP address as shown below.

DEVICE=bond0:1
BOOTPROTO=none
ONBOOT=yes
IPADDR=192.168.1.201
NETWORK=192.168.1.0
NETMASK=255.255.255.0
USERCTL=no
BONDING_OPTS="mode=1 miimon=100"

Save and close the file. Restart network service to take effect the saved changes.

service network restart

Now list out the network interfaces and their IP address using the command:

ifconfig

Sample output:

bond0     Link encap:Ethernet  HWaddr 08:00:27:FE:6F:BF  
          inet addr:192.168.1.200  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fefe:6fbf/64 Scope:Link
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:1048 errors:0 dropped:0 overruns:0 frame:0
          TX packets:590 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:88622 (86.5 KiB)  TX bytes:84340 (82.3 KiB)

bond0:1   Link encap:Ethernet  HWaddr 08:00:27:FE:6F:BF  
          inet addr:192.168.1.201  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1

eth0      Link encap:Ethernet  HWaddr 08:00:27:BE:25:49  
          inet addr:192.168.1.101  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:febe:2549/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1422 errors:0 dropped:0 overruns:0 frame:0
          TX packets:916 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:136317 (133.1 KiB)  TX bytes:126150 (123.1 KiB)

eth1      Link encap:Ethernet  HWaddr 08:00:27:FE:6F:BF  
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:942 errors:0 dropped:0 overruns:0 frame:0
          TX packets:581 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:80036 (78.1 KiB)  TX bytes:84266 (82.2 KiB)

eth2      Link encap:Ethernet  HWaddr 08:00:27:FE:6F:BF  
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:111 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:8916 (8.7 KiB)  TX bytes:1492 (1.4 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

You should see the alias bond0:1 has been created and up.

Create Network Bonding On Ubuntu 14.10

What is Network bonding?

Network bonding is a method of combining (joining) two or more network interfaces together into a singleinterface. It will increase the network throughput, bandwidth and will give redundancy. If one interface is down or unplugged, the other one will keep the network traffic up and alive. Network bonding can be used in situations wherever you need redundancy, fault tolerance or load balancing networks.

Linux allows us to bond multiple network interfaces into single interface using a special kernel module namedbonding. The Linux bonding driver provides a method for combining multiple network interfaces into a single logical “bonded” interface. The behaviour of the bonded interfaces depends upon the mode; generally speaking, modes provide either hot standby or load balancing services. Additionally, link integrity monitoring, may be performed.

Types of Network Bonding

mode=0 (balance-rr)

  • Round-robin policy: It the default mode. It transmits packets in sequential order from the first available slave through the last. This mode provides load balancing and fault tolerance.

mode=1 (active-backup)

  • Active-backup policy: In this mode, only one slave in the bond is active. The other one will become active, only when the active slave fails. The bond’s MAC address is externally visible on only one port (network adapter) to avoid confusing the switch. This mode provides fault tolerance.

mode=2 (balance-xor)

  • XOR policy: Transmit based on [(source MAC address XOR’d with destination MAC address) modulo slave count]. This selects the same slave for each destination MAC address. This mode provides load balancing and fault tolerance.

mode=3 (broadcast)

  • Broadcast policy: transmits everything on all slave interfaces. This mode provides fault tolerance.

mode=4 (802.3ad)

  • IEEE 802.3ad Dynamic link aggregation. Creates aggregation groups that share the same speed and duplex settings. Utilizes all slaves in the active aggregator according to the 802.3ad specification.

Prerequisites:

– Ethtool support in the base drivers for retrieving the speed and duplex of each slave.
– A switch that supports IEEE 802.3ad Dynamic link aggregation. Most switches will require some type of configuration to enable 802.3ad mode.

mode=5 (balance-tlb)

  • Adaptive transmit load balancing: channel bonding that does not require any special switch support. The outgoing traffic is distributed according to the current load (computed relative to the speed) on each slave. Incoming traffic is received by the current slave. If the receiving slave fails, another slave takes over the MAC address of the failed receiving slave.

Prerequisite:

– Ethtool support in the base drivers for retrieving the speed of each slave.

mode=6 (balance-alb)

  • Adaptive load balancing: includes balance-tlb plus receive load balancing (rlb) for IPV4 traffic, and does not require any special switch support. The receive load balancing is achieved by ARP negotiation. The bonding driver intercepts the ARP Replies sent by the local system on their way out and overwrites the sourcehardware address with the unique hardware address of one of the slaves in the bond such that different peers use different hardware addresses for the server.

Setting up Network Bonding on Ubuntu 14.10

I tested this how-to on Ubuntu 14.10, and it worked well.

We need atleast two network cards. You are free to use n number of NICs.

I have three network interfaces, namely eth0, eth1 and eth2 in my Ubuntu 14.10 desktop. Let us combine two NICs (eth1 and eth2) and make them into one NIC named bond0.

Install Bonding Kernel Module

The following command should be performed with root user privileges.

sudo su

First, we have to install bonding kernel module using the command:

apt-get install ifenslave-2.6

Now, we have to make sure that the correct kernel module bonding is present, and loaded at boot time.

Edit /etc/modules file,

cat /etc/modules

Add “bonding” at the end.

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.
# Parameters can be specified after the module name.

lp
rtc
bonding

Now, stop networking service.

/etc/init.d/networking stop

Warning: You should not enter the above command over SSH connection.

Then load the bonding kernel module:

sudo modprobe bonding

Configure Bond0 Interface

First, let us create a bond0 configuration file as shown below.

Go to the directory where Debian/Ubuntu stores the network configuration files. By default, Debian and its derivatives stores the network configuration files under /etc/network/ directory.

Create bond0 configuration file under the above mentioned directory.

vi /etc/network/interfaces

Add the following lines marked in red color to create network bond for eth1 and eth2.

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

#eth1 configuration
auto eth1
iface eth1 inet manual
bond-master bond0
bond-primary eth1

#eth2 configuration
auto eth2
iface eth2 inet manual
bond-master bond0

# Bonding eth1 & eth2 to create bond0 NIC
auto bond0
iface bond0 inet static
address 192.168.1.200
gateway 192.168.1.1
netmask 255.255.255.0
bond-mode active-backup
bond-miimon 100
bond-slaves none

Save and close file.

Note: Here we will be configuring active-backup mode. 192.168.1.200 is bond0 IP address.

Next Start/Restart network service to take effect the changes.

/etc/init.d/networking start

Bring up bond0:

ifup bond0

Note: If you have any problems while bringing up bond0, restart and check again.

Test Network Bonding

Now enter the following command to check whether the bonding interface bond0 is up and running:

cat /proc/net/bonding/bond0

Sample output:

Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: eth1 (primary_reselect always)
Currently Active Slave: eth1
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:33:6e:fc
Slave queue ID: 0

Slave Interface: eth2
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: 08:00:27:7c:b8:02
Slave queue ID: 0

As you see in the above output, the bond0 interface is up and running and it is configured as active-backup(mode1) mode. In this mode, only one slave in the bond is active. The other one will become active, only when the active slave fails.

To view the list of network interfaces and their IP address, enter the following command:

ifconfig

Sample output:

bond0     Link encap:Ethernet  HWaddr 08:00:27:33:6e:fc  
          inet addr:192.168.1.200  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe33:6efc/64 Scope:Link
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:1341 errors:0 dropped:181 overruns:0 frame:0
          TX packets:137 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:943994 (943.9 KB)  TX bytes:10399 (10.3 KB)

eth0      Link encap:Ethernet  HWaddr 08:00:27:09:48:87  
          inet addr:192.168.1.107  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe09:4887/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:957 errors:0 dropped:0 overruns:0 frame:0
          TX packets:829 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:897369 (897.3 KB)  TX bytes:184921 (184.9 KB)

eth1      Link encap:Ethernet  HWaddr 08:00:27:33:6e:fc  
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:1143 errors:0 dropped:0 overruns:0 frame:0
          TX packets:137 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:916683 (916.6 KB)  TX bytes:10399 (10.3 KB)

eth2      Link encap:Ethernet  HWaddr 08:00:27:33:6e:fc  
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:198 errors:0 dropped:181 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:27311 (27.3 KB)  TX bytes:0 (0.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:653 errors:0 dropped:0 overruns:0 frame:0
          TX packets:653 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:56460 (56.4 KB)  TX bytes:56460 (56.4 KB)

As per the above output, bond0 is configured as master; eth1 and eth2 are configured as a slave.

Setup DHCP Server On CentOS 6.5

Installation

To install DHCP server on CentOS 6.5, enter the following command:

yum install dhcp -y

Configuration

DHCP server configuration is not that difficult. First, we have to assign which interface you want your DHCP server to run on. In my case, I have only one Interface on my system (eth0), so I assigned eth0.

To do that, edit file /etc/sysconfig/dhcpd,

vi /etc/sysconfig/dhcpd

Assign the network interface:

# Command line options here
DHCPDARGS=eth0

Save and close the file. Then, copy the sample dhcp configuration file to /etc/dhcp/ directory.

cp /usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample /etc/dhcp/dhcpd.conf

Now, edit dhcpd.conf file,

vi /etc/dhcp/dhcpd.conf

Make the changes as shown below.

Set the domain name and domain-name servers:

[...]

# option definitions common to all supported networks...
 option domain-name "unixmen.local";
 option domain-name-servers server.unixmen.local;

[...]

If this DHCP server is the official DHCP server for the local network, you should uncomment the following line:

[...]
authoritative;
[...]

Define the sunbet, range of ip addresses, domain and domain name servers like below:

[...]
# A slightly different configuration for an internal subnet.
 subnet 192.168.1.0 netmask 255.255.255.0 {
 range 192.168.1.20 192.168.1.30;
 option domain-name-servers server.unixmen.local;
 option domain-name "unixmen.local";
 option routers 192.168.1.1;
 option broadcast-address 192.168.1.255;
 default-lease-time 600;
 max-lease-time 7200;
 }
[...]

If you want to assign a fixed IP address to your client, you should enter it’s MAC id and the IP address in the following directive. For example, I want to assign a fixed IP address 192.168.1.15 to my Ubuntu client, hence I modified the following directive as shown below.

[...]
host ubuntu-client {
 hardware ethernet 00:22:64:4f:e9:3a;
 fixed-address 192.168.1.15;
 }
[...]

After making all the changes you want, save and close the file. Be mindful that if you have another unused entries on the dhcpd.conf file, comment them. Otherwise, you’ll have issues while starting dhcpd service.

Now, start the dhcpd service and make it to start automatically on every reboot.

service dhcpd start
chkconfig dhcpd on

Configure Clients

Now, go to the client configuration network settings and change the IP settings to Automatic (DHCP).

Here is my Lubuntu 14.04 settings:

Editing Wired connection 1_001

Restart the network or reboot the client system to get IP address automatically from the DHCp server.

Now, you should see the IP address has been automatically assigned to the clients from the DHCP server.

Run the following command from the client system Terminal:

sudo ifconfig

Sample output:

sk@sk: ~_002

As you see in the above picture, My ubuntu client system which has MAC id 00:22:64:4f:e9:3a gets a fixed IP address 192.168.1.15 from the DHCP server.

That’s it. DHCP server is up and ready.

Setup DHCP Server On Ubuntu 14.04 LTS Server

Installation

To install DHCP server on Ubuntu 14.04 LTS, enter the following command:

sudo apt-get install isc-dhcp-server -y

Configuration

DHCP server configuration is not that difficult. First, we have to assign on what interfaces should the DHCP server (dhcpd) serve DHCP requests. In my case, I have only one Interface on my system (eth0), so I assignedeth0.

To do that, edit file /etc/default/isc-dhcp-server,

sudo nano /etc/default/isc-dhcp-server

Assign the network interface:

[...]
INTERFACES="eth0"

Save and close the file.

Now, edit dhcpd.conf file,

sudo nano /etc/dhcp/dhcpd.conf

Make the changes as shown below.

Set the domain name and domain-name servers:

[...]

# option definitions common to all supported networks...
 option domain-name "unixmen.local";
 option domain-name-servers server.unixmen.local;

[...]

If this DHCP server is the official DHCP server for the local network, you should uncomment the following line:

[...]
authoritative;
[...]

Define the sunbet, range of ip addresses, domain and domain name servers like below:

[...]
# A slightly different configuration for an internal subnet.
 subnet 192.168.1.0 netmask 255.255.255.0 {
 range 192.168.1.20 192.168.1.30;
 option domain-name-servers server.unixmen.local;
 option domain-name "unixmen.local";
 option routers 192.168.1.1;
 option broadcast-address 192.168.1.255;
 default-lease-time 600;
 max-lease-time 7200;
 }
[...]

If you want to assign a fixed IP address to your client, you should enter it’s MAC id and the IP address in the following directive. For example, I want to assign a fixed IP address 192.168.1.15 to my Ubuntu client, hence I modified the following directive as shown below.

[...]
host ubuntu-client {
 hardware ethernet 00:22:64:4f:e9:3a;
 fixed-address 192.168.1.15;
 }
[...]

After making all the changes you want, save and close the file. Be mindful that if you have another unused entries on the dhcpd.conf file, comment all of them. Otherwise, you’ll get issues while starting dhcp service.

Now, restart dhcp service and make it to start automatically on every reboot.

sudo service isc-dhcp-server restart

Likewise, you can start/stop dhcp service as shown below:

sudo service isc-dhcp-server start
sudo service isc-dhcp-server stop

Configure Clients

Now, go to the client configuration network settings and change the IP settings to Automatic (DHCP).

Here is my Lubuntu 14.04 settings:

Editing Wired connection 1_001

Restart the network or reboot the client system to get IP address automatically from the DHCP server.

Now, you should see the IP address has been automatically assigned to the clients from the DHCP server.

Run the following command from the client system Terminal:

sudo ifconfig

Sample output:

sk@sk: ~_002

As you see in the above picture, My ubuntu client system which has MAC id 00:22:64:4f:e9:3a gets a fixed IP address 192.168.1.15 from the DHCP server.

That’s it. DHCP server is up and ready.

HTTP Status Code Definitions

10.1 Informational 1xx

This class of status code indicates a provisional response, consisting only of the Status-Line and optional headers, and is terminated by an empty line. There are no required headers for this class of status code. Since HTTP/1.0 did not define any 1xx status codes, servers MUST NOT send a 1xx response to an HTTP/1.0 client except under experimental conditions.

A client MUST be prepared to accept one or more 1xx status responses prior to a regular response, even if the client does not expect a 100 (Continue) status message. Unexpected 1xx status responses MAY be ignored by a user agent.

Proxies MUST forward 1xx responses, unless the connection between the proxy and its client has been closed, or unless the proxy itself requested the generation of the 1xx response. (For example, if a

proxy adds a “Expect: 100-continue” field when it forwards a request, then it need not forward the corresponding 100 (Continue) response(s).)

10.1.1 100 Continue

The client SHOULD continue with its request. This interim response is used to inform the client that the initial part of the request has been received and has not yet been rejected by the server. The client SHOULD continue by sending the remainder of the request or, if the request has already been completed, ignore this response. The server MUST send a final response after the request has been completed. See section 8.2.3 for detailed discussion of the use and handling of this status code.

10.1.2 101 Switching Protocols

The server understands and is willing to comply with the client’s request, via the Upgrade message header field (section 14.42), for a change in the application protocol being used on this connection. The server will switch protocols to those defined by the response’s Upgrade header field immediately after the empty line which terminates the 101 response.

The protocol SHOULD be switched only when it is advantageous to do so. For example, switching to a newer version of HTTP is advantageous over older versions, and switching to a real-time, synchronous protocol might be advantageous when delivering resources that use such features.

10.2 Successful 2xx

This class of status code indicates that the client’s request was successfully received, understood, and accepted.

10.2.1 200 OK

The request has succeeded. The information returned with the response is dependent on the method used in the request, for example:

GET an entity corresponding to the requested resource is sent in the response;

HEAD the entity-header fields corresponding to the requested resource are sent in the response without any message-body;

POST an entity describing or containing the result of the action;

TRACE an entity containing the request message as received by the end server.

10.2.2 201 Created

The request has been fulfilled and resulted in a new resource being created. The newly created resource can be referenced by the URI(s) returned in the entity of the response, with the most specific URI for the resource given by a Location header field. The response SHOULD include an entity containing a list of resource characteristics and location(s) from which the user or user agent can choose the one most appropriate. The entity format is specified by the media type given in the Content-Type header field. The origin server MUST create the resource before returning the 201 status code. If the action cannot be carried out immediately, the server SHOULD respond with 202 (Accepted) response instead.

A 201 response MAY contain an ETag response header field indicating the current value of the entity tag for the requested variant just created, see section 14.19.

10.2.3 202 Accepted

The request has been accepted for processing, but the processing has not been completed. The request might or might not eventually be acted upon, as it might be disallowed when processing actually takes place. There is no facility for re-sending a status code from an asynchronous operation such as this.

The 202 response is intentionally non-committal. Its purpose is to allow a server to accept a request for some other process (perhaps a batch-oriented process that is only run once per day) without requiring that the user agent’s connection to the server persist until the process is completed. The entity returned with this response SHOULD include an indication of the request’s current status and either a pointer to a status monitor or some estimate of when the user can expect the request to be fulfilled.

10.2.4 203 Non-Authoritative Information

The returned metainformation in the entity-header is not the definitive set as available from the origin server, but is gathered from a local or a third-party copy. The set presented MAY be a subset or superset of the original version. For example, including local annotation information about the resource might result in a superset of the metainformation known by the origin server. Use of this response code is not required and is only appropriate when the response would otherwise be 200 (OK).

10.2.5 204 No Content

The server has fulfilled the request but does not need to return an entity-body, and might want to return updated metainformation. The response MAY include new or updated metainformation in the form of entity-headers, which if present SHOULD be associated with the requested variant.

If the client is a user agent, it SHOULD NOT change its document view from that which caused the request to be sent. This response is primarily intended to allow input for actions to take place without causing a change to the user agent’s active document view, although any new or updated metainformation SHOULD be applied to the document currently in the user agent’s active view.

The 204 response MUST NOT include a message-body, and thus is always terminated by the first empty line after the header fields.

10.2.6 205 Reset Content

The server has fulfilled the request and the user agent SHOULD reset the document view which caused the request to be sent. This response is primarily intended to allow input for actions to take place via user input, followed by a clearing of the form in which the input is given so that the user can easily initiate another input action. The response MUST NOT include an entity.

10.2.7 206 Partial Content

The server has fulfilled the partial GET request for the resource. The request MUST have included a Range header field (section 14.35) indicating the desired range, and MAY have included an If-Range header field (section 14.27) to make the request conditional.

The response MUST include the following header fields:

      - Either a Content-Range header field (section 14.16) indicating
        the range included with this response, or a multipart/byteranges
        Content-Type including Content-Range fields for each part. If a
        Content-Length header field is present in the response, its
        value MUST match the actual number of OCTETs transmitted in the
        message-body.
      - Date
      - ETag and/or Content-Location, if the header would have been sent
        in a 200 response to the same request
      - Expires, Cache-Control, and/or Vary, if the field-value might
        differ from that sent in any previous response for the same
        variant

If the 206 response is the result of an If-Range request that used a strong cache validator (see section 13.3.3), the response SHOULD NOT include other entity-headers. If the response is the result of an If-Range request that used a weak validator, the response MUST NOT include other entity-headers; this prevents inconsistencies between cached entity-bodies and updated headers. Otherwise, the response MUST include all of the entity-headers that would have been returned with a 200 (OK) response to the same request.

A cache MUST NOT combine a 206 response with other previously cached content if the ETag or Last-Modified headers do not match exactly, see 13.5.4.

A cache that does not support the Range and Content-Range headers MUST NOT cache 206 (Partial) responses.

10.3 Redirection 3xx

This class of status code indicates that further action needs to be taken by the user agent in order to fulfill the request. The action required MAY be carried out by the user agent without interaction with the user if and only if the method used in the second request is GET or HEAD. A client SHOULD detect infinite redirection loops, since such loops generate network traffic for each redirection.

      Note: previous versions of this specification recommended a
      maximum of five redirections. Content developers should be aware
      that there might be clients that implement such a fixed
      limitation.

10.3.1 300 Multiple Choices

The requested resource corresponds to any one of a set of representations, each with its own specific location, and agent- driven negotiation information (section 12) is being provided so that the user (or user agent) can select a preferred representation and redirect its request to that location.

Unless it was a HEAD request, the response SHOULD include an entity containing a list of resource characteristics and location(s) from which the user or user agent can choose the one most appropriate. The entity format is specified by the media type given in the Content- Type header field. Depending upon the format and the capabilities of

the user agent, selection of the most appropriate choice MAY be performed automatically. However, this specification does not define any standard for such automatic selection.

If the server has a preferred choice of representation, it SHOULD include the specific URI for that representation in the Location field; user agents MAY use the Location field value for automatic redirection. This response is cacheable unless indicated otherwise.

10.3.2 301 Moved Permanently

The requested resource has been assigned a new permanent URI and any future references to this resource SHOULD use one of the returned URIs. Clients with link editing capabilities ought to automatically re-link references to the Request-URI to one or more of the new references returned by the server, where possible. This response is cacheable unless indicated otherwise.

The new permanent URI SHOULD be given by the Location field in the response. Unless the request method was HEAD, the entity of the response SHOULD contain a short hypertext note with a hyperlink to the new URI(s).

If the 301 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued.

      Note: When automatically redirecting a POST request after
      receiving a 301 status code, some existing HTTP/1.0 user agents
      will erroneously change it into a GET request.

10.3.3 302 Found

The requested resource resides temporarily under a different URI. Since the redirection might be altered on occasion, the client SHOULD continue to use the Request-URI for future requests. This response is only cacheable if indicated by a Cache-Control or Expires header field.

The temporary URI SHOULD be given by the Location field in the response. Unless the request method was HEAD, the entity of the response SHOULD contain a short hypertext note with a hyperlink to the new URI(s).

If the 302 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued.

      Note: RFC 1945 and RFC 2068 specify that the client is not allowed
      to change the method on the redirected request.  However, most
      existing user agent implementations treat 302 as if it were a 303
      response, performing a GET on the Location field-value regardless
      of the original request method. The status codes 303 and 307 have
      been added for servers that wish to make unambiguously clear which
      kind of reaction is expected of the client.

10.3.4 303 See Other

The response to the request can be found under a different URI and SHOULD be retrieved using a GET method on that resource. This method exists primarily to allow the output of a POST-activated script to redirect the user agent to a selected resource. The new URI is not a substitute reference for the originally requested resource. The 303 response MUST NOT be cached, but the response to the second (redirected) request might be cacheable.

The different URI SHOULD be given by the Location field in the response. Unless the request method was HEAD, the entity of the response SHOULD contain a short hypertext note with a hyperlink to the new URI(s).

      Note: Many pre-HTTP/1.1 user agents do not understand the 303
      status. When interoperability with such clients is a concern, the
      302 status code may be used instead, since most user agents react
      to a 302 response as described here for 303.

10.3.5 304 Not Modified

If the client has performed a conditional GET request and access is allowed, but the document has not been modified, the server SHOULD respond with this status code. The 304 response MUST NOT contain a message-body, and thus is always terminated by the first empty line after the header fields.

The response MUST include the following header fields:

      - Date, unless its omission is required by section 14.18.1

If a clockless origin server obeys these rules, and proxies and clients add their own Date to any response received without one (as already specified by [RFC 2068], section 14.19), caches will operate correctly.

      - ETag and/or Content-Location, if the header would have been sent
        in a 200 response to the same request
      - Expires, Cache-Control, and/or Vary, if the field-value might
        differ from that sent in any previous response for the same
        variant

If the conditional GET used a strong cache validator (see section 13.3.3), the response SHOULD NOT include other entity-headers. Otherwise (i.e., the conditional GET used a weak validator), the response MUST NOT include other entity-headers; this prevents inconsistencies between cached entity-bodies and updated headers.

If a 304 response indicates an entity not currently cached, then the cache MUST disregard the response and repeat the request without the conditional.

If a cache uses a received 304 response to update a cache entry, the cache MUST update the entry to reflect any new field values given in the response.

10.3.6 305 Use Proxy

The requested resource MUST be accessed through the proxy given by the Location field. The Location field gives the URI of the proxy. The recipient is expected to repeat this single request via the proxy. 305 responses MUST only be generated by origin servers.

      Note: RFC 2068 was not clear that 305 was intended to redirect a
      single request, and to be generated by origin servers only.  Not
      observing these limitations has significant security consequences.

10.3.7 306 (Unused)

The 306 status code was used in a previous version of the specification, is no longer used, and the code is reserved.

10.3.8 307 Temporary Redirect

The requested resource resides temporarily under a different URI. Since the redirection MAY be altered on occasion, the client SHOULD continue to use the Request-URI for future requests. This response is only cacheable if indicated by a Cache-Control or Expires header field.

The temporary URI SHOULD be given by the Location field in the response. Unless the request method was HEAD, the entity of the response SHOULD contain a short hypertext note with a hyperlink to the new URI(s) , since many pre-HTTP/1.1 user agents do not understand the 307 status. Therefore, the note SHOULD contain the information necessary for a user to repeat the original request on the new URI.

If the 307 status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued.

10.4 Client Error 4xx

The 4xx class of status code is intended for cases in which the client seems to have erred. Except when responding to a HEAD request, the server SHOULD include an entity containing an explanation of the error situation, and whether it is a temporary or permanent condition. These status codes are applicable to any request method. User agents SHOULD display any included entity to the user.

If the client is sending data, a server implementation using TCP SHOULD be careful to ensure that the client acknowledges receipt of the packet(s) containing the response, before the server closes the input connection. If the client continues sending data to the server after the close, the server’s TCP stack will send a reset packet to the client, which may erase the client’s unacknowledged input buffers before they can be read and interpreted by the HTTP application.

10.4.1 400 Bad Request

The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications.

10.4.2 401 Unauthorized

The request requires user authentication. The response MUST include a WWW-Authenticate header field (section 14.47) containing a challenge applicable to the requested resource. The client MAY repeat the request with a suitable Authorization header field (section 14.8). If the request already included Authorization credentials, then the 401 response indicates that authorization has been refused for those credentials. If the 401 response contains the same challenge as the prior response, and the user agent has already attempted authentication at least once, then the user SHOULD be presented the entity that was given in the response, since that entity might include relevant diagnostic information. HTTP access authentication is explained in “HTTP Authentication: Basic and Digest Access Authentication” [43].

10.4.3 402 Payment Required

This code is reserved for future use.

10.4.4 403 Forbidden

The server understood the request, but is refusing to fulfill it. Authorization will not help and the request SHOULD NOT be repeated. If the request method was not HEAD and the server wishes to make public why the request has not been fulfilled, it SHOULD describe the reason for the refusal in the entity. If the server does not wish to make this information available to the client, the status code 404 (Not Found) can be used instead.

10.4.5 404 Not Found

The server has not found anything matching the Request-URI. No indication is given of whether the condition is temporary or permanent. The 410 (Gone) status code SHOULD be used if the server knows, through some internally configurable mechanism, that an old resource is permanently unavailable and has no forwarding address. This status code is commonly used when the server does not wish to reveal exactly why the request has been refused, or when no other response is applicable.

10.4.6 405 Method Not Allowed

The method specified in the Request-Line is not allowed for the resource identified by the Request-URI. The response MUST include an Allow header containing a list of valid methods for the requested resource.

10.4.7 406 Not Acceptable

The resource identified by the request is only capable of generating response entities which have content characteristics not acceptable according to the accept headers sent in the request.

Unless it was a HEAD request, the response SHOULD include an entity containing a list of available entity characteristics and location(s) from which the user or user agent can choose the one most appropriate. The entity format is specified by the media type given in the Content-Type header field. Depending upon the format and the capabilities of the user agent, selection of the most appropriate choice MAY be performed automatically. However, this specification does not define any standard for such automatic selection.

      Note: HTTP/1.1 servers are allowed to return responses which are
      not acceptable according to the accept headers sent in the
      request. In some cases, this may even be preferable to sending a
      406 response. User agents are encouraged to inspect the headers of
      an incoming response to determine if it is acceptable.

If the response could be unacceptable, a user agent SHOULD temporarily stop receipt of more data and query the user for a decision on further actions.

10.4.8 407 Proxy Authentication Required

This code is similar to 401 (Unauthorized), but indicates that the client must first authenticate itself with the proxy. The proxy MUST return a Proxy-Authenticate header field (section 14.33) containing a challenge applicable to the proxy for the requested resource. The client MAY repeat the request with a suitable Proxy-Authorization header field (section 14.34). HTTP access authentication is explained in “HTTP Authentication: Basic and Digest Access Authentication” [43].

10.4.9 408 Request Timeout

The client did not produce a request within the time that the server was prepared to wait. The client MAY repeat the request without modifications at any later time.

10.4.10 409 Conflict

The request could not be completed due to a conflict with the current state of the resource. This code is only allowed in situations where it is expected that the user might be able to resolve the conflict and resubmit the request. The response body SHOULD include enough

information for the user to recognize the source of the conflict. Ideally, the response entity would include enough information for the user or user agent to fix the problem; however, that might not be possible and is not required.

Conflicts are most likely to occur in response to a PUT request. For example, if versioning were being used and the entity being PUT included changes to a resource which conflict with those made by an earlier (third-party) request, the server might use the 409 response to indicate that it can’t complete the request. In this case, the response entity would likely contain a list of the differences between the two versions in a format defined by the response Content-Type.

10.4.11 410 Gone

The requested resource is no longer available at the server and no forwarding address is known. This condition is expected to be considered permanent. Clients with link editing capabilities SHOULD delete references to the Request-URI after user approval. If the server does not know, or has no facility to determine, whether or not the condition is permanent, the status code 404 (Not Found) SHOULD be used instead. This response is cacheable unless indicated otherwise.

The 410 response is primarily intended to assist the task of web maintenance by notifying the recipient that the resource is intentionally unavailable and that the server owners desire that remote links to that resource be removed. Such an event is common for limited-time, promotional services and for resources belonging to individuals no longer working at the server’s site. It is not necessary to mark all permanently unavailable resources as “gone” or to keep the mark for any length of time — that is left to the discretion of the server owner.

10.4.12 411 Length Required

The server refuses to accept the request without a defined Content- Length. The client MAY repeat the request if it adds a valid Content-Length header field containing the length of the message-body in the request message.

10.4.13 412 Precondition Failed

The precondition given in one or more of the request-header fields evaluated to false when it was tested on the server. This response code allows the client to place preconditions on the current resource metainformation (header field data) and thus prevent the requested method from being applied to a resource other than the one intended.

10.4.14 413 Request Entity Too Large

The server is refusing to process a request because the request entity is larger than the server is willing or able to process. The server MAY close the connection to prevent the client from continuing the request.

If the condition is temporary, the server SHOULD include a Retry- After header field to indicate that it is temporary and after what time the client MAY try again.

10.4.15 414 Request-URI Too Long

The server is refusing to service the request because the Request-URI is longer than the server is willing to interpret. This rare condition is only likely to occur when a client has improperly converted a POST request to a GET request with long query information, when the client has descended into a URI “black hole” of redirection (e.g., a redirected URI prefix that points to a suffix of itself), or when the server is under attack by a client attempting to exploit security holes present in some servers using fixed-length buffers for reading or manipulating the Request-URI.

10.4.16 415 Unsupported Media Type

The server is refusing to service the request because the entity of the request is in a format not supported by the requested resource for the requested method.

10.4.17 416 Requested Range Not Satisfiable

A server SHOULD return a response with this status code if a request included a Range request-header field (section 14.35), and none of the range-specifier values in this field overlap the current extent of the selected resource, and the request did not include an If-Range request-header field. (For byte-ranges, this means that the first- byte-pos of all of the byte-range-spec values were greater than the current length of the selected resource.)

When this status code is returned for a byte-range request, the response SHOULD include a Content-Range entity-header field specifying the current length of the selected resource (see section 14.16). This response MUST NOT use the multipart/byteranges content- type.

10.4.18 417 Expectation Failed

The expectation given in an Expect request-header field (see section 14.20) could not be met by this server, or, if the server is a proxy, the server has unambiguous evidence that the request could not be met by the next-hop server.

10.5 Server Error 5xx

Response status codes beginning with the digit “5” indicate cases in which the server is aware that it has erred or is incapable of performing the request. Except when responding to a HEAD request, the server SHOULD include an entity containing an explanation of the error situation, and whether it is a temporary or permanent condition. User agents SHOULD display any included entity to the user. These response codes are applicable to any request method.

10.5.1 500 Internal Server Error

The server encountered an unexpected condition which prevented it from fulfilling the request.

10.5.2 501 Not Implemented

The server does not support the functionality required to fulfill the request. This is the appropriate response when the server does not recognize the request method and is not capable of supporting it for any resource.

10.5.3 502 Bad Gateway

The server, while acting as a gateway or proxy, received an invalid response from the upstream server it accessed in attempting to fulfill the request.

10.5.4 503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance of the server. The implication is that this is a temporary condition which will be alleviated after some delay. If known, the length of the delay MAY be indicated in a Retry-After header. If no Retry-After is given, the client SHOULD handle the response as it would for a 500 response.

      Note: The existence of the 503 status code does not imply that a
      server must use it when becoming overloaded. Some servers may wish
      to simply refuse the connection.

10.5.5 504 Gateway Timeout

The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server specified by the URI (e.g. HTTP, FTP, LDAP) or some other auxiliary server (e.g. DNS) it needed to access in attempting to complete the request.

      Note: Note to implementors: some deployed proxies are known to
      return 400 or 500 when DNS lookups time out.

10.5.6 505 HTTP Version Not Supported

The server does not support, or refuses to support, the HTTP protocol version that was used in the request message. The server is indicating that it is unable or unwilling to complete the request using the same major version as the client, as described in section 3.1, other than with this error message. The response SHOULD contain an entity describing why that version is not supported and what other protocols are supported by that server.

L2TP/IPSec VPN clients (Windows 7 manual configuration)

Configure the VPN connection

  • Go to “Start”, then “Control Panel”, then “Network and Internet”, then “Network and Sharing Center”.
  • Click “Set up a new connection or network”.
  • Select “Connect to a workplace” and click “Next”.
  • Click “Use my Internet connection (VPN)”.
  • For “Internet address:” enter “vpn2.net.ed.ac.uk”.
  • For “Destination name:” enter e.g. “UoE L2TP VPN”.
  • Select “Don’t connect now; just set it up so I can connect later”. Leave the other boxes unchecked.
  • Click “Next”.
  • For “User name:” enter your UUN.
  • Leave “Password:”, “Show characters”, “Remember this password” and “Domain optional:” blank.
  • Click “Create”.
  • Now click “Close”. Do NOT click “Connect now” yet, as there is additional configuration required.
  • Go to “Start”, then “Control Panel”, then “Network and Internet”, then “Network and Sharing Center”.
  • Click “Change adapter settings”.
  • Right-click the VPN adapter you have just configured e.g. “UoE L2TP VPN” and select “Properties”.
  • Click the “Options” tab. Untick “Include Windows logon domain”.
  • Click the “Security” tab. For “Type of VPN” select “Layer 2 Tunneling Protocol with IPsec (L2TP/IPSec)”.
  • Click “Advanced settings”.
  • In the “Advanced Properties” window, select “Use preshared key for authentication”, and for “Key”: enter “playfair”.
  • Click “OK”.
  • Back in the “UoE L2TP VPN Properties” window, click “OK”.

Connect to the VPN service

  • Go to “Start”, then “Control Panel”, then “Network and Internet”, then “Network and Sharing Center”.
  • Click “Connect to a network”.
  • In the pop-up window at the bottom right of the screen, select the VPN connection you have created, e.g. “UoE L2TP VPN”, and click “Connect”.
  • Enter your UUN and the password which you specified when you registered for the VPN service, then click “Connect”.
  • You should now be connected to the University VPN service.

Troubleshooting

If the instructions above do not result in a successful connection to theVPN service, please check that Windows services on your device are configured as described below.

  • Go to “Start”, then “Control Panel”, then “System and Security”, then “Administrative Tools”.
  • Double click “Services”.
  • In the “Services” window, scroll down the list to “IKE and AuthIP IPsec Keying Modules”. Double click on this item.
  • In the “IKE and AuthIP IPsec Keying Modules Properties” window, ensure “Startup type” is set to be “Automatic”.
  • If the “Service status” is not “Started”, click “Start” to start the “IKE and AuthIP IPsec Keying Modules” service.
  • Click “OK”.
  • Now back in the “Services” window, double click on “IPsec Policy Agent”.
  • Repeat the same process as for the “IKE and AuthIP IPsec Keying Modules”, ensuring the “Startup type” is set to be “Automatic” and the “Service status” is “Started”.
  • Click “OK”.
  • Close the “Services” window

Now connect to the VPN service as described above.

GNS3 emulated hardware and FAQs

GNS3 | FAQ

Q. Will you support Cisco switching?

A. Switching is going be supported in GNS3 using L2IOU images, which are special IOS images made to work on PC/Linux. These are more like generic Cisco switches with most of the same features as in real switches. So in the end you can have 90% of the same features, just a bit slower.

Q. Will switching work on Windows or Mac OS X?

A. Currently, L2IOU images work only on Linux or Solaris. On Windows and Mac OS X, the current plan is to use a virtual machine to run L2IOU but we are still looking for an alternative technical solution.

Q. Why not supporting 100% of Cisco switching features?

A. Simply because L2IOU images do not support all of the features, we suspect that some of them require the dedicate hardware found in Cisco devices in order to work, other features are simply buggy in currently available L2IOU versions. The one that are likely not to work are L3 Etherchannel, ISL trunks, DHCP snooping, Private VLAN, SPAN/RSPAN/ERSPAN, Port-security, Voice VLANs, MLS QoS and QinQ.

Q. Will I be able to run IOS-XE?

A. Cisco has released an IOS-XE version that work in VMware and KVM. Actually, you can already use it with GNS3 (please see this newsfor more details) but we want to make it easier.

Q. Will I be able to run NX-OS (Nexus)?

A. Cisco has a version of NX-OS than can run inside VMware ESX/ESXi. So in theory there is a way to use it with GNS3, we do not have more info because our focus is on routing & switching and security.

Q. Will I be able to run IOS-XR?

A. Cisco is planning to release a virtual IOS-XR named XRv early next year. After this release, it should be possible to integrate IOS-XR in GNS3.

Q. Will you provide ways to train for Cisco Data Center and Voice certifications?

A. Our focus is currently on Routing & Switching followed by security but we plan to check what can be technically done for Data Center and Voice in the future.

Q. Will IOS 15.x be supported?

A. IOS 15.x is currently only supported by the Cisco 7200 router in GNS3 but thanks to the IOU (IOS on Unix) integration, more IOS 15.x versions will be supported and with less resources too.

Q. Will you add more Cisco devices like ISR or other platforms?

A. No, the issue is that these devices have specialized hardware impossible or extremely hard to emulate. New Cisco devices will come in the form of VMware/KVM/VirtualBox appliances (see IOS-XE, IOS-XR and NX-OS questions above) and IOU images.

Q. Will Arista’s EOS be supported?

A.One of our user managed to run Arista vEOS within GNS3! See this forum post for more details. So all we need to do is maybe streamline this a bit and here it is, Arista’s EOS platform in GNS3!

Q. Will GNS3 support HP Procurve switches and routers in the future?

A. HP is starting to have some simulation/emulation products out there that can potentially be integrated in GNS3. We also have to see if a partnership is possible with HP. So yes probably in the future but not for the first release of the new GNS3.

  • Why my c2600 IOS image doesn’t work with Dynamips/GNS3?
    • Images for 2600 routers must be uncompressed to work.
  • Why my serial connection works though the interfaces are both DCE?
    • GNS3/Dynamips doesn’t emulate the physical layer which is why the serial connections work even though they are both DCE.
  • Is IOS version 15.0 supported?
    • 7206VXR is the only emulated router that supports this IOS. Please also note Cisco stated that only IOS 15.n(n)M releases will be supported on Cisco 7200 series routers.

Cisco 1700 Series

1700s have one or more interfaces on the motherboard, 2 subslots for WICs (excepting on 1710s), an no NM slots.

1710

  • 1 FastEthernet and 1 Ethernet fixed ports (CISCO1710-MB-1FE-1E).
  • WIC slots: 0
  • Note that interfaces do not use a slot designation (e.g. “f0”)

1720, 1721 and 1750

  • 1 FastEthernet fixed port (C1700-MB-1ETH).
  • WIC slots: 2 (maximum of 2 Ethernet ports or 4 serial ports).
  • Note that interfaces do not use a slot designation (e.g. “f0”)

1751 and 1760

  • 1 FastEthernet fixed port (C1700-MB-1ETH).
  • WIC slots: 2 (maximum of 2 Ethernet ports or 4 serial ports).

WIC cards

Cisco 2600 Series

2600s have one or more interfaces on the motherboard, 2 subslots for WICs and 1 Network Module (NM) slot.

2610

  • 1 Ethernet fixed port (CISCO2600-MB-1E).
  • NM slots: 1 (maximum of 4 Ethernet ports or 16 FastEthernet ports).
  • WIC slots: 3 (maximum of 6 serial ports).

2611

  • 2 Ethernet fixed ports (CISCO2600-MB-2E).
  • NM slots: 1 (maximum of 4 Ethernet ports or 16 FastEthernet ports).
  • WIC slots: 3 (maximum of 6 serial ports).

2610XM, 2620, 2620XM and 2650XM

  • 1 FastEthernet fixed port (CISCO2600-MB-1FE).
  • NM slots: 1 (maximum of 4 Ethernet ports or 16 FastEthernet ports).
  • WIC slots: 3 (maximum of 6 serial ports).

2611XM, 2621, 2621XM and 2651XM

  • 2 FastEthernet fixed ports (CISCO2600-MB-2FE).
  • NM slots: 1 (maximum of 4 Ethernet ports or 16 FastEthernet ports).
  • WIC slots: 3 (maximum of 6 serial ports).

Network Modules

  • NM-1E (1 Ethernet port)
  • NM-4E (4 Ethernet ports)
  • NM-1FE-TX (1 FastEthernet port)
  • NM-16ESW (switch module: 16 FastEthernet ports)
  • NM-NAM (Network Analysis Module, not working).
  • NM-IDS (IDS Network Module, not working).

WIC cards

Cisco 3600 Series

3600s have 2 to 6 Network Module (NM) slots.

3620

  • NM slots: 2 (maximum of 8 Ethernet ports, 32 FastEthernet ports or 8 serial ports).

3640

  • NM slots: 4 (maximum of 16 Ethernet ports, 32 FastEthernet ports or 16 serial ports).

3660

  • 2 FastEthernet fixed ports (Leopard-2FE).
  • NM slots: 6 (maximum of 24 Ethernet ports, 32 FastEthernet ports or 24 serial ports).

Network Modules

  • NM-1E (1 Ethernet port)
  • NM-4E (4 Ethernet ports)
  • NM-1FE-TX (1 FastEthernet port)
  • NM-16ESW (switch module: 16 FastEthernet ports, maximum of 2 modules per router)
  • NM-4T (4 serial ports)

Cisco 3700 Series

3700s have 2 FastEthernet interfaces on the motherboard, 3 subslots for WICs and 1 to 4 Network Module (NM) slots.

2691

  • 2 FastEthernet fixed ports (GT96100-FE)
  • NM slots: 1 (maximum of 16 FastEthernet ports or 4 serial ports).
  • WIC slots: 3 (maximum of 6 serial ports).
  • Note: the 2691 is essentially a 3700 with 1 NM slot.

3725

  • 2 FastEthernet fixed ports (GT96100-FE)
  • NM slots: 2 (maximum of 32 FastEthernet ports or 8 serial ports).
  • WIC slots: 3 (maximum of 6 serial ports).

3745

  • 2 FastEthernet fixed ports (GT96100-FE)
  • NM slots: 4 (maximum of 32 FastEthernet ports or 16 serial ports).
  • WIC slots: 3 (maximum of 6 serial ports).

Network Modules

  • NM-1FE-TX (1 FastEthernet port)
  • NM-16ESW (switch module: 16 FastEthernet ports, maximum of 2 modules per router)
  • NM-4T (4 serial ports)
  • NM-NAM (Network Analysis Module, not working).
  • NM-IDS (IDS Network Module, not working).

WIC cards

Cisco 7200 Series

7200s have a different architecture. Only the 7206 is supported, it has 6 Port Adapters (PA) slots.

7206

  • PA slots: 6
  • Note: VXR chassis, NPE-400 and C7200-IO-FE are the default in GNS3.

Chassis types

  • STD
  • VXR

Network Processing Engines (NPEs)

  • NPE-100
  • NPE-150
  • NPE-175
  • NPE-200
  • NPE-225
  • NPE-300
  • NPE-400
  • NPE-G2 (requires the use of NPE-G2 c7200p IOS images)

Input/Output Controllers

Can be inserted into slot 0 only.

  • C7200-IO-FE (1 FastEthernet port)
  • C7200-IO-2FE (2 FastEthernet ports)
  • C7200-IO-GE-E (1 GigabitEthernet port, Ethernet port is not functional)

Port Adapters

Online Insertion and Removal (OIR) is supported, allowing you to replace PAs while the router is running.

Cisco Catalyst Switches

At this moment, it is not possible to emulate Catalyst switches with Dynamips/GNS3. This is due to the impossibility to emulate ASIC processors used in those type of devices. However you can use the EtherSwitch module with 2600s, 3600s and 3700s Series. Keep in mind that this module works differently (uses the vlan database etc.) and doesn’t support the following features:

  • Access Switch Device Manager (SDM) Template
  • ACL – Improved Merging Algorithm
  • ARP Optimization
  • BGP Increased Support of Numbered as-path Access Lists to 500
  • BGP Restart Neighbor Session After max-prefix Limit Reached
  • BGP Route-Map Continue Support for Outbound Policy
  • Clear Counters Per Port
  • DHCP Snooping
  • DHCP Snooping Counters
  • Diagnotics Options on bootup
  • ErrDisable Reactivation Per Port
  • ErrDisable timeout
  • EtherChannel – Flexible PAgP
  • Etherchannel Guard
  • Fallback Bridging
  • Flex Link Bi-directional Fast Convergence
  • Flex Link VLAN Load-Balancing
  • Flex Links Interface Preemption
  • GOLD – Generic Online Diagnostics
  • IEEE 802.1ab, Link Layer Discovery Protocol
  • IEEE 802.1s – Multiple Spanning Tree (MST) Standard Compliance
  • IEEE 802.1s VLAN Multiple Spanning Trees
  • IEEE 802.1t
  • IEEE 802.1W Spanning Tree Rapid Reconfiguration
  • IEEE 802.1x – Auth Fail Open
  • IEEE 802.1x – Auth Fail VLAN
  • IEEE 802.1x – VLAN Assignment
  • IEEE 802.1x – Wake on LAN Support
  • IEEE 802.1X Multi-Domain Authentication
  • IEEE 802.1x RADIUS Accounting
  • IEEE 802.1x with Port Security
  • IEEE 802.3ad Link Aggregation (LACP)
  • IEEE 802.3af Power over Ethernet
  • IGMP Fast Leave
  • IGMP Version 1
  • IGRP
  • IP Phone Detection Enhancements
  • IP Phone Enhancement – PHY Loop Detection
  • IPSG (IP Source Guard)
  • Jumbo Frames
  • L2PT – Layer 2 Protocol Tunneling
  • MAC Authentication Bypass
  • MLD Snooping
  • Multicast Etherchannel Load Balancing
  • NAC – L2 IEEE 802.1x
  • NAC – L2 IP
  • NAC – L2 IP with Auth Fail Open
  • Packet-Based Storm Control
  • Per Port Per VLAN Policing
  • Port Security
  • Port Security on Private VLAN Ports
  • Private VLANs
  • QoS Policy Propagation via Border Gateway Protocol (QPPB)
  • Rapid-Per-VLAN-Spanning Tree (Rapid-PVST)
  • Reduced MAC Address Usage
  • Remote SPAN (RSPAN)
  • Smart Port
  • Spanning Tree Protocol (STP) – Loop Guard
  • Spanning Tree Protocol (STP) – PortFast BPDU Filtering
  • Spanning Tree Protocol (STP) – Portfast Support for Trunks
  • Spanning Tree Protocol (STP) – Root Guard
  • Spanning Tree Protocol (STP) – Uplink Load Balancing
  • SRR (Shaped Round Robin)
  • Standby Supervisor Port Usage
  • STP Syslog Messages
  • Switching Database Manager (SDM)
  • Trunk Failover
  • Trusted boundary (extended trust for CDP devices)
  • Unicast Mac Filtering
  • UniDirectional Link Detection (UDLD)
  • VLAN Access Control List (VACL)
  • VLAN Aware Port Security
  • Weighted Tail Drop (WTD)

Cisco PIX firewalls

A special version of Qemu called PEMU is embedded into GNS3 for emulating the PIX 525 Security Appliance. PIX software up to version 7.2(4) is supported.

Cisco ASA firewalls

Qemu/GNS3 emulates ASA5520 (ASA 5520 Series Adaptive Security Appliance) hardware to run ASA software up to version 8.0(2).

Cisco IDS sensors

Qemu/GNS3 emulates an IDS 4235/4215 Sensor. The software IPS is known to run with release 6.0.

Juniper routers

JunOS, the Operating System for Juniper routers is based on FreeBSD, an UNIX Operating System that runs on PCs. At this date JunOS versions for Juniper M series are known to work in GNS3.

Hosts

Thanks to Qemu and VirtualBox, GNS3 can run many operating systems like Linux or Windows as well as a lot of appliances. To save you time, we provide ready-to-use Qemu and VirtualBox images that integrate Linux Microcore (command line) and Linux Tinycore (small graphical interface). These images are designed to not use much memory, allowing you to run many virtual hosts. They include the following tools and features:

  • Console support
  • IPv6 support
  • iperf, tcpdump, iproute2 and iptables
  • SSH and telnet servers
  • D-ITG (Distributed Internet Traffic Generator)

Performance

Dynamips/GNS3 uses a fair amount of RAM and CPU in order to accomplish its emulation magic. Instructions can be found in the user documentation to reduce this but you may also consider the following advices:

  • Use c36xx, c37xx or c7200 IOS images. They are usually more stable with Dynamips.
  • Run Dynamips/GNS3 on Linux or Mac OS X if you can, performance is better and Dynamips is far more stable.
  • Try to not use the latest IOS images, for instance versions >= 12.4, depending of the IOS features you want, running 12.3 or 12.2 versions requires a lot less memory and CPU.

Of course, the number of routers you can run at the same time also strongly depend of your amount of RAM and CPU. On average users can run 10 to 15 routers with routing protocols configured without any problem. Some have even ran more than 100 routers on the same PC.

Getting started with GNS3 (Installation and configuration)

Up & Running With GNS3 1.X

How to Setup GNS3
https://www.youtube.com/watch?v=o_58Vp2PViU

Adding your own PC to GNS3 with MS Loopback

MicroNugget: GNS3 and Windows 8

MicroNugget: How to Tune GNS3 to Avoid a 100% CPU Utilization?

MicroNugget: Connecting Virtual Box Hosts to GNS3 Networks

MicroNugget: Virtual PC Simulators & GNS3

MicroNugget: Using Wireshark with GNS3

MicroNugget: Connecting GNS3 to the Internet

MicroNugget: The ASA in GNS3

How To Install GNS3 1.0 on Windows 8.1

GNS3 1.0 was released to the world on October 21st, 2014. I have been using previous versions of GNS3 for some time now to simulate networks and to practice for my Cisco certifications. For those of you who aren’t familiar with GNS3, it is an application that allows you to build networks for free. The caveat there is you need to supply the images for your equipment. GNS3 supports Cisco, Juniper, HP, Arista, Citrix, and Brocade (as specified on their site, gns3.com. You build out a virtual lab which means there is no need to purchase physical hardware.

Before getting started, you’ll need to sign up on GNS3‘s website. Once you have an account. You can download GNS3. Click on the Windows download button to begin.

Download GNS3 for Windows

Once you open the installation file, click through the standard setup screen and agreement until you get to the Choose Components section.


How to Install GNS3

GNS3 Components

Select all the components you will need – almost everything. SolarWinds is a new application packaged with GNS3. If you already have some of the components installed, such as Wireshark, you can uncheck it.

Location of Installation

After completing installation, Start GNS3.

Upon opening GNS3, you will be prompted to save your new project locally or in the cloud. For the purposes of setting up GNS3 I will skip this.

Store GNS3 project files locally or in the cloud

Click on Edit and then Preferences.

Editing preferences of GNS3

Expand Dynamips and select IOS routers.

Add new IOS images

This is where you must supply your IOS image. I cannot supply these images for you. Click on New to add your image.

Add new IOS image in GNS3

Enter the name of the Image and its platform.

Add a name and platform

Set the amount of RAM to be allocated to IOS.

Allocated ram

Select the default adapters you want installed for each new instance of this device.

The default adapters for the template

After you finish, the router will be displayed with its settings.

List of images

Click on the General tab to view your settings. Make any changes as you see fit.

GNS3 General Preferences

The Console applications tab is where you can configure what application is to be used to console into your devices within GNS3.

Putty for console

The Packet capture tab displays your settings for capturing traffic on links between your devices within GNS3. Notice the capture analyzer command using SolarWindows Response Time Viewer.

Wireshark for packet capture

Click OK to close the Preferences window.

The big window in the middle of GNS3 is your topology view. This is wear you drag and drop devices from the left menu item.

GNS3 Main Window

To add a device, click on one of the symbols on the left and drag and drop the IOS image you’ve uploaded to GNS3.

Click and drag

The Topology Summary window will display a list of all your devices. A red orb signifies a device that is off. A green orb means the device is on.

Right click on your device and click on Start to turn on your device. Right click again and select Console to bring up Putty to manage your device.

Device Menu

Happy labbing!

GNS3 1.2.1 installation on Ubuntu 14.04

As mentioned in an earlier post GNS3 is moving ahead fast. Currently at version 1.2.1 the GNS3 is looking great. Compared with the version 1.0 Beta 1 which I had installed, the 1.2.1 is not only more stable, but it has the Menu more clean and compact. For example now there is only one Preferences menu where you can adjust all your settings.

During the installation of 1.0 Beta 1 I made some notes in Evernote and it prove to be very useful as the installation was pretty messy. With 1.2.1 I did the same thing, but the installation was very smooth. Still, I said that if I made those notes maybe I should share them for those interested in a quick installation. A more complete guide can be found on GNS3 Community.

1. Download GNS3 1.2.1

Head over to http://www.gns3.com/, create and account and download the bundle archive for Linux.

If you for some reason you don’t want to create an account, you may download each package individually from https://github.com/GNS3

The following lines will assume that you have the bundle archive.

2. Install Ubuntu 14.04 dependencies

3. Unzip the bundle archive

You should see 5 packages in GNS3-1.2.1 folder:
dynamips-0.2.14.zip
gns3-server-1.2.1.zip
gns3-gui-1.2.1.zip
iouyap-0.95.zip
vpcs-0.6.zip

4. Install Dynamips

To check if the correct version is install:

You should see in the output 0.2.14

5. Install GNS3 Server

To check if the GNS3 Server is installed correctly:

If you see some output other than an error, than you’re fine.

6. Install GNS3 GUI

To test if the installation is working:

You should see a graphical interface of GNS3 launched.

At this moment you have a working GNS3 environment if you want only want to test Cisco hardware emulators. I strongly recommend to continue and install also the rest of the components. Who knows when you’ll need them

7. Install IOUyap (Optional, if you will use IOU images)

To test the installation:

8. Install VPCS (Optional, if you want to use VirtualPC)

For the third line, the 64 represent 64bit, as my Ubuntu 14.04 is build on 64bit.
The values can be:
– 32 or i386 for 32bit OS
– 64 or amd64 for 64bit OS

Please be sure to use the correct one for your OS.

To test the VPCS:

You should see a Virtual PC being launched. Leave the console with letter q.

9. Install VirtualBox (Optional, if you want to launch VMs)

Download the correct version for your system from https://www.virtualbox.org/wiki/Linux_Downloads. The following lines will assume an Ubuntu 14.04 64bit OS.

You can also use the instructions at https://www.virtualbox.org/wiki/Linux_Downloads and go for an APT installation.The choice is yours.

10. Install Qemu (Optional, if you want to use qemu images)

11. Install IOU (Optional, if you want to use IOU images)

I’m not a legal matter expert, and the usage of IOU is sort of grey area. Because of this, I’m not going to cover this chapter.

You’re ready to go. Start the GNS3 GUI:

Some things to check before going live:

  • check in the menu Edit > Preferences to set your desired Paths (in General sections) and to check the paths for the binaries (dynamips, vpcs, iou, virtualbox…)
  • add the IOS, virtualbox vm, iou images
  • in case of Cisco hardware emulators don’t forget to find the IdlePC value (when you add the IOS image or later with the start of your first router with a certain image) otherwise your CPUs will cry.

If something does not work as described or you need help please let me know in Comments.

[Update 1]

If you get the following error during installation of iouyap:

Try to install the iniparser as follows:

then

and finally iouyap

Regular Expressions in Linux Explained with Examples (RegEx / Regex)

regex

Regular expressions (Regexp)is one of the advanced concept we require to write efficient shell scripts and for effective system administration. Basically regular expressions are divided in to 3 types for better understanding.

1)Basic Regular expressions

2)Interval Regular expressions (Use option -E for grep and -r for sed)

3)Extended Regular expressions (Use option -E for grep and -r for sed)

Some FAQ’s before starting Regular expressions

What is a Regular expression?

A regular expression is a concept of matching a pattern in a given string.

Which commands/programming languages support regular expressions?
vi, tr, rename, grep, sed, awk, perl, python etc.

Basic Regular Expressions

Basic regular expressions: This set includes very basic set of regular expressions which do not require any options to execute. This set of regular expressions are developed long time back.

^ –Caret/Power symbol to match a starting at the beginning of line.

$ –To match end of the line

* –0 or more occurrence of previous character.

. –To match any character

[] –Range of character

[^char] –negate of occurrence of a character set

–Actual word finding

–Escape character

Lets start with our Regexp with examples, so that we can understand it better.

^ Regular Expression

Example 1: Find all the files in a given directory

ls -l | grep ^-

As you are aware that the first character in ls -l output,  is for regular files and d for directories in a given folder. Let us see what ^- indicates. The ^ symbol is for matching line starting, ^- indicates what ever lines starts with -, just display them. Which indicates a regular file in Linux/Unix.

If we want to find all the directories in a folder use grep ^d option along ls -l as shown below

ls -l | grep ^d

How about character files and block files?

ls -l | grep ^c

ls -l | grep ^b

We can even find the lines which are commented using ^ operator with below example

grep ‘^#’ filename

How about finding lines in a file which starts with ‘abc’

grep ‘^abc’ filename

We can have number of examples with this ^ option.

$ Regular Expression

Example 2: Match all the files which ends with sh

ls -l | grep sh$

As $ indicates end of the line, the above command will list all the files whose names end with sh.

how about finding lines in a file which ends with dead

grep ‘dead$’ filename

How about finding empty lines in a file?

grep ‘^$’ filename

 * Regular Expression

Example 3: Match all files which have a word twt, twet, tweet etc in the file name.

ls -l | grep ‘twe*t’

How about searching for apple word which was spelled wrong in a given file where apple is misspelled as ale, aple, appple, apppple, apppppple etc. To find all patterns

grep ‘ap*le’ filename

Readers should observe that the above pattern will match even ale word as * indicates 0 or more of previous character occurrence.

. Regular Expression

Example 4: Filter a file which contains any single character between t and t in a file name.

ls -l | grep ‘t.t’

Here . will match any single character. It can match tat, t3t, t.t, t&t etc any single character between t and t letters.

How about finding all the file names which starts with a and end with x using regular expressions?

ls -l | grep ‘a.*x’

The above .* indicates any number of characters

Note: .* in this combination . indicates any character and it repeated(*) 0 or more number of times.
Suppose you have files as..
awx
awex
aweex
awasdfx
a35dfetrx
etc.. it will find all the files/folders which start with a and ends with x in our example.

[] Square braces/Brackets Regular Expression

Example 5: Find all the files which contains a number in the file name between a and x

ls -l | grep ‘a[0-9]x’

This will find all the files which is
a0xsdf
asda1xsdfas
..
..
asdfdsara9xsdf
etc.

So where ever it finds a number it will try to match that number.

Some of the range operator examples for  you.

[a-z] –Match’s any single char between a to z.

[A-Z] –Match’s any single char between A to Z.

[0-9] –Match’s any single char between 0 to 9.

[a-zA-Z0-9] – Match’s any single character either a to z or A to Z or 0 to 9

[!@#$%^] — Match’s any ! or @ or # or $ or % or ^ character.

You just have to think what you want match and keep those character in the braces/Brackets.

[^char] Regular Expression

Example6: Match all the file names except a or b or c in its filenames

ls | grep  ‘[^abc]’

This will give output all the file names except files which contain a or b or c.

Regular expression

Example7: Search for a word abc, for example I should not get abcxyz or readabc in my output.

grep ” filename

Escape Regular Expression

Example 8: Find files which contain [ in its name, as [ is a special charter we have to escape it

grep “[” filename

or

grep ‘[[]’ filename

Note: If you observe [] is used to negate the meaning of [ regular expressions, so if you want to find any specail char keep them in [] so that it will not be treated as special char.

Note: No need to use -E to use these regular expressions with grep. We have egrep and fgrep which are equal to “grep -E”. I suggest you just concentrate on grep to complete your work, don’t go for other commands if grep is there to resolve your issues.