SHOREWALL-INTERFACE(5)
π SHOREWALL-INTERFACE(5) π
okay bestie, welcome to the interfaces page β straight out of the Configuration Files section of the manual. this is where you tell Shorewall which network interfaces exist, and it's giving main character energy. let's get into it π«Ά
β¨ NAME β¨
interfaces β the Shorewall interfaces file. literally the file where your firewall learns what its network interfaces even are. π
πΈ SYNOPSIS πΈ
/etc/shorewall[6]/interfaces
π¦ DESCRIPTION π¦
so the interfaces file is what defines the firewall's network interfaces to Shorewall. and here's a lil fact for you: the order of entries in this file does not matter when it comes to determining zone composition. not significant, periodt. β¨
starting with Shorewall 4.5.3, this file supports two different formats:
π FORMAT 1 (default - deprecated) π
there's a BROADCAST column, and you can use it to specify the broadcast address that goes with the interface.
bestie, it says deprecated right there in the name β just so you know. π
π FORMAT 2 π
the BROADCAST column is just... not there. omitted. gone. π
the format gets specified by a line that looks exactly like this:
?FORMAT {1|2}
and now, the columns. the way this file is laid out, you got a bunch of them, and each one is its own lil vibe. π
π ZONE - zone-name π
this is the zone for this interface. it must match the name of a zone declared in /etc/shorewall/zones. and no, you may not list the firewall zone in this column. not allowed. π
if the interface serves multiple zones that will be defined in the shorewall-hosts[1](5) file, then you should put "-" in this column.
if there are multiple interfaces going to the same zone, you gotta list them in separate entries. no shortcuts.
example, because we love a visual:
#ZONE INTERFACE BROADCAST
loc eth1 -
loc eth2 -
π¦ INTERFACE - interface[:port] π¦
this is the logical name of the interface. each interface may be listed only once in this file. and you may NOT specify the name of a "virtual" interface (like eth0:0) here β go check https://shorewall.org/FAQ.htm#faq18[2] for that whole thing. if the physical option is not specified, then the logical name is also the name of the actual interface. easy.
you can use wildcards here by specifying a prefix followed by a plus sign ("+"). for example, if you want an entry that applies to all PPP interfaces, use 'ppp+' β that would match ppp0, ppp1, ppp2, ... iconic.
β οΈ when you're using Shorewall versions before 4.1.4, care must be exercised when using wildcards where there is another zone that uses a matching specific interface. see shorewall-nesting[3](5) for a discussion of this problem.
Shorewall allows '+' as an interface name, but that usage is deprecated. a better approach is to specify physical=+ in the OPTIONS column (see below). do that instead, bestie.
there is no need to define the loopback interface (lo) in this file. skip it, it's fine.
if a port is given, then the interface must have been defined previously with the bridge option. and when a port is given, the OPTIONS column may not contain the following options:
arp_filterarp_ignorebridgelog_martiansmssoptionalproxyarprequiredroutefiltersourcerouteupnpwait
beginning with Shorewall 4.5.17, if you specify a zone for the 'lo' interface, then that zone must be defined as type local in shorewall6-zones[4](5).
πΈ BROADCAST (Optional) - {-|detect|address[,address]...} πΈ
only available if you're in FORMAT 1. so if you're on FORMAT 2, this whole column is a no-show. π
if you use the special value detect, Shorewall will detect the broadcast address(es) for you β if your iptables and kernel include Address Type Match support. that's the catch, bestie.
if your iptables and/or kernel lack Address Type Match support, then you may list the broadcast address(es) for the network(s) to which the interface belongs. for P-T-P interfaces, this column is left blank. and if the interface has multiple addresses on multiple subnets, then list the broadcast addresses as a comma-separated list. π
if you don't want to give a value for this column but you do want to enter a value in the OPTIONS column, enter - in this column. problem solved.
β OPTIONS (Optional) - [option[,option]...] β
a comma-separated list of options from the list below. the order in which you list the options is not significant, but the list should have no embedded white-space. keep it tight. β¨
accept_ra[={0|1|2}]β IPv6 only; added in Shorewall 4.5.16. the values are:0β Do not accept Router Advertisements.1β Accept Route Advertisements if forwarding is disabled.2β Overrule forwarding behavior. Accept Route Advertisements even if forwarding is enabled.
if the option is specified without a value, then the value 1 is assumed.
π Note: This option does not work with a wild-card physical name (e.g., eth0.+). Beginning with Shorewall 5.1.10, if this option is specified, a warning is issued and the option is ignored.
arp_filter[={0|1}]β IPv4 only. if specified, this interface will only respond to ARP who-has requests for IP addresses configured on the interface. if not specified, the interface can respond to ARP who-has requests for IP addresses on any of the firewall's interfaces. the interface must be up when Shorewall is started.
only those interfaces with the arp_filter option will have their setting changed; the value assigned to the setting will be the value specified (if any) or 1 if no value is given.
π Note: This option does not work with a wild-card physical name (e.g., eth0.+). Beginning with Shorewall 5.1.10, if this option is specified, a warning is issued and the option is ignored.
arp_ignore[=number]β IPv4 only. if specified, this interface will respond to arp requests based on the value of number (defaults to1).1β reply only if the target IP address is local address configured on the incoming interface2β reply only if the target IP address is local address configured on the incoming interface and the sender's IP address is part from same subnet on this interface's address3β do not reply for local addresses configured with scope host, only resolutions for global and link4-7β reserved8β do not reply for all local addresses
π Note: This option does not work with a wild-card physical name (e.g., eth0.+). Beginning with Shorewall 5.1.10, if this option is specified, a warning is issued and the option is ignored.
π¨ Warning: Do not specify arp_ignore for any interface involved in Proxy ARP[5].
blacklistβ checks packets arriving on this interface against theshorewall-blacklist[6](5)file.
beginning with Shorewall 4.4.13:
- if a zone is given in the ZONES column, then the behavior is as if
blacklisthad been specified in the IN_OPTIONS column ofshorewall-zones[4](5). - otherwise, the option is ignored with a warning:
WARNING: The 'blacklist' option is ignored on multi-zone interfaces
bridgeβ designates the interface as a bridge. beginning with Shorewall 4.4.7, setting this option also setsrouteback.
π Note: if you have a bridge that you don't intend to define bport zones on, then it is best to omit this option and simply specify routeback.
dbl={none|src|dst|src-dst}β added in Shorewall 5.0.10. this option defines whether or not dynamic blacklisting is applied to packets entering the firewall through this interface, and whether the source address and/or destination address is to be compared against the ipset-based dynamic blacklist (DYNAMIC_BLACKLIST=ipset...inshorewall.conf(5)[7]). the default is determined by the setting ofDYNAMIC_BLACKLIST:DYNAMIC_BLACKLIST=Noβ default isnone(e.g., no dynamic blacklist checking).DYNAMIC_BLACKLIST=Yesβ default issrc(e.g., the source IP address is checked).DYNAMIC_BLACKLIST=ipset[-only]β default issrc.DYNAMIC_BLACKLIST=ipset[-only],src-dst...β default issrc-dst(e.g., the source IP addresses in checked against the ipset on input and the destination IP address is checked against the ipset on packets originating from the firewall and leaving through this interface).
the normal setting for this option will be dst or none for internal interfaces, and src or src-dst for Internet-facing interfaces.
destonlyβ added in Shorewall 4.5.17. causes the compiler to omit rules to handle traffic from this interface.dhcpβ specify this option when any of the following are true:- the interface gets its IP address via DHCP
- the interface is used by a DHCP server running on the firewall
- the interface has a static IP but is on a LAN segment with lots of DHCP clients.
- the interface is a simple bridge[8] with a DHCP server on one port and DHCP clients on another port.
π Note: if you use Shorewall-perl for firewall/bridging[9], then you need to include DHCP-specific rules in shorewall-rules[10](5). DHCP uses UDP ports 67 and 68.
this option allows DHCP datagrams to enter and leave the interface. π
forward[={0|1}]β IPv6 only. sets the/proc/sys/net/ipv6/conf/interface/forwardingoption to the specified value. if no value is supplied, then1is assumed.
π Note: This option does not work with a wild-card physical name (e.g., eth0.+). Beginning with Shorewall 5.1.10, if this option is specified, a warning is issued and the option is ignored.
ignore[=1]β when specified, causes the generated script to ignore up/down events from Shorewall-init for this device. additionally, the option exempts the interface from hairpin filtering. when'=1'is omitted, the ZONE column must contain'-'andignoremust be the only OPTION.
beginning with Shorewall 4.5.5, may be specified as 'ignore=1' which only causes the generated script to ignore up/down events from Shorewall-init; hairpin filtering is still applied. in this case, the above restrictions on the ZONE and OPTIONS columns are lifted. π¦
loopbackβ added in Shorewall 4.6.6 β¨ This one says hey, this interface IS the loopback interface. If the interface's physical name islo, Shorewall just assumes it, no need to say anything. Only one interface may have theloopbackoption specified. One. Singular. πlogmartians[={0|1}]β IPv4 only, bestie. Turns on kernel martian logging, which is the logging of packets with impossible source addresses πΈ It is strongly suggested that if you setroutefilteron an interface, you also setlogmartians. And even if you don't specify theroutefilteroption, it's still a good idea to specifylogmartians, because your distribution may have enabled route filtering without you knowing it. Rude of them, honestly.
Only those interfaces with the logmartians option will have their setting changed; the value assigned to the setting will be the value specified (if any) or 1 if no value is given.
Wanna find out if route filtering is set on a given interface? Check the contents of /proc/sys/net/ipv4/conf/interface/rp_filter β a non-zero value indicates that route filtering is enabled. π
Example:
teastep@lists:~$ cat /proc/sys/net/ipv4/conf/eth0/rp_filter
1
teastep@lists:~$
Note β this option does not work with a wild-card physical name (e.g., eth0.+). Beginning with Shorewall 5.1.10, if this option is specified, a warning is issued and the option is ignored. π
This option may also be enabled globally in the shorewall.conf[7](5) file.
maclistβ connection requests from this interface get compared against the contents ofshorewall-maclist[11](5) π If you specify this option, the interface must be an Ethernet NIC and must be up before Shorewall is started.mss=numberβ added in Shorewall 4.0.3 β¨ Causes forwarded TCP SYN packets entering or leaving on this interface to have their MSS field set to the specified number. Set it, and that's the number. Periodt.nets=(net[,...])β limit the zone named in the ZONE column to only the listed networks. The parentheses may be omitted if only a single net is given (e.g.,nets=192.168.1.0/24). Limited broadcast to the zone is supported π«Ά Beginning with Shorewall 4.4.1, multicast traffic to the zone is also supported.nets=dynamicβ defines the zone as dynamic. Requires ipset match support in your iptables and kernel, no cap. Seehttps://shorewall.org/Dynamic.html[12] for further information.nodblβ added in Shorewall 5.0.8. When specified, dynamic blacklisting is disabled on the interface π« Beginning with Shorewall 5.0.10,nodblis equivalent todbl=none.nosmurfsβ IPv4 only. Filters packets for smurfs β that's packets with a broadcast address as the source π
Smurfs will be optionally logged based on the setting of SMURF_LOG_LEVEL in shorewall.conf[7](5). After logging, the packets are dropped. Bye bestie. π
omitanycastβ IPv6 only. Added in Shorewall 5.2.8.
Shorewall6 has traditionally generated rules for IPv6 anycast addresses. These rules include:
- Packets with these destination IP addresses are dropped by REJECT rules.
- Packets with these source IP addresses are dropped by the
nosmurfsinterface option and by thedropSmurfsaction. - Packets with these destination IP addresses are not logged during policy enforcement.
- Packets with these destination IP addresses are processes by the
Broadcastaction.
This can be inhibited for individual interfaces by specifying noanycast for those interfaces.
Note β RFC 2526 describes IPv6 subnet anycast addresses. The RFC makes a distinction between subnets with "IPv6 address types required to have 64-bit interface identifiers in EUI-64 format" and all other subnets. When generating these anycast addresses, the Shorewall compiler does not make this distinction and unconditionally assumes that the last 128 addresses in the subnet are reserved as anycast addresses. π§
optionalβ this option indicates that the firewall should be able to start even if the interface is not usable for handling traffic πͺ It also allows use of theenableanddisablecommands on the interface.
When optional is specified for an interface, Shorewall will be silent when:
- a
/proc/sys/net/ipv[46]/conf/entry for the interface cannot be modified (including for proxy ARP or proxy NDP). - The first address of the interface cannot be obtained.
- The gateway of the interface can not be obtained (provider interface).
- The interface has been disabled using the
disablecommand.
May not be specified with required.
physical=nameβ added in Shorewall 4.4.4. When specified, the interface or port name in the INTERFACE column is a logical name that refers to the name given in this option. Super useful when you want to specify the same wildcard port name on two or more bridges π Seehttps://shorewall.org/bridge-Shorewall-perl.html#Multiple[13].
If the interface name is a wildcard name (ends with +), then the physical name must also end in +. The physical name may end in + (or be exactly +) when the interface name is not a wildcard name.
If physical is not specified, then it's value defaults to the interface name.
proxyarp[={0|1}]β IPv4 only. Sets/proc/sys/net/ipv4/conf/interface/proxy_arp. Do NOT use this option if you are employing Proxy ARP through entries inshorewall-proxyarp[14](5) π This option is intended solely for use with Proxy ARP sub-networking as described at:http://tldp.org/HOWTO/Proxy-ARP-Subnet/index.html.[15]
Note β this option does not work with a wild-card physical name (e.g., eth0.+). Beginning with Shorewall 5.1.10, if this option is specified, a warning is issued and the option is ignored. π
Only those interfaces with the proxyarp option will have their setting changed; the value assigned to the setting will be the value specified (if any) or 1 if no value is given.
proxyndp[={0|1}]β IPv6 only. Sets/proc/sys/net/ipv6/conf/interface/proxy_ndpπ¦
Note β this option does not work with a wild-card physical name (e.g., eth0.+). Beginning with Shorewall 5.1.10, if this option is specified, a warning is issued and the option is ignored. π
Only those interfaces with the proxyndp option will have their setting changed; the value assigned to the setting will be the value specified (if any) or 1 if no value is given.
requiredβ added in Shorewall 4.4.10. If this option is set, the firewall will fail to start if the interface is not usable π May not be specified together withoptional. Pick a lane.routeback[={0|1}]β if specified, indicates that Shorewall should include rules that allow traffic arriving on this interface to be routed back out that same interface π This option is also required when you have used a wildcard in the INTERFACE column if you want to allow traffic between the interfaces that match the wildcard.
Beginning with Shorewall 4.4.20, if you specify this option, then you should also specify either sfilter (see below) or routefilter on all interfaces (see below). Yeah, both. It's giving responsible firewall behavior β¨
Beginning with Shorewall 4.5.18, you may specify this option to explicitly reset (e.g., routeback=0). This can be used to override Shorewall's default setting for bridge devices which is routeback=1.
routefilter[={0|1|2}]β IPv4 only. Turn on kernel route filtering for this interface (anti-spoofing measure) π‘οΈ
Only those interfaces with the routefilter option will have their setting changes; the value assigned to the setting will be the value specified (if any) or 1 if no value is given.
The value 2 is only available with Shorewall 4.4.5.1 and later when the kernel version is 2.6.31 or later. It specifies a loose form of reverse path filtering.
Note β this option does not work with a wild-card physical name (e.g., eth0.+). Beginning with Shorewall 5.1.10, if this option is specified, a warning is issued and the option is ignored. π
This option can also be enabled globally via the ROUTE_FILTER option in the shorewall.conf[7](5) file.
Important β ifROUTE_FILTER=Yesinshorewall.conf[7](5), or if your distribution setsnet.ipv4.conf.all.rp_filter=1in/etc/sysctl.conf, then settingroutefilter=0in an interface entry will not disable route filtering on that interface! The effective setting for an interface is the maximum of the contents of/proc/sys/net/ipv4/conf/all/rp_filterand theroutefiltersetting specified in this file (/proc/sys/net/ipv4/conf/interface/rp_filter). π€
Note β there are certain cases whereroutefiltercannot be used on an interface: - IfUSE_DEFAULT_RT=Yesinshorewall.conf[7](5) and the interface is listed inshorewall-providers[16](5). - If there is an entry for the interface inshorewall-providers[16](5) that doesn't specify thebalanceoption. - If IPSEC is used to allow a road-warrior to have a local address, then any interface through which the road-warrior might connect cannot specifyroutefilter.
Beginning with Shorewall 5.1.1, when routefilter is set to a non-zero value, the logmartians option is also implicitly set. So if you actually want route filtering without logging, then you must also specify logmartians=0 after routefilter. Order matters, bestie. π
rpfilterβ okay so Added in Shorewall 4.5.7. This is literally an anti-spoofing measure that requires the 'RPFilter Match' capability in your iptables and kernel. It's giving more efficient alternative to thesfilteroption below. No cap, it performs a function similar toroutefilter(see above) but works with Multi-ISP configurations that do not use balanced routes. πsfilter=(net[,...])β bestie, Added in Shorewall 4.4.20. This option provides an anti-spoofing alternative toroutefilteron interfaces where that option cannot be used, but where theroutebackoption is required (on a bridge, for example). On these interfaces,sfiltershould list those local networks that are connected to the firewall through other interfaces. πΈsourceroute[={0|1}]β okay so if this option is not specified for an interface, then source-routed packets will not be accepted from that interface unless it has been explicitly enabled viasysconf. Only set this option to1(enable source routing) if you know what you are doing. This might represent a security risk and is usually unneeded. π¬ ngl, be careful.
Only those interfaces with the sourceroute option will have their setting changed; the value assigned to the setting will be the value specified (if any) or 1 if no value is given.
Note π This option does not work with a wild-card physical name (e.g., eth0.+). Beginning with Shorewall 5.1.10, If this option is specified, a warning is issued and the option is ignored.
tcpflags[={0|1}]β Packets arriving on this interface are checked for certain illegal combinations of TCP flags. Packets found to have such a combination of flags are handled according to the setting ofTCP_FLAGS_DISPOSITIONafter having been logged according to the setting ofTCP_FLAGS_LOG_LEVEL. π the way that works is wild.
Beginning with Shorewall 4.6.0, tcpflags=1 is the default. To disable this option, specify tcpflags=0.
unmanagedβ Added in Shorewall 4.5.18. Causes all traffic between the firewall and hosts on the interface to be accepted. When this option is given:- The
ZONEcolumn must contain'-'. - Only the following other options are allowed with
unmanaged:arp_filterarp_ignoreignoreroutefilteroptionalphysicalroutefilterproxyarpproxyudpsourceroute
- The
upnpβ Incoming requests from this interface may be remapped via UPNP (upnpd). Seehttps://shorewall.org/UPnP.html[17]. Supported in IPv4 and in IPv6 in Shorewall 5.1.4 and later. β¨ iconic.upnpclientβ This option is intended for laptop users who always run Shorewall on their system yet need to run UPnP-enabled client apps such as Transmission (BitTorrent client). The option causes Shorewall to detect the default gateway through the interface and to accept UDP packets from that gateway. Note that, like all aspects of UPnP, this is a security hole so use this option at your own risk. π literally, bestie, be careful. Supported in IPv4 and in IPv6 in Shorewall 5.1.4 and later.wait=secondsβ Added in Shorewall 4.4.10. Causes the generated script to wait up to seconds seconds for the interface to become usable before applying therequiredoroptionaloptions. β³ periodt.
π§ͺ EXAMPLE π§ͺ
IPv4 Example 1:
okay so picture this: you've got eth0 plugged into a DSL modem, and eth1 is your local network. Your local subnet is 192.168.1.0/24. The interface gets its IP via DHCP from subnet 206.191.149.192/27. You also have a DMZ with subnet 192.168.2.0/24 on eth2. Your iptables and/or kernel don't support "Address Type Match", and you'd rather specify broadcast addresses explicitly instead of letting Shorewall detect them. No cap.
Your entries for this setup would look like:
?FORMAT 1
#ZONE INTERFACE BROADCAST OPTIONS
net eth0 206.191.149.223 dhcp
loc eth1 192.168.1.255
dmz eth2 192.168.2.255
Example 2:
Same vibe, but without broadcast addresses:
?FORMAT 2
#ZONE INTERFACE OPTIONS
net eth0 dhcp
loc eth1
dmz eth2
Example 3:
You've got a simple dial-in system with no Ethernet connections at all.
?FORMAT 2
#ZONE INTERFACE OPTIONS
net ppp0 -
Example 4 (Shorewall 4.4.9 and later):
You've got a bridge with no IP address, and you want to let traffic through the bridge. iconic.
?FORMAT 2
#ZONE INTERFACE OPTIONS
- br0 bridge
π FILES π
/etc/shorewall/interfaces/etc/shorewall6/interfaces
π SEE ALSO π
π NOTES π
- shorewall-hosts β
https://shorewall.org/manpages/shorewall-hosts.html https://shorewall.org/FAQ.htm#faq18βhttps://shorewall.org/FAQ.htm#faq18- shorewall-nesting β
https://shorewall.org/manpages/shorewall-nesting.html - shorewall6-zones β
https://shorewall.org/manpages/shorewall-zones.html - Proxy ARP β
https://shorewall.org/ProxyARP.htm - shorewall-blacklist β
https://shorewall.org/manpages/shorewall-blacklist.html - shorewall.conf(5) β
https://shorewall.org/manpages/shorewall.conf.html - simple bridge β
https://shorewall.org/SimpleBridge.html - Shorewall-perl for firewall/bridging β
https://shorewall.org/bridge-Shorewall-perl.html - shorewall-rules β
https://shorewall.org/manpages/shorewall-rules.html - shorewall-maclist β
https://shorewall.org/manpages/shorewall-maclist.html https://shorewall.org/Dynamic.htmlβhttps://shorewall.org/Dynamic.htmlhttps://shorewall.org/bridge-Shorewall-perl.html#Multipleβhttps://shorewall.org/bridge-Shorewall-perl.html#Multiple- shorewall-proxyarp β
https://shorewall.org/manpages/shorewall-proxyarp.html http://tldp.org/HOWTO/Proxy-ARP-Subnet/index.html.βhttp://tldp.org/HOWTO/Proxy-ARP-Subnet/index.html- shorewall-providers β
https://shorewall.org/manpages/shorewall-providers.html https://shorewall.org/UPnP.htmlβhttps://shorewall.org/UPnP.htmlhttps://shorewall.org/configuration_file_basics.htm#Pairsβhttps://shorewall.org/configuration_file_basics.htm#Pairs
π And that's the whole vibe, bestie! This page comes from the Configuration Files section, dated 09/24/2020, and it's for SHOREWALL-INTERFACE(5). Now go make those interfaces behave. You got this. π
β¨
π¦ where this page comes from
- alpine 3.22: shorewall-doc 5.2.8-r1 Β· GPL-2.0-or-later
- alpine 3.23: shorewall-doc 5.2.8-r1 Β· GPL-2.0-or-later
- alpine 3.24: shorewall-doc 5.2.8-r1 Β· GPL-2.0-or-later
- debian bookworm: shorewall 5.2.8-2 Β· GPL-2.0-or-later
- debian trixie: shorewall 5.2.8-6 Β· GPL-2.0-or-later
- fedora 43: shorewall 5.2.8-17.fc43 Β· GPL-2.0-or-later
- fedora 44: shorewall 5.2.8-18.fc44 Β· GPL-2.0-or-later
- nixos 26.05: shorewall 5.2.8
- nixpkgs unstable: shorewall 5.2.8
- ubuntu noble: shorewall 5.2.8-5 Β· GPL-2.0-or-later
- ubuntu questing: shorewall 5.2.8-6
- ubuntu resolute: shorewall 5.2.8-6build1 Β· GPL-2.0-or-later
- ubuntu stonking: shorewall 5.2.8-6build1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms