4 # https://unix.stackexchange.com/questions/149293/feed-all-traffic-through-openvpn-for-a-specific-network-namespace-only
9 ip netns
exec 0tdns ip link
set dev lo up
10 ip link
set dev
"$1" up netns
0tdns mtu
"$2"
11 ip netns
exec 0tdns ip addr add dev
"$1" \
12 "$4/${ifconfig_netmask:-30}" \
13 ${ifconfig_broadcast:+broadcast "$ifconfig_broadcast"}
14 if [ -n "$ifconfig_ipv6_local" ]; then
15 ip netns
exec 0tdns ip addr add dev
"$1" \
16 "$ifconfig_ipv6_local"/112
20 ip netns
exec 0tdns ip route add default via
"$ifconfig_remote"
22 if [ -n "$ifconfig_ipv6_remote" ]; then
23 ip netns
exec 0tdns ip route add default via \
24 "$ifconfig_ipv6_remote"
27 # notify our sh process, that openvpn finished initializing
28 kill -usr1 `cat /var/lib/0tdns/shell_pid`
30 # we no longer need this connection