1# Configuration file for setting IP addresses for a network interface.
2
3INTERFACE="$1"
4
5HWADDR="00:00:5e:00:53:ff"
6
7IPV6_ADDR_1="2001:db8::2"
8IPV6_ROUTE_1="2001:db8::/64"
9
10IPV4_ADDR_1="192.0.2.2/24"
11IPV4_ROUTE_1="192.0.2.0/24"
12
13ip link set dev $INTERFACE up
14
15ip link set dev $INTERFACE address $HWADDR
16
17ip -6 address add $IPV6_ADDR_1 dev $INTERFACE nodad
18ip -6 route add $IPV6_ROUTE_1 dev $INTERFACE
19ip address add $IPV4_ADDR_1 dev $INTERFACE
20ip route add $IPV4_ROUTE_1 dev $INTERFACE > /dev/null 2>&1
21
22if ! iptables -t nat -C POSTROUTING -j MASQUERADE -s $IPV4_ROUTE_1; then
23	iptables -t nat -A POSTROUTING -j MASQUERADE -s $IPV4_ROUTE_1
24fi
25sysctl -w net.ipv4.ip_forward=1
26iptables -P FORWARD ACCEPT
27
28dnsmasq -C dnsmasq_nat.conf -x /var/run/dnsmasq_zeth.pid
29
30