Hey everyone.
Running 8.0-RELEASE here. I am trying to set up either siproxd or asterisk (trying both to eliminate the app as the cause of the issue) on my FreeBSD PC acting as a NAT router.
The issue seems to be that when either siproxd or asterisk sends a REGISTER to a remote SIP server, I never see the "OK" response from the remote server. As a result, both applications retransmit their REGISTER endlessly, even though the remote server sends the reply.
I did a tcpdump and verified that I can, in fact, see the reply packets from the remote server come in. It is just that the datagrams are not being passed on to the application layer (siproxd/asterisk).
I have, as far as I know, correctly opened up the port in /etc/pf.conf and reloaded the rules by doing /etc/rc.d/pf reload (no syntax errors reported).
Here is my ruleset:
I want to comment that I have tried many various things in my pf ruleset to make this work - none of them have succeeded. I tried pass in quick, for example, and I even put a rule in to allow ALL packets from the remote server (in addition to the rule above it allowing port 5060 from any host).
I know that the "pass in quick on dc0 inet proto {tcp, udp} from x.x.2.173 to any keep state" rule is having some affect becuase I can log on to that server (x.x.2.173) over ssh and do a "telnet <my hostname>" and get a "Connection Refused". Normally, I would not see that because my block policy is set to drop non-matching packets.
The million dollar question is, why does UDP port 5060 have a problem making it through pf?
I have spent several hours tearing my hair out over this issue! I took the drastic action of "/etc/rc.d/pf stop" and guess what, IT STARTED WORKING! So the problem *has* to be in pf somewhere, I just do not understand what I am doing wrong here.
Thanks in advance!
Running 8.0-RELEASE here. I am trying to set up either siproxd or asterisk (trying both to eliminate the app as the cause of the issue) on my FreeBSD PC acting as a NAT router.
The issue seems to be that when either siproxd or asterisk sends a REGISTER to a remote SIP server, I never see the "OK" response from the remote server. As a result, both applications retransmit their REGISTER endlessly, even though the remote server sends the reply.
I did a tcpdump and verified that I can, in fact, see the reply packets from the remote server come in. It is just that the datagrams are not being passed on to the application layer (siproxd/asterisk).
I have, as far as I know, correctly opened up the port in /etc/pf.conf and reloaded the rules by doing /etc/rc.d/pf reload (no syntax errors reported).
Here is my ruleset:
Code:
# options
set block-policy drop
set loginterface dc0
set skip on lo
# scrub
#scrub reassemble tcp no-df random-id
# nat/rdr
nat on dc0 inet from !self to any -> (dc0:0)
nat on tun0 inet from !self to any -> (tun0:0)
nat-anchor "ftp-proxy/*"
rdr-anchor "ftp-proxy/*"
rdr on alc0 proto tcp from any to any port ftp -> 127.0.0.1 port 8021
#rdr pass on dc0 proto tcp from any to any port 3389 -> 192.168.0.17 port 3389
# filter rules
block in
pass out keep state
anchor "ftp-proxy/*"
antispoof quick for { lo alc0 }
pass in on dc0 inet proto tcp from any to (dc0) port { 6881, 2222, 113, 81 } flags S/SA keep state
pass in on dc0 inet proto udp from any to (dc0) port 6881 keep state
pass in on dc0 inet proto udp from any to (dc0) port 9000:9050 keep state
pass in inet proto udp from any to any port 5060 keep state
pass in quick on dc0 inet proto {tcp, udp} from x.x.2.173 to any keep state
pass in on gif0 inet6 proto tcp from any to (gif0) port { 6881, 2222, 113, 81 } flags S/SA keep state
pass in inet proto icmp all icmp-type echoreq keep state
pass in quick on alc0
I want to comment that I have tried many various things in my pf ruleset to make this work - none of them have succeeded. I tried pass in quick, for example, and I even put a rule in to allow ALL packets from the remote server (in addition to the rule above it allowing port 5060 from any host).
I know that the "pass in quick on dc0 inet proto {tcp, udp} from x.x.2.173 to any keep state" rule is having some affect becuase I can log on to that server (x.x.2.173) over ssh and do a "telnet <my hostname>" and get a "Connection Refused". Normally, I would not see that because my block policy is set to drop non-matching packets.
The million dollar question is, why does UDP port 5060 have a problem making it through pf?
I have spent several hours tearing my hair out over this issue! I took the drastic action of "/etc/rc.d/pf stop" and guess what, IT STARTED WORKING! So the problem *has* to be in pf somewhere, I just do not understand what I am doing wrong here.
Thanks in advance!