PaulAtreides
Well-Known Member
Ich habe zwei Netzwerke.
$printer_if: Drucker und Scanner
$int_if: Clients und Server
Wie konfiguriere ich PF so, dass ein Scanner im Netzwerk $printer_if Daten an einen FTP-Server im Netzwerk $int_if senden kann?
$printer_if: Drucker und Scanner
$int_if: Clients und Server
Wie konfiguriere ich PF so, dass ein Scanner im Netzwerk $printer_if Daten an einen FTP-Server im Netzwerk $int_if senden kann?
ext_if = "pppoe0"
int_if = "ix0"
printer_if = "vlan21"
local_net = "{10.0.30.0/24, 10.0.20.0/24, 10.0.50.0/24, 10.0.70.0/24}"
server_net = "{10.0.20.0/24}"
printer_net = "{10.0.21.0/24}"
anchor "ftp-proxy/*"
#################
# DEFAULT OPTIONS
#################
set block-policy drop
set loginterface $ext_if
set skip on lo0
#################
# NAT
#################
match in all scrub (no-df max-mss 1440)
match out on $ext_if inet from $local_net nat-to ($ext_if)
match out on $ext_if inet from $printer_net nat-to ($ext_if)
#################
# ANTISPOOOF
#################
antispoof for $int_if
#################
# DEFAULT BLOCK
#################
block log all
pass from (self)
##################
# ICMP
##################
icmp_types = "{ echoreq, unreach }"
pass log inet proto icmp icmp-type $icmp_types
#################
# PRINTER NETWORK
#################
block in log on $printer_if from $printer_net to any
pass in on $printer_if proto { tcp, udp } from $printer_net to 10.0.21.1 port { domain, ntp }
pass in quick on $printer_if inet proto tcp to port 21 divert-to 127.0.0.1 port 8021
pass out inet proto tcp from (self) to any port ftp
pass in on $printer_if proto tcp from $printer_net to any port { http, https, smtp }
pass proto tcp from { $local_net } to $printer_net port { ipp, 9100, http, https }
pass proto tcp from $printer_net to { $local_net }
pass proto udp from $printer_net to { $local_net }
##################
# ALLOWED NETWORK SERVICES LAN
##################
tcp_services = "{ ftp-data, ftp, ssh, smtp, smtps, domain, pop3, auth, http, https, pop3s, imap, imaps, 6667, 3000, 8883}"
udp_services = "{ domain, ntp, openvpn}"
# pass proto tcp from $local_net to port $tcp_services
pass in on $int_if proto tcp from $local_net to port $tcp_services
pass out on $int_if proto tcp from $local_net to port $tcp_services
pass quick proto { tcp, udp } from $local_net to port $udp_services
# FTP Proxy
pass in quick inet proto tcp from $local_net to port ftp divert-to 127.0.0.1 port 8021
##################
# LOCALHOST SERVER
##################
local_tcp_server = "{ ssh, 3128 }"
local_udp_server = "{ domain, ntp }"
pass in on $int_if proto tcp from $local_net to port $local_tcp_server
pass in on $int_if proto udp from $local_net to port $local_udp_server
#################
# By default, do not permit remote connections to X11
block return in on ! lo0 proto tcp to port 6000:6010
# Port build user does not need network
block return out log proto {tcp udp} user _pbuild

