wg-netns icon indicating copy to clipboard operation
wg-netns copied to clipboard

parse config in ini format

Open milahu opened this issue 2 years ago • 2 comments

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

milahu avatar Aug 06 '22 11:08 milahu

Hey @milahu, should we clean this up and merge?

dadevel avatar Oct 02 '22 16:10 dadevel

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

milahu avatar Oct 02 '22 16:10 milahu