#!/bin/sh

# Static network setup. In fact, this is official way for ArchLinux.

LANETH=enp3s0
BRD=br0
LANIP=10.1.5.11
LANPREFIX=${LANIP}/24
LANGW=10.1.5.2
# Samba AD DC
LANDNS=10.1.5.201
LANMTU=1500

# LAN connectivity
ip link set mtu ${LANMTU} dev ${LANETH}
ip link set up dev ${LANETH}
brctl addbr ${BRD}
brctl addif ${BRD} ${LANETH}
ip link set mtu 1500 dev ${BRD}
ip link set up dev ${BRD}
ip addr add ${LANPREFIX} dev ${BRD}
ip route add default via ${LANGW}

echo "search kkatarn.ru ckpmgsu.ru" > /etc/resolv.conf
echo "nameserver ${LANDNS}" >> /etc/resolv.conf

# Firewall
iptables -F
iptables -X
# iptables -t nat -A POSTROUTING -o ${TUN} -j MASQUERADE
# iptables -t filter -A PREROUTING -i ${WANETH} ...
