Ubuntu / Debian – WANem network setup (briged interface)

I came across WANem 2.3 and I tried it with my GNS3.

The scenario was pretty simple:

Router <—> WAN emulator <—> Router

My WANem has a third interface for management. But this interface is not mentioned seperatly.

To connect the two routers two options different options are available for WANem.

Either you use routing or a briged interface. Both have their pre and cons.

 

Routing Option

First of all you have to activate ip forwarding in any case.

 echo 1 > /proc/sys/net/ipv4/ip_forward

The Scenario uses simple static routing.

Router 1 (R1) 10.0.1.1 <—>¬†10.0.1.2 WAN emulator¬†10.0.2.2 <—> 10.0.2.1 Router 2 (R2)

In order to get a connection between the routers you have to add on both routers a default gateway.  Than you can use WANem to manipulate the connection.

On Cisco:

R1
conf t
ip route 0.0.0.0 0.0.0.0 10.0.1.2

R2
conf t
ip route 0.0.0.0 0.0.0.0 10.0.2.2

 

Bridge Option

But very often you do not want to have an additional routing within your network. Just some modification on the connection behavior (like jitter, delay …)]

In this case a bridged interface is needed.

Router 1 (R1) 10.0.1.1 <—> WAN emulator <—> 10.0.1.2 Router 2 (R2)

Enable the IP forward option:

 echo 1 > /proc/sys/net/ipv4/ip_forward

For testing purposes a manual setup of the br0 can be established

ifconfig eth0 up
ifconfig eth1 up
ifconfig eth2 up

In my Case eth0 is my management interface. It has a dedicated IP for administration.

Create the br0 interface

brctl addbr br0

Further assign the needed network interfaces to the bridge.

brctl addif br0 eth1
brctl addif br0 eth2

Now bring the niterface br0 up. You have to asign an IP address to get the interface up and running.

ifconfig br0 10.0.0.1 netmask 255.255.255.0 up

Now the briged interface is ready to use.

Just verify it with “ifconfig” an interface “br0” should appear.

in order to keep the bridge interface permantly add to your /etc/network/interfaces

auto br0
iface br0 inet static
        address 10.0.0.1
        netmask 255.255.255.0
        bridge_ports eth1 eth2
        bridge_fd 0
        bridge_stp no

My /etc/network/interfaces

# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)

# The loopback interface
# automatically added when upgrading
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto br0
iface br0 inet static
 address 10.0.0.1
 netmask 255.255.255.255
 bridge_ports eth1 eth2
 bridge_fd 0
 bridge_stp no

1 comment for “Ubuntu / Debian – WANem network setup (briged interface)

Leave a Reply

Your email address will not be published. Required fields are marked *