wg-netns
wg-netns copied to clipboard
parse config in ini format
fix #3
i tried to use this from my python-piavpn
using wg-netns
as a drop-in replacement for wg-quick
... but DNS is broken
sudo ./piavpn.py -c /etc/piavpn.config.yaml
...
exec: sudo ip netns exec pia curl --no-progress-meter 'https://api64.ipify.org?format=json'
curl: (7) Couldn't connect to server
sudo cat /etc/netns/pia/resolv.conf
nameserver 10.0.0.243
ip netns list
pia (id: 0)
the DNS server is reachable only over VPN the second ping should work:
ping 10.0.0.243
PING 10.0.0.243 (10.0.0.243) 56(84) bytes of data.
From 62.155.242.79 icmp_seq=1 Destination Net Unreachable
sudo ip netns exec pia ping 10.0.0.243
ping: connect: Network is unreachable
Hey @milahu, should we clean this up and merge?
sorry, no time ...
wg-quick and wg-netns use different config structs internally so this "import config" logic is complex and ugly
ideally wg-netns would use the same internal config struct as wg-quick
also, the proposed ini parser fails to parse repeated keys https://stackoverflow.com/questions/15848674/how-to-configparse-a-file-keeping-multiple-values-for-identical-keys