LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Iptables and PPTP VPN filtering? (https://www.linuxquestions.org/questions/linux-networking-3/iptables-and-pptp-vpn-filtering-878699/)

heavydb 05-04-2011 12:46 AM

Iptables and PPTP VPN filtering?
 
Hello everyone~

I have a question regarding the use of iptables as sort of a firewall I suppose? Using a linux router which has a server machine connected to it. The router is also acting as a PPTP VPN server, which I would like to allow some friends to connect to so that they can VPN to my LAN.

The question I have is how I might be able to use iptables to apply restrictions to the VPN traffic to only access 1 IP? The server is on the LAN with an IP of lets say 192.168.1.25, and the VPN given IP range is 192.168.1.51-55. The router has the .1 IP, but the PPTP server on that router uses an IP of 192.168.1.50. How might I restrict the traffic from the VPN connections to only be able to access the .25 server, and possibly only on certain ports? I don't want to allow the VPN connections full access to everything on the LAN and especially not to WAN.

Is this possible to do? Thank you for any assistance~

prasanta 05-06-2011 02:31 AM

Quote:

The question I have is how I might be able to use iptables to apply restrictions to the VPN traffic to only access 1 IP? The server is on the LAN with an IP of lets say 192.168.1.25, and the VPN given IP range is 192.168.1.51-55. The router has the .1 IP, but the PPTP server on that router uses an IP of 192.168.1.50. How might I restrict the traffic from the VPN connections to only be able to access the .25 server, and possibly only on certain ports? I don't want to allow the VPN connections full access to everything on the LAN and especially not to WAN.
/sbin/iptables -I FORWARD -s 192.168.1.50 -d 192.168.1.25 -j ACCEPT

I hope this helps.

Regards,

--
Prasanta


All times are GMT -5. The time now is 10:41 PM.