schorsch_76
FreeBSD Fanboy
Vor ca einer Woche hab ich meinen Server von Linux auf FreeBSD 12.0-RELEASE umgestellt. Es läuft auch soweit, nur nach einem Neustart hängt das Routing zu den VMs und ich muss ein "service pf reload" machen. Ich ab die Netwerkinterfaces der VMs und von openvpn schon in der rc.conf angelegt und ich hänge mich dann mit bhyve darauf. Das klappt auch, nur die NAT Tabelle will immer neu geladen werden (nach dem Server neustart)
Any Ideas? Das Preclone sorgt dafür das pf mich nicht aussperrt wenn ein tap nicht da wäre (was passiert ist (hust)).
rc.conf
Und hier die pf.conf
Any Ideas? Das Preclone sorgt dafür das pf mich nicht aussperrt wenn ein tap nicht da wäre (was passiert ist (hust)).
rc.conf
Code:
clear_tmp_enable="YES"
syslogd_flags="-ss"
sendmail_enable="NONE"
hostname="server"
keymap="de.kbd"
#################################################################################
# Network
#################################################################################
ifconfig_re0="DHCP"
# precloned interfaces for VPN, VMs and jails
cloned_interfaces="bridge0 tap0 tap1 tap2 tap3"
ifconfig_bridge0="addm tap0 up addm tap1 up addm tap2 up addm tap3 up"
ifconfig_tap0="up"
ifconfig_tap1="up"
ifconfig_tap2="up"
ifconfig_tap3="up"
ifconfig_bridge0_alias1="inet 192.168.175.1 netmask 255.255.255.0"
ifconfig_bridge0_alias2="inet 192.168.175.11-20 netmask 255.255.255.0"
#################################################################################
# important services
#################################################################################
sshd_enable="YES"
ntpd_enable="YES"
powerd_enable="YES"
#################################################################################
# kernel modules
#################################################################################
kldlist="fuse vmm tun"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="NO"
zfs_enable="YES"
#################################################################################
# VMs + jails
#################################################################################
vm_enable="YES"
vm_dir="zfs:zroot/VM"
vm_list="vm-www vm-mail vm-ldap"
vm_delay="5"
jail_enable="YES"
#################################################################################
# firewall
#################################################################################
pf_enable="YES"
pf_rules="/etc/pf.conf"
pflog_enable="YES"
pflog_logfile="/var/log/pflog"
openvpn_enable="YES"
gateway_enable="YES" # Enable as LAN gateway
Und hier die pf.conf
Code:
ext_if = "re0"
int_if = "{ bridge0, tap0 }"
if = "{ re0, tap0 }"
tcp_pass = "{ ssh, http, https, 465, 993, 25, 6667, 25000 }"
udp_pass = "{ 53 2031 1194 }"
local_tcp_pass = "{5901, 5902, 5903, postgresql}"
local_udp_pass = "{ 53 }"
table <intranet> { 192.168.175.0/24, 192.168.177.0/24 }
table <bruteforce> persist
############################################
# scrub
############################################
scrub in all
#############################################
# redirections + NAT
#############################################
rdr on $ext_if inet proto tcp from any to ($ext_if) port http -> 192.168.175.21 port http
rdr on $ext_if inet proto tcp from any to ($ext_if) port https -> 192.168.175.21 port https
# postgres
rdr on $int_if inet proto tcp from any to $int_if port postgresql -> 192.168.175.21 port postgresql
# mail
rdr on $ext_if inet proto tcp from any to ($ext_if) port 25 -> 192.168.175.22 port 25
rdr on $ext_if inet proto tcp from any to ($ext_if) port 465 -> 192.168.175.22 port 465
rdr on $ext_if inet proto tcp from any to ($ext_if) port 993 -> 192.168.175.22 port 993
# irc
rdr on $ext_if inet proto tcp from any to ($ext_if) port 6667 -> 192.168.175.11 port 6667
rdr on $ext_if inet proto tcp from any to ($ext_if) port 25000 -> 192.168.175.11 port 25000
# NAT for internal
nat on $ext_if inet from <intranet> to any -> $ext_if
#############################################
# Antispoof
#############################################
antispoof for $ext_if
antispoof for $int_if
#table <intranet> { 192.168.175.0/24, 192.168.177.0/24 }
#table <bruteforce> persist
#############################################
# rules
#############################################
set skip on lo0
block all
block quick from <bruteforce>
pass quick from <intranet> to any keep state
#############################################
# Ping
#############################################
icmp_types = "{ echoreq, unreach }"
pass in inet proto icmp from any to any icmp-type { 0, 3, 8, 11 }
#############################################
# regular ports
#############################################
pass in on $if proto tcp from any to any port $tcp_pass flags S/SA keep state (max-src-conn 100, max-src-conn-rate 15/5, overload <bruteforce> flush global)
pass in on $if proto udp to any port $udp_pass keep state
# local
pass in on $int_if proto tcp from $int_if to any port $local_tcp_pass flags S/SA keep state (max-src-conn 100, max-src-conn-rate 15/5, overload <bruteforce> flush global)
pass in on $int_if proto udp to any port $local_udp_pass keep state
#############################################
# Outgoing
#############################################
pass out quick all keep state
pass in quick from <intranet> to any keep state