0

My office (office_network) uses PPTP VPN for remote employees. And it was OK before macOS Catalina release. Macos doesn't support PPTP anymore at all.

So, to get access to office_network network I decided to setup "vpn tunel" on my Ubuntu server (ubuntu).

  • I've installed PPTP client on ubuntu and connected to office_network
  • I've installed openVPN server on ubuntu and also client on my macbook (macbook) and successfully connected (ubuntu <-> macbook). I can go to the internet via ubuntu

But I still can't get access to office_network from macbook.

ifconfig from ubuntu:

root@server:/etc/openvpn# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet X.Y.244.154  netmask 255.255.255.0  broadcast X.Y.244.255
        inet6 ....  prefixlen 64  scopeid 0x0<global>
        inet6 ....  prefixlen 64  scopeid 0x20<link>
        ether ....  txqueuelen 1000  (Ethernet)
        RX packets 8115596  bytes 1387222400 (1.3 GB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 10933097  bytes 2330386079 (2.3 GB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 132556  bytes 90634105 (90.6 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 132556  bytes 90634105 (90.6 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

ppp0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>  mtu 1492
        inet 10.10.10.2  netmask 255.255.255.255  destination 10.10.10.1
        ppp  txqueuelen 3  (Point-to-Point Protocol)
        RX packets 102  bytes 115715 (115.7 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 94  bytes 9170 (9.1 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

tun0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>  mtu 1500
        inet 10.8.0.1  netmask 255.255.255.0  destination 10.8.0.1
        inet6 ....  prefixlen 64  scopeid 0x20<link>
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 100  (UNSPEC)
        RX packets 29916  bytes 6166802 (6.1 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 126423  bytes 156305569 (156.3 MB)
        TX errors 0  dropped 4791 overruns 0  carrier 0  collisions 0

ppp0 - it's pptp interface. tun0 - openvpn server

Actually I need access only to one subnet from office_network, so I've added a route

ip route add 10.80.16.0/24 dev ppp0

As result I can get access to 10.80.16.X from ubuntu, but not from macbook.

Also traceroute from macbook:

Success to google:

➜  ~ traceroute google.com
traceroute to google.com (172.217.169.46), 64 hops max, 52 byte packets
 1  10.8.0.1 (10.8.0.1)  48.696 ms  45.363 ms  48.516 ms
 2  router2-lon.hosting-server.com (X.Y.33.230)  46.275 ms  49.215 ms  49.843 ms
 3  109.74.207.20 (109.74.207.20)  46.062 ms  48.806 ms  45.548 ms
 ...

Failed to office_network

➜  ~ traceroute 10.80.16.14
traceroute to 10.80.16.14 (10.80.16.14), 64 hops max, 52 byte packets
 1  10.8.0.1 (10.8.0.1)  47.852 ms  48.493 ms  64.061 ms
 2  * * *
 3  * * *
 ......

Finally I've tried to add NAT rule like:

iptables -t nat -A POSTROUTING -s 10.80.16.0/24 -j MASQUERADE

But it also doesn't help.

What did I forget?

0

Add this route to NAT table:

iptables -t nat -I POSTROUTING -o ppp0 -s 10.8.0.0/24 -j MASQUERADE

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.