I've been having a problem with NAT on FreeBSD and it's driving me up the wall so I decided to post on the forum!
I've been using ipnat to use my FreeBSD box (xxx.xxx.xxx.133) as a router for OpenVPN and it works albeit REALLY slowly (I'm getting <50KB/s downloading a file over HTTP on the VPN).
My initial thoughts were that it's OpenVPN's fault but I noticed when using tun0 IP (10.8.0.1) of the server on the VPN (and therefore no-NAT) the speed is just a normal VPN speed. I then went on to test another server on the same public subnet as the VPN server by accident (xxx.xxx.xxx.159) and that worked just as well, at a good speed too!
The problem only comes when accessing sites on a different subnet (for example
74.125.230.248) through the router on the network (xxx.xxx.xxx.129), I then get awful speeds.
I'm not sure what the problem is. In addition to ipnat I've tried natd with IPFW with the same result, perhaps even worse but that might just be me. Also, the VPN server's connection is not the problem (accessing the same things directly on the server is fine).
Any ideas what could be causing my problem?
Thanks!
/etc/rc.conf
/etc/ipnat.rules
I've been using ipnat to use my FreeBSD box (xxx.xxx.xxx.133) as a router for OpenVPN and it works albeit REALLY slowly (I'm getting <50KB/s downloading a file over HTTP on the VPN).
My initial thoughts were that it's OpenVPN's fault but I noticed when using tun0 IP (10.8.0.1) of the server on the VPN (and therefore no-NAT) the speed is just a normal VPN speed. I then went on to test another server on the same public subnet as the VPN server by accident (xxx.xxx.xxx.159) and that worked just as well, at a good speed too!
The problem only comes when accessing sites on a different subnet (for example
74.125.230.248) through the router on the network (xxx.xxx.xxx.129), I then get awful speeds.
I'm not sure what the problem is. In addition to ipnat I've tried natd with IPFW with the same result, perhaps even worse but that might just be me. Also, the VPN server's connection is not the problem (accessing the same things directly on the server is fine).
Any ideas what could be causing my problem?
Thanks!
/etc/rc.conf
Code:
gateway_enable="YES"
ipnat_enable="YES"
ipnat_rules="/etc/ipnat.rules"
/etc/ipnat.rules
Code:
map vtnet0 10.8.0.0/16 -> xxx.xxx.xxx.133/32 portmap tcp/udp 1025:65000
map vtnet0 10.8.0.0/16 -> xxx.xxx.xxx.133/32