![]() |
|
|||
![]()
So i've been working for past couple hours to get pf to forward to webserver on internal net,but no luck. I can nmap and get an open port from remote location but if i try to enter ip it just sits there for quite a while. I've read the debugging guide and still having trouble. I run tcpdump on both ext and int and they both show the packets on both passing though, so i guess the pf in is working but no out maybe??? Anyways heres my pf.conf any help would be great as there might be a whole pile hair under my chair by the time i figure this out.
ext_if="em0" int_if="re0" wifi_if="ral0" local_net="{192.168.0.1/24, 192.168.1.1/24}" server="{ 192.168.0.10 }" icmp_types="echoreq" tcp_flags="flags S/SA keep state" table <abusers> persist set require-order no set skip on lo scrub in all nat on $ext_if from !($ext_if) -> ($ext_if:0) rdr pass on $ext_if proto { tcp udp } from any to any port 80 -> $server port 80 block drop all block in quick from <abusers> pass out on $ext_if proto tcp all flags S/SA keep state pass out on $ext_if proto { udp,icmp } all keep state pass in quick inet proto icmp all icmp-type $icmp_types keep state pass in quick on $ext_if proto { tcp udp } from any to $server port 80 flags S/SA synpro$ pass in quick on $wifi_if proto tcp to ($wifi_if) port ssh $tcp_flags (max-src-conn 8, m$ pass quick on { lo, $int_if, $wifi_if } antispoof quick for { lo, $int_if, $ext_if, $wifi_if } |
|
||||
![]()
Your pf.conf was damaged when you copied and pasted. Note your "synproxy" got cut, as well as what appears to possibly have been a "modulate state". Next time, copy and paste plain text between [ code ] [ /code ] tags.
I'll guess, for two solutions: 1) You have no pass out for your internal network(s). Remember, PF doesn't know which of your interfaces connect to the Internet. It just knows interfaces, and the direction of traffic. The "rdr pass" only passes the incoming packets, you still need a pass rule for the outgoing packets on your local LANs. 2) If you have not already confirmed it, make sure you have enabled IPv4 packet forwarding in /etc/sysctl.conf. Robbak is right: put "log" on every blocking filter rule, and use tcpdump.. You might also consider logging all pass rules, too. To watch for blocked traffic, use something like: # tcpdump -neti pflog0 action block |
|
|||
![]()
Ok, "tcpdump -neti pflog0 action pass" shows my connection from remote location, but nothing under block. Which is good?? I have no other problems passing out data with my current config.
Code:
ext_if="em0" int_if="re0" wifi_if="ral0" server="{ 192.168.0.10 }" icmp_types="echoreq" tcp_flags="flags S/SA keep state" table <abusers> persist set require-order no set skip on lo scrub in all nat on $ext_if from !($ext_if) -> ($ext_if:0) rdr pass on $ext_if proto { tcp udp } from any to any port 80 -> $server port 80 block drop all block in quick from <abusers> pass out on $ext_if proto tcp flags S/SA keep state pass out on $ext_if proto { udp,icmp } keep state pass in quick inet proto icmp all icmp-type $icmp_types keep state pass in quick on $ext_if proto { tcp udp } from any to $server port 80 flags S/SA synproxy state pass in quick on $wifi_if proto tcp to ($wifi_if) port ssh $tcp_flags (max-src-conn 8, max-src-conn-rate 15/5, overload <abusers> flush global) pass quick on { lo, $int_if, $wifi_if } antispoof quick for { lo, $int_if, $ext_if, $wifi_if } |
|
||||
![]()
You haven't set logging on any rules yet, so you won't see anything on pflog.
At the least, set logging on the block rules like this: Code:
block drop log all block in log quick from <abusers> Unless you are handling gigabytes per second through your firewall, you should always log blocked packets
__________________
The only dumb question is a question not asked. The only dumb answer is an answer not given. |
|
|||
![]()
i just reposted the pf.conf that got cut earlier my pf.conf is logged. the www traffic isn't being blocked. I tcpdump -neti pflog0 action rdr and i can see the traffic
|
|
||||
![]()
OK, you can see it hitting the rdr rule, but that 'action rdr" will stop you seeing if the traffic is hitting the block rules.
If that is your pf.conf posted above then you have no log statements anywhere. As far as i am aware, tcpdum pflog should show nothing.
__________________
The only dumb question is a question not asked. The only dumb answer is an answer not given. |
|
|||
![]()
well i don't have the time, patience, or hair to be trying to figure this out, i was hoping for more help, but got none. I have a new cable connection being installed next week and imma just run web server from that connection, that way i dont have to waste my time. BTW like i said i didnt post my updated pf.conf thats shows i have log put in every rule.
|
|
||||
![]() Quote:
Allow me to refer to you to the misc@ mailing list. The OpenBSD community here is relatively tiny in comparison. Last edited by jggimi; 9th July 2009 at 03:50 AM. |
|
|||
![]()
i'm not here to become an expert and i know you dont have to help me. I've tried the best to my ability to resolve this issue, which i cant. I've read many online texts and have read the PF man many times. I figure seeing as how many of you are sitting on the answer to my issue, i didn't realize that anyone had a issue with helping someone with less knowledge. Like i said i'm not trying to become an expert, i have better things to do with my time, i just wanted a lil more help than these cryptic answers. I really thought this forum was better than this elitist attitude i got.
|
|
|||
![]()
I don't understand why you are too lazy to post your updated pf.conf. I you want people to help you, you should help those people
![]() The following two rules are enough to redirect ssh traffic. Code:
EXT_IF = bge0 set skip on lo0 rdr on $EXT_IF inet proto tcp from any to any port 55555 tag SSH -> 192.168.222.11 port 22 # default policy block log all pass in quick on $EXT_IF tagged SSH
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
|
|||
![]()
I don't understand why so many people who are new to OpenBSD/pf create(..copy&paste) unimaginably complex rulesets without first confirming they work in their specific setup.
You should always start simple, which will be beneficial.. especially if you're just learning. Please don't insult people birdman, if you're just going to criticize support from volunteers.. there are other less social ways to learn about pf, I managed to create my first ruleset by reading the man pages, the pf FAQ.. and Peter's tutorial. |
|
||||
![]() Quote:
Quote:
A post by Nick Holland on misc@ just a couple of hours ago, to another user who also had unmet expectations, is apropos. Nick said to him: Quote:
Last edited by jggimi; 9th July 2009 at 12:39 PM. |
|
||||
![]()
And, while you may have given up, a user on misc@ just reported that his redirection problem was due to using synproxy. Yours might be, also.
His post: http://marc.info/?l=openbsd-misc&m=124715215831478&w=2 Thread start: http://marc.info/?l=openbsd-misc&m=124700148528406&w=2 That resolution makes some sense, because http://openbsd.rt.fm/faq/pf/rdr.html says: Quote:
|
|
|||||
![]() Quote:
Quote:
Quote:
rdr pass on $ext_if proto { tcp udp } from any to any port 80 -> $server port 80 pass in log quick on $ext_if proto { tcp udp } from any to $server port 80 flags S/SA the original pf.conf i created was from reading the pf man pages. Isn't "pass in log quick on $ext_if proto { tcp udp } from any to $server port 80 flags S/SA" a dedicated pass rule???? Also i apologise for my attitude this has made me really pissy past day. Anyways heres my pf.conf WITH log put in there for some of you. Quote:
Quote:
|
|
|||
![]()
You mention that it was a large message which probably means that you had spent some amount of time to construct it. vBulletin (the forum software used here...), will drop connections which lie dormant for some amount of time. I don't know what is the exact amount of time which times out connections, but you can save your work going back one page (typically with the Back button...), followed by cutting & pasting into yet another new message.
|
|
|||
![]()
yeh tried again and apparently all my posts have to be monitored by an admin now. Though it seems quick reply works.
|
|
||||
![]()
Problem was the spam filter -- False positive.
The first ten posts of new users are scanned for spam. It seems to dislike message with significant code/config files/shell examples and markes those as spam ... In any case, your post is displayed now.
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. |
|
||||
![]()
I believe you have two problems. #1:
Quote:
#2: Quote:
However, the redirected traffic needs its own pass rule. That's because you are running NAT, which changes the destination address from your IP address on the Internet to 192.168.0.10. I would add a rule something like: Quote:
|
|
||||
![]()
On second thought, and another review of your pf.conf .... #2 may not be necessary, as you have
Quote:
If your problem isn't isolated and resolved by someone else today, I will recreate your environment and test your specific pf.conf tonite (US EDT). |
![]() |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
back-sql - SQLConnect() failed | vol_o3 | OpenBSD General | 0 | 9th September 2009 09:36 AM |
pfstat fopen failed: ? | Calderon | FreeBSD General | 3 | 7th May 2009 08:52 AM |
phpPgAdmin login failed | gosha | General software and network | 14 | 17th March 2009 11:49 PM |
Communication with su failed | amandus | OpenBSD Packages and Ports | 7 | 17th July 2008 07:17 AM |
Failed Installs | dctr | OpenBSD Installation and Upgrading | 23 | 4th June 2008 04:25 AM |