sys03 - network

IP Netmask GW Hostname Comment
78.46.139.5 255.255.255.224 /27 78.46.139.1 sys03.shackspace.de
2a01:4f8:190:5484::2 64 fe80::1 sys03.shackspace.de
2a01:4f8:190:5484::3 ns3.shackspace.de
2a01:4f8:190:5484::4 shackspace.de
2a01:4f8:190:5484::5 lists.shackspace.de
2a01:4f8:190:5484::6 xml.shackspace.de
2a01:4f8:190:5484::7 rescue.shackspace.de
2a01:4f8:190:5484::8 px4.shackspace.de
2a01:4f8:190:5484::9 web01.shackspace.de
2a01:4f8:190:5484::10 web02.shackspace.de
2a01:4f8:190:5484::11 web03.shackspace.de
2a01:4f8:190:5484::12 web04.shackspace.de
2a01:4f8:190:5484::13 web05.shackspace.de
2a01:4f8:190:5484::14 vs01.shackspace.de
2a01:4f8:190:5484::15 vs02.shackspace.de
2a01:4f8:190:5484::16 mail3.shackspace.de
2a01:4f8:190:5484::17 vs03.shackspace.de
2a01:4f8:190:5484::18 web06.shackspace.de

activating kernel bridge

cd /etc/network
cp -ax interfaces interfaces-bak
cat << EOF > interfaces-new
# Loopback device:
auto lo
iface lo inet loopback

# device: br0
auto  br0 
iface br0 inet static
  bridge_ports regex (eth|qtap).*
  # spanning tree
  bridge_stp off
  # seconds for learning -> forwarding
  bridge_fd 2
  bridge_maxwait 0
  address   78.46.139.5
  broadcast 78.46.139.31
  netmask   255.255.255.224
  gateway   78.46.139.1
  # default route to access subnet
  up route add -net 78.46.139.0 netmask 255.255.255.224 gw 78.46.139.1 br0

iface br0 inet6 static
  address 2a01:4f8:190:5484::2
  netmask 64
  gateway fe80::1
EOF

## trial:

cat << END_OF_FILE > /etc/network/switch
#!/bin/bash -xv

export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin

ifdown eth0
cp /etc/network/interfaces-new /etc/network/interfaces
ifup br0

ip a l

sleep 60

ifdown br0
cp /etc/network/interfaces-bak /etc/network/interfaces
ifup eth0

sleep 61
reboot
END_OF_FILE
chmod 755 /etc/network/switch
screen /etc/network/switch

## finally
cat << END_OF_FILE > /etc/network/switch
#!/bin/bash -xv
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin

ifdown eth0
cp /etc/network/interfaces-new /etc/network/interfaces
ifup br0
END_OF_FILE

chmod 755 /etc/network/switch
screen /etc/network/switch

leading to:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 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
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 30:85:a9:ed:00:e3 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::3285:a9ff:feed:e3/64 scope link 
       valid_lft forever preferred_lft forever
4: br0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN 
    link/ether 30:85:a9:ed:00:e3 brd ff:ff:ff:ff:ff:ff
    inet 78.46.139.5/27 brd 78.46.139.31 scope global br0
    inet6 2a01:4f8:190:5484::2/64 scope global 
       valid_lft forever preferred_lft forever
    inet6 fe80::3285:a9ff:feed:e3/64 scope link 
       valid_lft forever preferred_lft forever
project/sys03/network.txt · Zuletzt geändert: 2014/01/17 14:31 von chris