Search This Blog

Tuesday, June 7, 2011

Cloud to Ethernet interface - with TAP

Here are the steps to manually create a bridge group.
======================================
  1. Create a tap interface
    sudo tunctl -t tap0
  2. Remove ip addressing and set eth0 and tap0 to promiscuous mode
    sudo ifconfig tap0 0.0.0.0 promisc up
    sudo ifconfig eth0 0.0.0.0 promisc up
  3. Create a new bridge interface
    sudo brctl addbr br0
  4. Add tap0 and eth0 to the bridge group
    sudo brctl addif br0 tap0
    sudo brctl addif br0 eth0
  5. Enable the bridge interface and give it an ip address
    sudo ifconfig br0 up
    sudo ifconfig br0 10.10.10.99/24
  6. Configure the default route
    sudo route add default gw 10.10.10.254


Here are the steps to reverse the changes (these can be copied and pasted in)
======================================
sudo ifconfig br0 down
sudo brctl delif br0 eth0
sudo brctl delif br0 tap0
sudo brctl delbr br0
sudo tunctl -d tap0
sudo ifconfig eth0 up
sudo ifconfig eth0 10.10.10.99/24
sudo route add default gw 10.10.10.254


Add the following to your /etc/network/interfaces config file if you are using static addressing.
======================================
auto br0
iface br0 inet static
address 10.10.10.99
netmask 255.255.255.0
gateway 10.10.10.254
bridge-ports eth0 tap0
pre-up ifconfig eth0 0.0.0.0 promisc up
pre-up ifconfig tap0 0.0.0.0 promisc up


Add the following to your /etc/network/interfaces config file if you are using dhcp.
======================================
auto br0
iface br0 inet dhcp
bridge-ports eth0 tap0
pre-up ifconfig eth0 0.0.0.0 promisc up
pre-up ifconfig tap0 0.0.0.0 promisc up

No comments:

Post a Comment