Share VPN connection in Home network
I have several computers at home network. One of the CentOS machine connect to my office network through Cisco anyconnect VPN client. How can I configure this Linux box to let other computers share this VPN connection?
The CentOS computer has em1 interface and cscotun0 virtual interface when the VPN is connected. I set this machine as the gateway in my other computers. I enabled the ip forwarding and used the following MASQUERADE: "iptable -A POSTROUTING -t nat -s x.x.x.x/24 -o cscotun0 -j MASQUERADE". But it does not work. How do I configure the machine? Thanks for the help. Zack |
Is IPv4 forwarding turned on?
cat /proc/sys/net/ipv4/ip_forward |
Yes.
$ cat /proc/sys/net/ipv4/ip_forward 1 Quote:
|
Does turning off the firewall fix the problem? You might also need something like "iptables -A FORWARD -i eth1" with eth1 being your local network.
|
Firewall is off in my home network machines as firewall is running on DLink router.
Add "iptables -A FORWARD -i em1" does not solve the problem. Quote:
|
Is the VPN the default route?
|
I add the following 2 rules and it is working now.
iptables -I ciscovpn -s 192.168.0.0/24 -o cscotun0 -j ACCEPT iptables -I ciscovpn -d 192.168.0.0/24 -i cscotun0 -j ACCEPT Thanks Quote:
|
All times are GMT -5. The time now is 08:07 PM. |