Hey, thanks for your script. Maybe add a command to enable IP-forwarding.
My problem is to make the web-ui available on 192.168.1.0/24 (local network). Can you give me some iptables-rules or point me in the right direction?
Hi, sorry for the late response. Actually changing the last line:
socat tcp-listen:$PORT,reuseaddr,fork,range=127.0.0.1/32 tcp-connect:10.100.0.2:$PORT &to
socat tcp-listen:$PORT,reuseaddr,fork,range=192.168.1.0/24 tcp-connect:10.100.0.2:$PORT &should be sufficient as long iptables allows $PORT.
In the past I used nginx to proxy to localhost, this was on a remote machine. Meanwhile I switched to rtorrent and Flood/rutorrent. Since rtorrent does the socket stuff out of the box I don't need the last line anymore.
Yes!! Thanks, works perfectly.
Thank you for the script. I encountered a problem, after some time (around 6-8 hours) DNS stopped resolving in netns vpn, after reboot of my Ubuntu Server 20.04 it works fine again. Where do you think a problem can be?
Where do you think a problem can be?
no idea but maybe we will find out. When this happens what is about other dns-servers? you can test in with:
ip netns exec vpn drill gitlab.com @184.108.40.206 ip netns exec vpn drill gitlab.com @220.127.116.11
If a DNS server is provided by the wireguard config file, comment out the following lines to use the VPN-providers DNS.
#mkdir -p /etc/netns/vpn #echo "nameserver 18.104.22.168" > /etc/netns/vpn/resolv.conf #echo "nameserver 22.214.171.124" >> /etc/netns/vpn/resolv.conf
some dns-servers may block traffic from VPN endpoints because of DNS amplification attacks
Thanks. I ran some tests and got myself even more confused. My wireguard conf provides DNS and i commented out creation of resolv.conf before. Command
ip netns exec vpn dig gitlab.com @126.96.36.199works fine, but in the same time qBittorrent instantly says "Not working" for every tracker which require name resolution and not just straigth IP, but after reboot it starts working again. I will try and launch qbittorrent regularly without vpn, netns and see what is going to happend.