{"id":4497,"date":"2022-12-20T18:08:49","date_gmt":"2022-12-20T21:08:49","guid":{"rendered":"http:\/\/lode.uno\/linux-man\/index.php\/2022\/12\/20\/shorewalltunnels-man5\/"},"modified":"2022-12-20T18:08:49","modified_gmt":"2022-12-20T21:08:49","slug":"shorewalltunnels-man5","status":"publish","type":"post","link":"https:\/\/lode.uno\/linux-man\/2022\/12\/20\/shorewalltunnels-man5\/","title":{"rendered":"SHOREWALL&minus;TUNNELS (man5)"},"content":{"rendered":"<h1 align=\"center\">SHOREWALL\u2212TUNNELS<\/h1>\n<p> <a href=\"#NAME\">NAME<\/a><br \/> <a href=\"#SYNOPSIS\">SYNOPSIS<\/a><br \/> <a href=\"#DESCRIPTION\">DESCRIPTION<\/a><br \/> <a href=\"#EXAMPLE\">EXAMPLE<\/a><br \/> <a href=\"#FILES\">FILES<\/a><br \/> <a href=\"#SEE ALSO\">SEE ALSO<\/a><br \/> <a href=\"#NOTES\">NOTES<\/a> <\/p>\n<hr>\n<h2>NAME <a name=\"NAME\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">tunnels \u2212 Shorewall VPN definition file<\/p>\n<h2>SYNOPSIS <a name=\"SYNOPSIS\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"11%\"><\/td>\n<td width=\"38%\">\n<p style=\"margin-top: 1em\"><b>\/etc\/shorewall[6]\/tunnels<\/b><\/p>\n<\/td>\n<td width=\"51%\"> <\/td>\n<\/tr>\n<\/table>\n<h2>DESCRIPTION <a name=\"DESCRIPTION\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\">The tunnels file is used to define rules for encapsulated (usually encrypted) traffic to pass between the Shorewall system and a remote gateway. Traffic flowing through the tunnel is handled using the normal zone\/policy\/rule mechanism. See <b><font color=\"#0000FF\">https:\/\/shorewall.org\/VPNBasics.html<\/font><\/b> <small><font color=\"#000000\">[1]<\/font><\/small> <font color=\"#000000\">for details.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\">The columns in the file are as follows.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><b>TYPE<\/b> \u2212 {<b>ipsec<\/b>[<b>:{noah<\/b>|ah}]|<b>ipsecnat<\/b>|<b>ipip<\/b>|<b>gre<\/b>|l2tp|<b>pptpclient<\/b>|<b>pptpserver<\/b>|?COMMENT|{<b>openvpn<\/b>|<b>openvpnclient<\/b>|<b>openvpnserver<\/b>}[:{<b>tcp<\/b>|<b>udp<\/b>}]<b>[<\/b>:<i>port<\/i>]|<b>generic:<\/b><i>protocol<\/i>[<b>:<\/b><i>port<\/i>]}<\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\">Types are as follows:<\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><b>6to4<\/b> or <b>6in4<\/b> \u2212 6to4 or 6in4 tunnel. The <b>6in4<\/b> synonym was added in 4.4.24. <b><br \/> ipsec<\/b> \u2212 IPv4 IPSEC <b><br \/> ipsecnat<\/b> \u2212 IPv4 IPSEC with NAT Traversal (UDP port 4500 encapsulation) <b><br \/> ipip<\/b> \u2212 IPv4 encapsulated in IPv4 (Protocol 4) <b><br \/> gre<\/b> \u2212 Generalized Routing Encapsulation (Protocol 47) <b><br \/> l2tp<\/b> \u2212 Layer 2 Tunneling Protocol (UDP port 1701) <b><br \/> pptpclient<\/b> \u2212 PPTP Client runs on the firewall <b><br \/> pptpserver<\/b> \u2212 PPTP Server runs on the firewall <b><br \/> openvpn<\/b> \u2212 OpenVPN in point\u2212to\u2212point mode <b><br \/> openvpnclient<\/b> \u2212 OpenVPN client runs on the firewall <b><br \/> openvpnserver<\/b> \u2212 OpenVPN server runs on the firewall <b><br \/> generic<\/b> \u2212 Other tunnel type <b><br \/> tinc<\/b> \u2212 TINC (added in Shorewall 4.6.6)<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">If the type is <b>ipsec<\/b>, it may be followed by <b>:ah<\/b> to indicate that the Authentication Headers protocol (51) is used by the tunnel (the default is <b>:noah<\/b> which means that protocol 51 is not used). NAT traversal is only supported with ESP (protocol 50) so <b>ipsecnat<\/b> tunnels don&#8217;t allow the <b>ah<\/b> option (<b>ipsecnat:noah<\/b> may be specified but is redundant).<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">If type is <b>openvpn<\/b>, <b>openvpnclient<\/b> or <b>openvpnserver<\/b> it may optionally be followed by &#8220;:&#8221; and <b>tcp<\/b> or <b>udp<\/b> to specify the protocol to be used. If not specified, <b>udp<\/b> is assumed.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">If type is <b>openvpn<\/b>, <b>openvpnclient<\/b> or <b>openvpnserver<\/b> it may optionally be followed by &#8220;:&#8221; and the port number used by the tunnel. if no &#8220;:&#8221; and port number are included, then the default port of 1194 will be used. . Where both the protocol and port are specified, the protocol must be given first (e.g., openvpn:tcp:4444).<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">If type is <b>generic<\/b>, it must be followed by &#8220;:&#8221; and a protocol name (from \/etc\/protocols) or a protocol number. If the protocol is <b>tcp<\/b> or <b>udp<\/b> (6 or 17), then it may optionally be followed by &#8220;:&#8221; and a port number.<\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\">Comments may be attached to Netfilter rules generated from entries in this file through the use of \/COMMENT lines. These lines begin with ?COMMENT; the remainder of the line is treated as a comment which is attached to subsequent rules until another ?COMMENT line is found or until the end of the file is reached. To stop adding comments to rules, use a line containing only ?COMMENT.<\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><b><big>Note<\/big><\/b> <br \/> Beginning with Shorewall 4.5.11, ?COMMENT is a synonym for COMMENT and is preferred.<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><b><big>ZONE<\/big><\/b> <big>\u2212 <i>zone<\/i><\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>The <i>zone<\/i> of the physical interface through which tunnel traffic passes. This is normally your internet zone.<\/big><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big><b>GATEWAY<\/b>(S) (gateway or gateways) \u2212 <i>address\u2212or\u2212range<\/i> <b>[ , &#8230; ]<\/b><\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>The IP address of the remote tunnel gateway. If the remote gateway has no fixed address (Road Warrior) then specify the gateway as <b>0.0.0.0\/0<\/b>. May be specified as a network address and if your kernel and iptables include iprange match support then IP address ranges are also allowed.<\/big><\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><big>Beginning with Shorewall 4.5.3, a list of addresses or ranges may be given. Exclusion (<\/big><\/font><big><b><font color=\"#0000FF\">shorewall\u2212exclusion<\/font><\/b><\/big> <font color=\"#000000\">[2] <big>(5) ) is not supported.<\/big><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big><b>GATEWAY ZONES<\/b> (gateway_zone or gateway_zones) \u2212 [<i>zone<\/i>[<b>,<\/b><i>zone<\/i>]&#8230;]<\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>Optional. If the gateway system specified in the third column is a standalone host then this column should contain a comma\u2212separated list of the names of the zones that the host might be in. This column only applies to IPSEC tunnels where it enables ISAKMP traffic to flow through the tunnel to the remote gateway(s).<\/big><\/font><\/p>\n<h2>EXAMPLE <a name=\"EXAMPLE\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>IPv4 Example 1:<\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>IPSec tunnel.<\/big><\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><big>The remote gateway is 4.33.99.124 and the remote subnet is 192.168.9.0\/24. The tunnel does not use the AH protocol<\/big><\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><big>#TYPE ZONE GATEWAY <br \/> ipsec:noah net 4.33.99.124<\/big><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>IPv4 Example 2:<\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>Road Warrior (LapTop that may connect from anywhere) where the &#8220;gw&#8221; zone is used to represent the remote LapTop<\/big><\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><big>#TYPE ZONE GATEWAY GATEWAY ZONES <br \/> ipsec net 0.0.0.0\/0 gw<\/big><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>IPv4 Example 3:<\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>Host 4.33.99.124 is a standalone system connected via an ipsec tunnel to the firewall system. The host is in zone gw.<\/big><\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><big>#TYPE ZONE GATEWAY GATEWAY ZONES <br \/> ipsec net 4.33.99.124 gw<\/big><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>IPv4 Example 4:<\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>Road Warriors that may belong to zones vpn1, vpn2 or vpn3. The FreeS\/Wan _updown script will add the host to the appropriate zone using the <b>shorewall add<\/b> command on connect and will remove the host from the zone at disconnect time.<\/big><\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><big>#TYPE ZONE GATEWAY GATEWAY ZONES <br \/> ipsec net 0.0.0.0\/0 vpn1,vpn2,vpn3<\/big><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>IPv4 Example 5:<\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>You run the Linux PPTP client on your firewall and connect to server 192.0.2.221.<\/big><\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><big>#TYPE ZONE GATEWAY GATEWAY ZONES <br \/> pptpclient net 192.0.2.221<\/big><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>IPv4 Example 6:<\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>You run a PPTP server on your firewall.<\/big><\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><big>#TYPE ZONE GATEWAY GATEWAY ZONES <br \/> pptpserver net 0.0.0.0\/0<\/big><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>Example 7:<\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>OPENVPN tunnel. The remote gateway is 4.33.99.124 and openvpn uses port 7777.<\/big><\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><big>#TYPE ZONE GATEWAY GATEWAY ZONES <br \/> openvpn:7777 net 4.33.99.124<\/big><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>IPv4 Example 8:<\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>You have a tunnel that is not one of the supported types. Your tunnel uses UDP port 4444. The other end of the tunnel is 4.3.99.124.<\/big><\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><big>#TYPE ZONE GATEWAY GATEWAY ZONES <br \/> generic:udp:4444 net 4.3.99.124<\/big><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>IPv4 Example 9:<\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>TINC tunnel where the remote gateways are not specified. If you wish to specify a list of gateways, you can do so in the GATEWAY column.<\/big><\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><big>#TYPE ZONE GATEWAY GATEWAY ZONES <br \/> tinc net 0.0.0.0\/0<\/big><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>IPv6 Example 1:<\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>IPSec tunnel.<\/big><\/font><\/p>\n<p style=\"margin-left:17%; margin-top: 1em\"><font color=\"#000000\"><big>The remote gateway is 2001:cec792b4:1::44. The tunnel does not use the AH protocol<\/big><\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><big>#TYPE ZONE GATEWAY <br \/> ipsec:noah net 2002:cec792b4:1::44<\/big><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>IPv6 Example 2:<\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>Road Warrior (LapTop that may connect from anywhere) where the &#8220;gw&#8221; zone is used to represent the remote LapTop<\/big><\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><big>#TYPE ZONE GATEWAY GATEWAY ZONES <br \/> ipsec net ::\/0 gw<\/big><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>IPv6 Example 3:<\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>Host 2001:cec792b4:1::44 is a standalone system connected via an ipsec tunnel to the firewall system. The host is in zone gw.<\/big><\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><big>#TYPE ZONE GATEWAY GATEWAY ZONES <br \/> ipsec net 2001:cec792b4:1::44 gw<\/big><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>IPv6 Example 4:<\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>OPENVPN tunnel. The remote gateway is 2001:cec792b4:1::44 and openvpn uses port 7777.<\/big><\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><big>#TYPE ZONE GATEWAY GATEWAY ZONES <br \/> openvpn:7777 net 2001:cec792b4:1::44<\/big><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>IPv6 Example 8:<\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>You have a tunnel that is not one of the supported types. Your tunnel uses UDP port 4444. The other end of the tunnel is 2001:cec792b4:1::44.<\/big><\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><big>#TYPE ZONE GATEWAY GATEWAY ZONES <br \/> generic:udp:4444 net 2001:cec792b4:1::44<\/big><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>IPv6 Example 9:<\/big><\/font><\/p>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>TINC tunnel where the remote gateways are not specified. If you wish to specify a list of gateways, you can do so in the GATEWAY column.<\/big><\/font><\/p>\n<p style=\"margin-left:23%; margin-top: 1em\"><font color=\"#000000\"><big>#TYPE ZONE GATEWAY GATEWAY ZONES <br \/> tinc net ::\/0<\/big><\/font><\/p>\n<h2>FILES <a name=\"FILES\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>\/etc\/shorewall\/tunnels<\/big><\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>\/etc\/shorewall6\/tunnels<\/big><\/font><\/p>\n<h2>SEE ALSO <a name=\"SEE ALSO\"><\/a> <\/h2>\n<p style=\"margin-left:11%; margin-top: 1em\"><big><b><font color=\"#0000FF\">https:\/\/shorewall.org\/configuration_file_basics.htm#Pairs<\/font><\/b><\/big> <font color=\"#000000\">[3]<\/font><\/p>\n<p style=\"margin-left:11%; margin-top: 1em\"><font color=\"#000000\"><big>shorewall(8)<\/big><\/font><\/p>\n<h2>NOTES <a name=\"NOTES\"><\/a> <\/h2>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"3%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\"><big>1.<\/big><\/font><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"55%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\"><big>https:\/\/shorewall.org\/VPNBasics.html<\/big><\/font><\/p>\n<\/td>\n<td width=\"28%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>https:\/\/shorewall.org\/VPNBasics.html<\/big><\/font><\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"3%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\"><big>2.<\/big><\/font><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"29%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\"><big>shorewall-exclusion<\/big><\/font><\/p>\n<\/td>\n<td width=\"54%\"> <\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>https:\/\/shorewall.org\/manpages\/shorewall-exclusion.html<\/big><\/font><\/p>\n<table width=\"100%\" border=\"0\" rules=\"none\" frame=\"void\" cellspacing=\"0\" cellpadding=\"0\">\n<tr valign=\"top\" align=\"left\">\n<td width=\"12%\"><\/td>\n<td width=\"3%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\"><big>3.<\/big><\/font><\/p>\n<\/td>\n<td width=\"2%\"><\/td>\n<td width=\"83%\">\n<p style=\"margin-top: 1em\"><font color=\"#000000\"><big>https:\/\/shorewall.org\/configuration_file_basics.htm#Pairs<\/big><\/font><\/p>\n<\/td>\n<\/tr>\n<\/table>\n<p style=\"margin-left:17%;\"><font color=\"#000000\"><big>https:\/\/shorewall.org\/configuration_file_basics.htm#Pairs<\/big><\/font><\/p>\n<hr>\n","protected":false},"excerpt":{"rendered":"<p>  tunnels \u2212 Shorewall VPN definition file <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[959],"tags":[961,1291,1467],"class_list":["post-4497","post","type-post","status-publish","format-standard","hentry","category-5-formatos-de-ficheros","tag-961","tag-man5","tag-shorewall-tunnels"],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4497","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/comments?post=4497"}],"version-history":[{"count":0,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/posts\/4497\/revisions"}],"wp:attachment":[{"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/media?parent=4497"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/categories?post=4497"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lode.uno\/linux-man\/wp-json\/wp\/v2\/tags?post=4497"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}