Hello great community of FreeBSD,
Recently I have moved to FreeBSD and am loving it. I have this server at home that is connected to the internet through a router:
When I establish a VPN connection on this server, I am no longer able to access the services (such as ZNC) through the public IP anymore. The reason is obvious and there are a few solutions for GNU/Linux:
ssh into a server which is connected to a VPN service
I wonder how I can achieve the same on my FreeBSD machine.
TLDR
More on my configuration: On this server, I have some programs accessing the internet through my public IP and some other through a VPN server:
I have achieved this by:
Now, I can access my ZNC bouncer from my local network and indeed it connects to other IRC servers using the VPN. However, if I am outside the local network (say at work), I cannot access the ZNC. Obviously I have configured the home router to port-forward to ZNC. That setup is fine. In other words, if ZNC is run without VPN then I am able to access it from outside network.
Last but not least, I am using FreeBSD 11.2-RELEASE-p7
Thank you in advance for taking the time to read this.
Recently I have moved to FreeBSD and am loving it. I have this server at home that is connected to the internet through a router:
Code:
,----------------. ,-------------.
| FreeBSD server | < ----- local net ----- > | Home Router | ..... public IP
`----------------' `-------------'
ssh into a server which is connected to a VPN service
I wonder how I can achieve the same on my FreeBSD machine.
TLDR
More on my configuration: On this server, I have some programs accessing the internet through my public IP and some other through a VPN server:
Code:
,----------------.
| FreeBSD server |
| |
openvpn server <----|-prog1 prog2-|----> public ip
`----------------'
Code:
echo "net.fibs=2" >> /boot/loader.conf
reboot
# the IPs below are fictitious
route add -host 192.168.1.15 -iface lo0 -fib1 # server's local IP
route add default 192.168.1.1 -fib 1 # home router IP
setfib 1 openvpn-client /path/to/udp.conf
# reutrns my home router's public IP
curl ifconfig.co
# returns the VPN IP address
setfib 1 curl ifconfig.co
# the actuall service I am interested in
setfib 1 /usr/local/etc/rc.d/znc start
Now, I can access my ZNC bouncer from my local network and indeed it connects to other IRC servers using the VPN. However, if I am outside the local network (say at work), I cannot access the ZNC. Obviously I have configured the home router to port-forward to ZNC. That setup is fine. In other words, if ZNC is run without VPN then I am able to access it from outside network.
Last but not least, I am using FreeBSD 11.2-RELEASE-p7
Thank you in advance for taking the time to read this.