3 # This is an example of a Ganeti kvm ifup script that configures network
4 # interfaces based on the initial deployment of the Okeanos project
6 source /etc/default/snf-network
7 source /usr/lib/snf-network/common.sh
9 FROM=FROM${INTERFACE^^}
12 try clear_routed_setup_ipv4
13 try clear_routed_setup_ipv6
14 try clear_routed_setup_firewall
18 if [ "$MODE" = "routed" ]; then
20 ip link set $INTERFACE addr $TAP_CONSTANT_MAC up
22 # DROPDHCPREQCMD="iptables -A FORWARD -i $INTERFACE -p udp --dport 67 -j DROP"
23 elif [ "$MODE" = "bridged" ]; then
24 ip link set $INTERFACE up
25 brctl addif $BRIDGE $INTERFACE
27 # nfdhcpd creates responses with src mac the mac of indec
28 INDEV_MAC=$(cat /sys/class/net/$INDEV/address)
29 # DROPDHCPREQCMD="runlocked $RUNLOCKED_OPTS ebtables -A $FROM -p ipv4 --ip-protocol udp --ip-destination-port 67 -j DROP"
33 for tag in $NETWORK_TAGS; do
38 try routed_setup_firewall
42 # Drop unicast BOOTP/DHCP packets
56 if [ -x "$IFUP_EXTRA_SCRIPT" ]; then
57 exec $IFUP_EXTRA_SCRIPT "$@"