7 # taken from older vif-common.sh
12 domname=$(xm domname $domid)
14 source /etc/default/snf-network
15 source /usr/lib/snf-network/common.sh
16 source $GANETI_NIC_DIR/$domname/$devid
21 FROM=FROM${INTERFACE^^}
25 try clear_routed_setup_ipv4
26 try clear_routed_setup_ipv6
27 try clear_routed_setup_firewall
31 if [ "$MODE" = "routed" ]; then
33 ip link set $INTERFACE up
36 DROPDHCPREQCMD="iptables -A FORWARD -i $INTERFACE -p udp --dport 67 -j DROP"
37 elif [ "$MODE" = "bridged" ]; then
38 ip link set $INTERFACE up
39 BRIDGE=$(xenstore_read_default "$XENBUS_PATH/bridge" "$LINK")
40 brctl addif $BRIDGE $INTERFACE
44 # nfdhcpd creates responses with src mac the mac of indec
45 INDEV_MAC=$(cat /sys/class/net/$INDEV/address)
46 DROPDHCPREQCMD="runlocked $RUNLOCKED_OPTS ebtables -A $FROM -p ipv4 --ip-protocol udp --ip-destination-port 67 -j DROP"
50 for tag in $NETWORK_TAGS; do
55 try routed_setup_firewall
58 # Drop unicast BOOTP/DHCP packets