Revision d2b16e51 configure-interfaces

b/configure-interfaces
1 1
#!/bin/bash
2 2

  
3
source /etc/default/snf-network
3
DEFAULT=/etc/default/snf-network
4

  
5
source $DEFAULT
6
source $CONF
7
source $INFRA
4 8

  
5 9
HOSTNAME=$(hostname)
6 10

  
7 11

  
8 12
INTERFACES=$SHAREDDIR/interfaces/$HOSTNAME
9
INFRA=$SHAREDDIR/infra/$HOSTNAME
13
HOSTINFRA=$SHAREDDIR/infra/$HOSTNAME
10 14

  
11
if [ -e $INFRA ]; then
12
  source $INFRA
15
if [ -e "$HOSTINFRA" ]; then
16
  source $HOSTINFRA
13 17
fi
14 18

  
15 19
if [ -e /proc/sys/net/ipv4/conf/$PUBLIC_VLAN  -o \
......
26 30
  exit 1
27 31
fi
28 32

  
33
PUBLIC_MAC=$(ip link show $PUBLIC_INTERFACE | grep link/ether | awk '{print $2}')
34

  
35

  
29 36

  
30 37
cat > $INTERFACES<<EOF
31 38
#auto $PUBLIC_BRIDGE
......
33 40
#  bridge_ports $PUBLIC_INTERFACE
34 41
#  bridge_stp off
35 42
#  bridge_fd 2
43
#  post-up ip link set $PUBLIC_BRIDGE address $PUBLIC_MAC 
36 44

  
37 45
auto $PUBLIC_VLAN
38 46
iface $PUBLIC_VLAN inet manual
......
45 53
  bridge_ports $PRIVATE_VLAN
46 54
  bridge_stp off
47 55
  bridge_fd 2
56
  post-up ip link set $PRIVATE_BRIDGE address $PUBLIC_MAC 
48 57

  
49 58
auto $MASQ_VLAN
50 59
iface $MASQ_VLAN inet manual
......
54 63
  bridge_ports $MASQ_VLAN
55 64
  bridge_stp off
56 65
  bridge_fd 2
66
  post-up ip link set $MASQ_BRIDGE address $PUBLIC_MAC 
57 67
EOF
58 68

  
59 69

  

Also available in: Unified diff