# /etc/init.d/iptables restart</p> <p># vi /etc/xen/vm01
...
vif = [ "vifname=vm01,mac=00:16:3e:7c:1f:6e,ip=172.16.39.105,bridge=xenbr0" ]
...</p> <p># vi /etc/iptables-rules
*filter
:INPUT accept [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
# The antispoofing rules for domUs
-A FORWARD -m state --state RELATED,ESTABLISHED -m physdev --physdev-out vm01 -j ACCEPT
-A FORWARD -p udp -m physdev --physdev-in vm01 -m udp --sport 68 --dport 67 -j ACCEPT
-A FORWARD -s 172.16.39.105/32 -m physdev --physdev-in vm01 -j ACCEPT
-A FORWARD -d 172.16.39.105/32 -m physdev --physdev-out vm01 -j ACCEPT
# If the IP address is not allowed on that vif, log and drop it.
-A FORWARD -m limit --limit 15/min -j LOG --log-prefix "Dropped by firewall: " --log-level 7
-A FORWARD -j DROP
# The access rules for dom0
-A INPUT -j ACCEPT
COMMIT</p> <p># iptables-restore < /etc/iptables.rules