LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 01-20-2012, 11:05 PM   #1
zzy
LQ Newbie
 
Registered: Jan 2012
Posts: 4

Rep: Reputation: Disabled
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
 
Old 01-20-2012, 11:35 PM   #2
eeekster
Member
 
Registered: Oct 2011
Posts: 158

Rep: Reputation: Disabled
Is IPv4 forwarding turned on?

cat /proc/sys/net/ipv4/ip_forward
 
Old 01-20-2012, 11:44 PM   #3
zzy
LQ Newbie
 
Registered: Jan 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
Yes.

$ cat /proc/sys/net/ipv4/ip_forward
1


Quote:
Originally Posted by eeekster View Post
Is IPv4 forwarding turned on?

cat /proc/sys/net/ipv4/ip_forward
 
Old 01-20-2012, 11:55 PM   #4
eeekster
Member
 
Registered: Oct 2011
Posts: 158

Rep: Reputation: Disabled
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.
 
Old 01-22-2012, 10:26 AM   #5
zzy
LQ Newbie
 
Registered: Jan 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
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:
Originally Posted by eeekster View Post
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.
 
Old 01-22-2012, 11:55 AM   #6
eeekster
Member
 
Registered: Oct 2011
Posts: 158

Rep: Reputation: Disabled
Is the VPN the default route?
 
Old 01-25-2012, 10:50 PM   #7
zzy
LQ Newbie
 
Registered: Jan 2012
Posts: 4

Original Poster
Rep: Reputation: Disabled
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:
Originally Posted by eeekster View Post
Is the VPN the default route?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Share VPN Internet Connection davidolaj Linux - Networking 1 05-29-2009 01:33 AM
Relocating user home directories to a network share... gerhardb Linux - General 1 09-14-2006 08:19 AM
PPTP VPN remote connection from home powah Linux - Networking 0 05-02-2005 10:10 PM
VPN to company over Wireless home network rgeelen Linux - Wireless Networking 1 05-20-2004 11:08 AM
Share VPN connection eplegutt Linux - Networking 0 02-18-2004 06:27 PM


All times are GMT -5. The time now is 02:56 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration