This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

PPTP Access on both NICs possible

Hi,
i have some problems with ASL4 and PPTP Road Warrior Access. This is my configuration.

1. NIC 192.168.130.1 (Ethernet Name: vpn)
2. NIC 10.0.10.1 (Ethernet Name: wlan)

wlan client (10.0.10.5) ----->wlan AP (10.0.10.2)----->NIC1(10.0.10.1)PPTP Access (Road Warrior)----->NIC2(192.168.130.254)------>Internet Router(192.168.130.254)---->Internet

This configuration works fine but it is also posible to connect to 192.168.130.1 via PPTP and get access to the internet. 

My Packet Rules:

PPTP Any vpn_Network Allow
Any Any wlan_Network Drop
Any Any vpn_Network Drop

If i scan the 192.168.130.1 the following ports are avaible:
https (443) ok i can disable Webmin on vpn_Network
pptp (1723) in this case i can not disable PPTP Access on vpn_Network and the Packet Rules have no effect


thanks for help

laslo


This thread was automatically locked due to age.
Parents
  • The PPTP configuration creates its own packet filter rules that are invisible in the packet filter page. They reside in the AUTO_INPUT chain generated by ASL. These AUTO_INPUT rules are processed before the USER_INPUT rules and therefore take precedence. You could do it from the command line.
    as root...
    iptables -L -n --line-numbers | grep 1723
    It will look something like this...
    12   ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0          tcp spts:1024:65535 dpt:1723
    you could also dump it to a file with this...
    iptables -L -n --line-numbers | grep 1723 > rules.txt
    then do...
    iptables -R AUTO_INPUT 12
    then do...
    iptables -I AUTO_INPUT 12 -p tcp -i eth0 -s 0.0.0.0/0 --sport 1024:65535 -d 0.0.0.0/0 --dport 1723 -j ALLOW
    where eth0 is the interface on which you want to accept PPTP traffic.
    This should remove the rule #12 identified as the PPTP rule. The rules will resort themselves so 13 will become 12 etc. The you want to insert a rule in the 12 position that is the same as the original one with the addition of an interface specification. In my example I used eth0. Could someone help me out if this is off by a little.

    This could be automated with a script that loads the first 2 characters of the returned string into a variable and inserts the rule using the variable substitution.
Reply
  • The PPTP configuration creates its own packet filter rules that are invisible in the packet filter page. They reside in the AUTO_INPUT chain generated by ASL. These AUTO_INPUT rules are processed before the USER_INPUT rules and therefore take precedence. You could do it from the command line.
    as root...
    iptables -L -n --line-numbers | grep 1723
    It will look something like this...
    12   ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0          tcp spts:1024:65535 dpt:1723
    you could also dump it to a file with this...
    iptables -L -n --line-numbers | grep 1723 > rules.txt
    then do...
    iptables -R AUTO_INPUT 12
    then do...
    iptables -I AUTO_INPUT 12 -p tcp -i eth0 -s 0.0.0.0/0 --sport 1024:65535 -d 0.0.0.0/0 --dport 1723 -j ALLOW
    where eth0 is the interface on which you want to accept PPTP traffic.
    This should remove the rule #12 identified as the PPTP rule. The rules will resort themselves so 13 will become 12 etc. The you want to insert a rule in the 12 position that is the same as the original one with the addition of an interface specification. In my example I used eth0. Could someone help me out if this is off by a little.

    This could be automated with a script that loads the first 2 characters of the returned string into a variable and inserts the rule using the variable substitution.
Children
  • If the rule is correct,
    try this as a script...

    #!/bin/sh

    rownum=`iptables -L -n --line-numbers | grep 1723`

    iptables -R AUTO_INPUT $rownum
    iptables -I AUTO_INPUT $rownum -p tcp -i eth0 -s 0.0.0.0/0 --sport 1024:65535 -d 0.0.0.0/0 --dport 1723 -j ALLOW

    You'll have to run it after every chnage made to the PPTP GUI settings since the middleware will over write these changes. It would just be easier if the PPTP roadwarrior set up had an interface setting.

    I haven't tested ANY of this. If it doens't work, just restart the middleware and it should be OK. if not reboot the firewall.
    /etc/init.d/mdw restart
  • Hi Jim M.,
    first of all thanks for help i try out your explanations:

    iptables -L -n --line-numbers | grep 1723

    3 ACCEPT tcp -- 0.0.0.0/0 0.0.0.0/0 tcp spts:1024:65535 dpt:1723
    ---------------------------------------------------------------------------
    iptables -R AUTO_INPUT 12

    iptables: Index of replacement too big
    ---------------------------------------------------------------------------
    iptables -I AUTO_INPUT 12 -p tcp -i eth0 -s 0.0.0.0/0 --sport 1024:65535 -d 0.0.0.0/0 --dport 1723 -j ALLOW

    iptables v1.2.8: Couldn´t load target "ALLOW" :/usr/local/lib/iptables/libipt_ALLL.so: cannot open shared object file: No such file or directory
    ---------------------------------------------------------------------------
    So i try out this

    iptables -R AUTO_INPUT 3 (without any errors)

    then...

    iptables -I AUTO_INPUT 3 -p tcp -i eth0 -s 0.0.0.0/0 --sport 1024:65535 -d 0.0.0.0/0 --dport 1723 -j ALLOW

    iptables v1.2.8: Couldn´t load target "ALLOW" :/usr/local/lib/iptables/libipt_ALLL.so: cannot open shared object file: No such file or directory
    ---------------------------------------------------------------------------

    i have no sense whats wrong.....

    I there some configuration on webmin needed?

    thanks for reply

    laslo
  • Hi Jim,
    i try out this commend line:

    iptables -I AUTO_INPUT 3 -p tcp -i eth0 -s 0.0.0.0/0 --sport 1024:65535 -d 0.0.0.0/0 --dport 1723 -j ACCEPT

    and it works fine thank you!

    But i have some problems with the script. How to run it on every start. 

    bye&thanks

    laslo
  • Damn. I missed that. ACCEPT not ALLOW. Oops! Sorry.
    Let me know how it works.
    to run on startup. try...

    rename it pptp_if and make it executable.
    chmod 744 pptp_if
    put it in the /etc/init.d directory
    create a link to it in the /etc/init.d/rc3.d directory and name it S99pptp_if.

    Or edit the /etc/init.d/beeps file
    add this line at the bottom of the "case "$1" in
            (start)"
    section.

    /etc/init.d/pptp_itf

    This will execute the script during the beeps part of the startup.
    Have someone look at the script before you actually run it.
    I haven't had a chance to test it.
  • I made another mistake in the above script. It should read...


    #!/bin/sh

    rowstr=`iptables -L -n --line-numbers | grep 1723`

    rownum=${rowstr:0:2}

    iptables -R AUTO_INPUT $rownum
    iptables -I AUTO_INPUT $rownum -p tcp -i eth0 -s 0.0.0.0/0 --sport 1024:65535 -d 0.0.0.0/0 --dport 1723 -j ACCEPT


    I'll be trying this same thing once I figure out how to get L2TP working.
    I want to use the PPTP roadwarrior for WLAN authentication ONLY on my WLAN interface and use L2TP for external VPN access.
  • i  try out the above script and got the following errors:

    iptables v1.2.8: Invalid rule number 'ip'
    Try 'iptables -h' or .......
    iptables v1.2.8: Invalid rule number 'ip'
    Try 'iptables -h' or .......

    For a couple of months  i also try out PPTP Access on WLAN Interface but i´ve got some problems with the WLAN interface Card he restarted on after every PPTP Access.
    ASL V.3.8


    bye&thanks

    laslo
  • What't the result of this command?
    echo iptables -L -n --line-numbers | grep 1723

    Also, try this...
     
    #!/bin/sh 

    rowstr=`iptables -L -n --line-numbers | grep 1723` 

    rownum=${rowstr:0:2} 

    echo rowstr
    echo rownum 


    I don't have any access to my firewall right now to try these out. I'm just winging it I guess. If anyone else has any input, please chime in.
  • Sorry for me late reply but have to work...

    when try our script out the following results are shown be the system:

    iptables -L -n --line-numbers | grep 1723
    ip

    I think there is something in the syntax


    thanks&bye

    laslo
  • Are you sure you're using the back tics around the iptables command. Those aren't single quotes.
  • Sorry but i  not get this script working. I try to write it with the text editor joe but it not works. I Can not write `these back tics`

    Thanks

    laslo [:S]