Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
computers:truenas:gateway [03-Nov-2021 11:23] – [Configure NAT] Steve Joynt | computers:truenas:gateway [02-Feb-2025 16:14] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 70: | Line 70: | ||
< | < | ||
- | jexec " | + | jexec " |
- | | + | |
- | jexec " | + | jexec " |
- | "cat >| ${NAT_CONF:? | + | |
- | <<END | + | |
use_sockets yes | use_sockets yes | ||
Line 81: | Line 78: | ||
END | END | ||
+ | |||
+ | # public gateway interface needs nat | ||
+ | jexec " | ||
+ | |||
+ | # extra settings for nat are in the file we defined above | ||
+ | jexec " | ||
</ | </ | ||
- | ====== | + | ====== |
+ | |||
+ | > IMPORTANT! | ||
+ | > This firewall does not filter any traffic. It allows anything to talk to anything. | ||
+ | > At this stage I just want to trigger NAT as appropriate to allow hosts on different networks to communicate. | ||
+ | > The " | ||
+ | > If your TrueNAS box connects directly to the Internet, DO NOT USE THIS EXAMPLE !!! | ||
< | < | ||
- | # enable IP forwarding | + | # use the standard firewall template called |
- | jexec "ioc-${JAIL_NAME:? | + | jexec " |
- | sysrc gateway_enable=" | + | jexec " |
- | + | ||
- | # enable firewall | + | |
- | jexec " | + | |
- | | + | |
- | + | ||
- | # name of firewall config | + | |
- | jexec " | + | |
- | | + | |
# log more while testing, or be quiet in normal operation? | # log more while testing, or be quiet in normal operation? | ||
- | jexec " | + | jexec " |
- | | + | |
- | # enable the NAT service | + | </ |
- | jexec " | + | |
- | sysrc natd_enable=" | + | |
- | # public gateway needs nat | + | ====== Activating the Configuration ====== |
- | jexec " | + | |
- | sysrc natd_interface=" | + | |
- | # extra settings for nat | + | < |
- | jexec " | + | |
- | sysrc natd_flags="-f ${NAT_CONF:?}" | + | # enable IP forwarding |
+ | jexec " | ||
+ | |||
+ | # enable the firewall service (aka ipfw) | ||
+ | jexec " | ||
+ | |||
+ | # enable the NAT service | ||
+ | jexec "ioc-${JAIL_NAME:?}" sysrc natd_enable=" | ||
# start the firewall & natd | # start the firewall & natd | ||
- | jexec " | + | jexec " |
- | | + | |
</ | </ | ||
+ | |||
+ | ====== Firewall and Debugging Logs ====== | ||
+ | |||
+ | If you've turned on any logging for the ipfw service or natd, the output can be seen on the TrueNAS server OUTSIDE THE JAIL in this file... | ||
+ | < | ||
====== Credits ====== | ====== Credits ====== | ||
Line 130: | Line 137: | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
+ | * [[https:// | ||
+ | |||