I'm running Freebsd 13.1 on raspbery pi and trying to setup it as router server for home network. Pi box has two network cards
ue0 and ue1. First one connected to internet and second is for lan users. When openvpn up on eu0 it suppose to go to ue1 too, therefore lan users getting openvpn connection ip. I was able to achieve desired aim on Linux with iptables, and wish to do the same on freebsd with ipfw.
Linux
How to adapt it to ipw?
ue0 and ue1. First one connected to internet and second is for lan users. When openvpn up on eu0 it suppose to go to ue1 too, therefore lan users getting openvpn connection ip. I was able to achieve desired aim on Linux with iptables, and wish to do the same on freebsd with ipfw.
Linux
Code:
#!/bin/bash
IPTABLES="/sbin/iptables"
$IPTABLES -t nat -A POSTROUTING -o ue0 -j MASQUERADE
$IPTABLES -A FORWARD -i ue0 -o ue1 -m state --state RELATED,ESTABLISHED -j ACCEPT
$IPTABLES -A FORWARD -i ue1 -o ue0 -j ACCEPT
#VPN
$IPTABLES -t nat -A POSTROUTING -o tun0 -j MASQUERADE
$IPTABLES -A FORWARD -i tun0 -o ue1 -m state --state RELATED,ESTABLISHED -j ACCEPT
$IPTABLES -A FORWARD -i ue1 -o tun0 -j ACCEPT
How to adapt it to ipw?