mirror of
https://github.com/BastilleBSD/bastille.git
synced 2025-12-12 01:49:51 +01:00
clarification to README on firewall settings
This commit is contained in:
12
README.md
12
README.md
@@ -97,12 +97,6 @@ ishmael ~ # sysrc ifconfig_lo1_name="bastille0"
|
|||||||
ishmael ~ # service netif cloneup
|
ishmael ~ # service netif cloneup
|
||||||
```
|
```
|
||||||
|
|
||||||
Second, enable the firewall:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
ishmael ~ # sysrc pf_enable="YES"
|
|
||||||
```
|
|
||||||
|
|
||||||
Create the firewall config, or merge as necessary.
|
Create the firewall config, or merge as necessary.
|
||||||
|
|
||||||
/etc/pf.conf
|
/etc/pf.conf
|
||||||
@@ -134,7 +128,8 @@ Note: if you have an existing firewall, the key lines for in/out traffic to
|
|||||||
containers are:
|
containers are:
|
||||||
|
|
||||||
```
|
```
|
||||||
nat on $ext_if from bastille0:network to any -> ($ext_if)
|
table <jails> persist
|
||||||
|
nat on $ext_if from <jails> to any -> ($ext_if)
|
||||||
|
|
||||||
## rdr example
|
## rdr example
|
||||||
## rdr pass inet proto tcp from any to any port {80, 443} -> 10.17.89.45
|
## rdr pass inet proto tcp from any to any port {80, 443} -> 10.17.89.45
|
||||||
@@ -147,9 +142,10 @@ The `rdr pass ...` will redirect traffic from the host firewall on port X to
|
|||||||
the ip of container Y. The example shown redirects web traffic (80 & 443) to the
|
the ip of container Y. The example shown redirects web traffic (80 & 443) to the
|
||||||
container at `10.17.89.45`.
|
container at `10.17.89.45`.
|
||||||
|
|
||||||
Finally, start up the firewall:
|
Finally, enable and (re)start the firewall:
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
|
ishmael ~ # sysrc pf_enable="YES"
|
||||||
ishmael ~ # service pf restart
|
ishmael ~ # service pf restart
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -51,10 +51,10 @@ TARGET="${1}"
|
|||||||
shift
|
shift
|
||||||
|
|
||||||
if [ "${TARGET}" = 'ALL' ]; then
|
if [ "${TARGET}" = 'ALL' ]; then
|
||||||
JAILS=$(/usr/local/bin/bastille list jails)
|
JAILS=$(bastille list jails)
|
||||||
fi
|
fi
|
||||||
if [ "${TARGET}" != 'ALL' ]; then
|
if [ "${TARGET}" != 'ALL' ]; then
|
||||||
JAILS=$(/usr/local/bin/bastille list jails | grep -w "${TARGET}")
|
JAILS=$(bastille list jails | grep -w "${TARGET}")
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for _jail in ${JAILS}; do
|
for _jail in ${JAILS}; do
|
||||||
|
|||||||
Reference in New Issue
Block a user