Hello, I need some help with configuring openvpn connection inside a network namespace.
I've got my VM running on Ubuntu Server 16.04, got a few namespaces with openvpn in it, connected to my openvpn servers in datacenter.
What I want is to setup additional netns with Windscribe openvpn in it. My trouble is that I can't control which IP adress I will get from windscribe openvpn server, so I can't create script for it, like I did with my servers from which I get the same IPs every time.
Is there a way to automaticly get ip and gateway from the server after I move openvpn tun interface inside netns?
OpenVPN and Network Namespaces
Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech
-
- OpenVpn Newbie
- Posts: 6
- Joined: Wed Mar 23, 2016 2:55 pm
-
- OpenVPN Protagonist
- Posts: 11137
- Joined: Fri Jun 03, 2016 1:17 pm
Re: OpenVPN and Network Namespaces
Which IP and gateway ?fullbring3r wrote: ↑Thu Oct 26, 2017 1:57 pmIs there a way to automaticly get ip and gateway from the server after I move openvpn tun interface inside netns?
-
- OpenVpn Newbie
- Posts: 6
- Joined: Wed Mar 23, 2016 2:55 pm
Re: OpenVPN and Network Namespaces
I've got this when I connect to windscibe server normally -
And this after I link tun20 to netns.
Usually I assign ip and gateway manually for tun interface since I know that it would remain the same, but I can't to it with windscribe vpn.
My netns script for connection to my vpn servers -
Code: Select all
tun20 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.110.222.57 P-t-P:10.110.222.57 Mask:255.255.254.0
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:2 errors:0 dropped:0 overruns:0 frame:0
TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:204 (204.0 B) TX bytes:1137 (1.1 KB)
Code: Select all
tun20 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:11155 errors:0 dropped:3 overruns:0 frame:0
TX packets:12139 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:2497117 (2.4 MB) TX bytes:1450358 (1.4 MB)
My netns script for connection to my vpn servers -
Code: Select all
ip netns add ns1
ip link add vns1a type veth peer name vns1b
ip link set vns1b netns ns1
ip netns exec ns1 ifconfig vns1b 10.1.1.1/24 up
ifconfig vns1a 10.1.1.2/24 up
ip link set tun10 netns ns1
ip netns exec ns1 ip link set tun10 up
ip netns exec ns1 ip addr add 10.11.0.6/24 dev tun10
ip netns exec ns1 ip route add default via 10.11.0.5