Hello All,
We are having trouble with finding ways to redirect the public IP address to the jail IP address. We have looked into the rc.conf and jail.conf files but are now sure how we should edit any of these files to achieve this.
We have previously been unsuccessful in editing pf values and have been looking into using the ipfw settings.
Would anyone have a better idea of what we might need to do correctly do this for our system?
BELOW ARE MY FILES:
ipfw.rules file:
and my ifconfig:
We are having trouble with finding ways to redirect the public IP address to the jail IP address. We have looked into the rc.conf and jail.conf files but are now sure how we should edit any of these files to achieve this.
We have previously been unsuccessful in editing pf values and have been looking into using the ipfw settings.
Would anyone have a better idea of what we might need to do correctly do this for our system?
BELOW ARE MY FILES:
ipfw.rules file:
Code:
#!/bin/sh
set -e
# [URL]https://www.digitalocean.com/community/tutorials/how-to-install-buildbot-freebsd[/URL]
# Add basic rules as defined by firewall_type, firewall_myservices, etc.
. /etc/rc.firewall
IP_PUB = “ip_address”
WEB_PORTS = "{ 80, 443, 8000 }"
server_www_addr = "192.168.2.14"
int_net = "192.168.2.0/24"
# [URL]https://nileshgr.com/2014/12/07/freebsd-ipfw-nat-jails[/URL]
ipfw nat 123 config ip $IP_PUB
ipfw add 100 nat 123 from any to a.b.c.d in
ipfw add 101 check-state
index=300
for port in $tcp_service_ports; do
ipfw add $index allow tcp from any to me $port in
ipfw add $index allow tcp from me $port to any out
index=$((index+1))
done
index=400
for port in $udp_service_ports; do
ipfw add $index allow udp from any to me $port in
ipfw add $index allow udp from me $port to any out
index=$((index+1))
done
ipfw add 800 nat 123 ip4 from $int_net to any out
index=500
for port in $out_tcp_ports; do
ipfw add $index skipto 800 tcp from $int_net to any $port out setup keep-state
ipfw add $index allow tcp from me to any $port out setup keep-state
index=$((index+1))
done
index=600
for port in $out_udp_ports; do
ipfw add $index skipto 800 udp from $int_net to any $port out keep-state
ipfw add $index allow udp from me to any $port out keep-state
index=$((index+1))
done
and my ifconfig:
Code:
ue0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=80009<RXCSUM,VLAN_MTU,LINKSTATE>
ether b8:27:eb:6c:52:52
inet 192.168.2.14 netmask 0xffffffff broadcast 192.168.2.14
inet 192.168.2.13 netmask 0xffffff00 broadcast 192.168.2.3
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>