Hello,
Is it possible to have multi WAN with IPFW? I know it's possible with PF and PF does it well in pfSense. But I am running FreeBSD 13.1-RELEASE as my home firewall/gateway using some cool pkgs like net/kea, dns/unbound and FreeBSD's native firewall - IPFW with In-kernal NAT.
Here is an example code for one WAN/Gateway and it's running without any issues:
Update:
My two WANs from different ISPs, and I connect to each ISP using PPPoE with tun0 and tun1 interfaces
So besides ipfw configuration I need to implement routing tables to group my two gateways and to be honest I don't know how to make this job done plus I don't know the right tools for it.
Thanks,
Is it possible to have multi WAN with IPFW? I know it's possible with PF and PF does it well in pfSense. But I am running FreeBSD 13.1-RELEASE as my home firewall/gateway using some cool pkgs like net/kea, dns/unbound and FreeBSD's native firewall - IPFW with In-kernal NAT.
Here is an example code for one WAN/Gateway and it's running without any issues:
Code:
ipfw -q -f flush
add="ipfw -q add"
wan="tun0"
lan="em1"
ipfw -q nat 1 config if $wan reset same_ports unreg_only
# Allow all lo0 traffic:
$add 100 pass all from any to any via $lan
$add 200 pass all from any to any via lo0
# Reject spoofing:
$add 300 deny ip from any to any not antispoof in
# NAT rule for incoming packets.
# NAT in rule must appear BEFORE check-state.
$add 400 nat 1 ip from any to any via $wan in
$add 500 check-state
# Port redirection rules to internal, skipto 10000
# ...
# Prevent lan from spamming
$add 1000 deny ip from not me to any smtp,smtps via $wan out
# Allow all other outgoing connections
$add 2000 skipto 10000 tcp from any to any via $wan out keep-state
$add 2100 skipto 10000 udp from any to any via $wan out keep-state
# I server web pages too:
$add 5000 allow tcp from any to me http,https via $wan in keep-state
$add 9000 allow icmp from any to any
$add 9999 deny all from any to any
# NAT rule for outgoing packets
$add 10000 nat 1 ip from any to any via $wan out
Update:
My two WANs from different ISPs, and I connect to each ISP using PPPoE with tun0 and tun1 interfaces
So besides ipfw configuration I need to implement routing tables to group my two gateways and to be honest I don't know how to make this job done plus I don't know the right tools for it.
Thanks,