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 82: | Line 79: | ||
END | END | ||
- | natd_enable=" | + | # public gateway interface needs nat |
- | natd_flags="-f / | + | jexec "ioc-${JAIL_NAME:? |
- | natd_interface=" | + | |
- | natd_program="/ | + | |
+ | # extra settings for nat are in the file we defined above | ||
+ | jexec " | ||
+ | </ | ||
+ | |||
+ | ====== Configure a Simple Firewall ====== | ||
+ | |||
+ | > 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 !!! | ||
+ | |||
+ | < | ||
+ | |||
+ | # use the standard firewall template called " | ||
+ | jexec " | ||
+ | jexec " | ||
+ | |||
+ | # log more while testing, or be quiet in normal operation? | ||
+ | jexec " | ||
</ | </ | ||
Line 96: | Line 111: | ||
# enable IP forwarding | # enable IP forwarding | ||
- | jexec " | + | jexec " |
- | | + | |
- | + | ||
- | # enable firewall | + | |
- | jexec " | + | |
- | sysrc firewall_enable=" | + | |
- | # name of firewall | + | # enable the firewall |
- | jexec " | + | jexec " |
- | sysrc firewall_type=" | + | |
- | + | ||
- | # log more while testing, or be quiet in normal operation? | + | |
- | jexec " | + | |
- | | + | |
# enable the NAT service | # enable the NAT service | ||
- | jexec " | + | jexec " |
- | | + | |
- | + | ||
- | # public gateway needs nat | + | |
- | jexec " | + | |
- | sysrc natd_interface=" | + | |
- | + | ||
- | # extra settings for nat | + | |
- | jexec " | + | |
- | sysrc natd_flags=" | + | |
# 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 137: | Line 137: | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
+ | * [[https:// | ||
+ | |||