iptables overridden by incoming pptp connection

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
d73616
DD-WRT Novice


Joined: 26 Dec 2012
Posts: 15

PostPosted: Wed Dec 26, 2012 16:49    Post subject: iptables overridden by incoming pptp connection Reply with quote
What I'm trying to do, is to prevent incoming pptp connections from accessing internal LAN, so that they can only access to the Internet.

After trying for many hours, it works after a firewall rule is added :

Code:
iptables -I FORWARD 1 -i ppp0 -d 192.168.1.0/24 -j DROP

Everything works as I want (somehow ppp0 is still able to connect to router IP, and to the Internet).

Here is the problem :
After all pptp connections are disconnected for a while, and then a new connection is established, 2 new firewall rules are inserted to ppp0 automatically :

Code:
num   pkts bytes target     prot opt in     out     source               destination         
1      394 33904 ACCEPT     0    --  ppp0   *       0.0.0.0/0            0.0.0.0/0           
2        0     0 TCPMSS     tcp  --  ppp0   *       0.0.0.0/0            0.0.0.0/0           tcp flags:0x06/0x02 TCPMSS clamp to PMTU

These rules override the firewall I've added, and pptp connections can access all LAN IPs.

I've also tried changing my rule to use source IP instead of ppp0, but same problem occurs.

Is there any method to prevent this ?

Thanks.
Sponsor
d73616
DD-WRT Novice


Joined: 26 Dec 2012
Posts: 15

PostPosted: Wed Dec 26, 2012 19:02    Post subject: Reply with quote
Finally found that the rules added automatically by "/tmp/pptpd/ip-up".

Now it seems that a startup script should be what I needed :

1. modify the file "/tmp/pptpd/ip-up"
2. search for lines with "iptables -I FORWARD"
3. add a "#" to remark the lines

But I'm not good in this. Can someone help ?

Thanks.
d73616
DD-WRT Novice


Joined: 26 Dec 2012
Posts: 15

PostPosted: Wed Dec 26, 2012 20:22    Post subject: Reply with quote
Unfortunately, I was wrong. Without the rules added by "/tmp/pptpd/ip-up", incoming pptp connection fails.

Perhaps I should not use "Save Firewall" to add the DROP rule, but add some more rules in "ip-up" directly.

Hope it works this time.
Sash
DD-WRT Guru


Joined: 20 Sep 2006
Posts: 17619
Location: Hesse/Germany

PostPosted: Sat Dec 29, 2012 12:01    Post subject: Reply with quote
just add it to the firewall script!
_________________
Forum Guidelines...How to get help
&
Forum Rules
&
RTFM/STFW
&
Throw some buzzwords into the WIKI search Exclamation
_________________
I'm NOT rude, just offer pure facts!
_________________
Atheros (TP-Link & Clones, etc ) debrick service in EU
_________________
Guide on HowTo be Safe, Secure and Protect Your Online Anonymity!
d73616
DD-WRT Novice


Joined: 26 Dec 2012
Posts: 15

PostPosted: Sat Dec 29, 2012 20:12    Post subject: Reply with quote
Thanks for your reply. But that is what I did in the first place. As I said in the subject, "overridden" by incoming pptp connection.

As expected, adding rules in "/tmp/pptpd/ip-up" solve the problem.

In fact, the original rules added by ip-up allowing pptp clients to connect to any client within LAN, including other pptp clients. There may be security concern. Besides, those rules are in incorrect order that cause MTU issue. And there is also another problem, that the ip-down script is not always working, and therefore creating too many duplicated firewall rules.

Since nobody response to this thread, I simply create a script suitable for purpose. But if there is anyone who wants to :
1. isolate incoming PPTP clients
2. prevent iptables from accumulating repeated rules
3. solve MTU issue (some, but not all, websites cannot be loaded)
Please let me know.
Sash
DD-WRT Guru


Joined: 20 Sep 2006
Posts: 17619
Location: Hesse/Germany

PostPosted: Sun Dec 30, 2012 14:06    Post subject: Reply with quote
you should get familar with the gui.
_________________
Forum Guidelines...How to get help
&
Forum Rules
&
RTFM/STFW
&
Throw some buzzwords into the WIKI search Exclamation
_________________
I'm NOT rude, just offer pure facts!
_________________
Atheros (TP-Link & Clones, etc ) debrick service in EU
_________________
Guide on HowTo be Safe, Secure and Protect Your Online Anonymity!
d73616
DD-WRT Novice


Joined: 26 Dec 2012
Posts: 15

PostPosted: Sun Dec 30, 2012 16:13    Post subject: Reply with quote
Which part of the GUI are you referring to ?
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum