I have fresh a server running
Now I wanted to enable outgoing ftp (e.g. for updates) and found ftp-proxy(). Then made the following adjustments to my pf.config restarted PF and fired up the ftp-proxy with
Then I call
Checking for subanchors with
So is my ftp-proxy not adding rules or have I made the wrong assumption?
Has anybody have had similar setup and have a suggestion what I could do better?
FreeBSD 10.3-RELEASE-p11
it has a connection to the internet. The /etc/pf.conf has a rule blocking all incoming packets except my ssh connection, dns, ntp and icmp.Now I wanted to enable outgoing ftp (e.g. for updates) and found ftp-proxy(). Then made the following adjustments to my pf.config restarted PF and fired up the ftp-proxy with
/usr/sbin/ftp-proxy -D7 -v
.
Code:
### ftp ###
nat-anchor "ftp-proxy/*"
rdr-anchor "ftp-proxy/*"
rdr pass proto tcp from any to any port ftp -> 127.0.0.1 port 8021
### deny others ###
no rdr
### default block ###
block in log on $ExtIf
### ssh, dns, ntp and icmp rules ###
### ftp anchor ###
anchor "ftp-proxy/*"
pass out proto tcp from any to any port 21 keep state
Then I call
fetch ftp://ftp.freebsd.org/pub/FreeBSD/README.TXT
and fetch() prints No route to host
. Consulting /var/log/messages shows that the rdr to the proxy is working: Mar 13 21:15:11 kahless ftp-proxy[645]: #1 server refused connection
. Investigating the /var/log/pf.log shows that the incoming traffic was blocked by my default block rule:
Code:
2017-03-13 21:15:44.410819 rule 1..16777216/0(match): block in on re0: 213.138.116.78.21 > [my_ip].52314: Flags [S.], seq 247602936, ack 3020026929, win 65535, options [mss 1460,nop,wscale 11,sackOK,TS val 3633337037 ecr 31690932], length 0
2017-03-13 21:15:44.639925 rule 1..16777216/0(match): block in on re0: 213.138.116.78.21 > [my_ip].52314: Flags [S.], seq 247602936, ack 3020026929, win 65535, options [mss 1460,nop,wscale 11,sackOK,TS val 3633337037 ecr 31694161], length 0
2017-03-13 21:15:47.639959 rule 1..16777216/0(match): block in on re0: 213.138.116.78.21 > [my_ip].52314: Flags [S.], seq 247602936, ack 3020026929, win 65535, options [mss 1460,nop,wscale 11,sackOK,TS val 3633337037 ecr 31694161], length 0
2017-03-13 21:15:47.846522 rule 1..16777216/0(match): block in on re0: 213.138.116.78.21 > [my_ip].52314: Flags [S.], seq 247602936, ack 3020026929, win 65535, options [mss 1460,nop,wscale 11,sackOK,TS val 3633337037 ecr 31697368], length 0
Checking for subanchors with
pfctl -vv -sA
returned nothing, so my guess would be, that ftp-proxy is not adding rules to my PF.So is my ftp-proxy not adding rules or have I made the wrong assumption?
Has anybody have had similar setup and have a suggestion what I could do better?