Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parse config in ini format #5

Closed
wants to merge 2 commits into from
Closed

Conversation

milahu
Copy link

@milahu milahu commented Aug 6, 2022

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

@dadevel
Copy link
Owner

dadevel commented Oct 2, 2022

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

@milahu
Copy link
Author

milahu commented Oct 2, 2022

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

@dadevel dadevel closed this Mar 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for using Wireguard config files
2 participants