<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.ampr.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kb3vwg</id>
	<title>44Net Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.ampr.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Kb3vwg"/>
	<link rel="alternate" type="text/html" href="https://wiki.ampr.org/wiki/Special:Contributions/Kb3vwg"/>
	<updated>2026-04-14T22:11:45Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.42.3</generator>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Services&amp;diff=1094</id>
		<title>Services</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Services&amp;diff=1094"/>
		<updated>2024-04-24T15:22:32Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: remove N1URO SK N1URO N1URO&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maintainer !! Service Name!! URL/IP !! Service Type !! Description !! Other Information&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[Portal]] ||  https://portal.ampr.org || HTTPS || manage [[Gateway]], [[Encap.txt]] preferences and ampr.org domain entries (domain entry functionality still under development)|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||Website ||  https://www.ampr.org || HTTPS || AMPRNet Main Page|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||Wiki ||  https://wiki.ampr.org || HTTPS || This Wiki|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||44Net discussion group ||  https://ardc.groups.io/g/44net || HTTPS || AMPR discussion group|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||ARDC announcements ||  https://ardc.groups.io/g/main || HTTPS || ARDC announcements|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||AMPRNet [[Gateway]] (AMPRGW) || 169.228.34.84 || IP and IPENCAP [[Tunnel]]|| main AMPRNet Router|| Gateways use IP Protocol 4 (IPENCAP) to receive traffic via AMPRGW. Allocation must be registered in the [[Portal]] and gateways must run an AMPRNet routing protocol (i.e. [[RIP]]44 or [[munge script]]).&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[RIP]]44 || provided via [https://en.wikipedia.org/wiki/Broadcasting_%28networking%29 broadcast] from 44.0.0.1 to all [[gateway]]s registered in the [[portal]] || Routing Information (modified RIPv2 protocol) || distributed by main AMPRNet Router to multicast address 224.0.0.9|| 1.) an enabled IPENCAP tunnel, and 2.) [[ampr-ripd]] or [[rip44d]] must be running and properly configured on your registered gateway&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[Encap.txt]] || N/A || Routing Information (EMAIL/FTP/HTTP)|| routing information for download|| file must be must be parsed by a self-developed [[munge script]]&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators||[[Ampr.org]] DNS and Reverse DNS (44.in-addr.arpa) ||&lt;br /&gt;
(These hosts are authoritative for AMPR.ORG and the 44.IN-ADDR.ARPA DNS Zones:)&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
gw.ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
ns.ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
a.gw4.uk&amp;lt;br /&amp;gt;&lt;br /&gt;
ns2.us.ardc.net&amp;lt;br /&amp;gt;&lt;br /&gt;
ns1.de.ardc.net&amp;lt;br /&amp;gt;&lt;br /&gt;
(These hosts maintain a copy of AMPR.ORG and the &#039;[0-191].44.in-addr.arpa&#039; DNS Zones. 44.0/9 thru 44.128/10 hosts may use as recursive/Client DNS servers:)&amp;lt;br /&amp;gt;&lt;br /&gt;
dns-mdc.ampr.org (44.60.44.3 - also copy of HAMWAN.ORG)&amp;lt;br /&amp;gt;&lt;br /&gt;
|| DNS || name resolution services|| zone files can be downloaded from ftp://gw.ampr.org/pub/&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators||Network Tools||&lt;br /&gt;
http://whatismyip.ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
http://yo2tm.ampr.org/nettools.php&amp;lt;br /&amp;gt;&lt;br /&gt;
http://kb3vwg-010.ampr.org/tools&amp;lt;br /&amp;gt;&lt;br /&gt;
http://speedtest.ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
http://n1uro.ampr.org/do.shtml&amp;lt;br /&amp;gt;&lt;br /&gt;
 || HTTP|| source IP checker, speed test, Ping, Traceroute, etc.|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators ||Network Time Protocol Server || gw.ampr.org (Stratum 1, US)&amp;lt;br /&amp;gt;ntp.vk2hff.ampr.org (Stratum 1, AU)&amp;lt;br /&amp;gt;ntp.g1fef.ampr.org (Stratum 1, UK)&amp;lt;br /&amp;gt;kb3vwg-001.ampr.org (Stratum 2, US)&amp;lt;br /&amp;gt;gw-44-137.pi9noz.ampr.org (Stratum 2)&amp;lt;br /&amp;gt;server.yo2loj.ampr.org (Stratum 2)&amp;lt;br /&amp;gt;f4gve.ampr.org (Stratum 3)&amp;lt;br /&amp;gt;ntp1.on3rvh.ampr.org&amp;lt;br /&amp;gt; || NTP|| Stratum 2 Network Time Server - References US, Canadian and Mexican|| AMPRNet hosts have OPEN ACCESS to these time servers &lt;br /&gt;
|-&lt;br /&gt;
| OH7LZB ||[[AMPRNet_VPN]] || http://wiki.ampr.org/wiki/AMPRNet_VPN || VPN|| [http://en.wikipedia.org/wiki/OpenVPN OpenVPN]-based || You must have a X.509 certificate issued by [http://www.arrl.org/logbook-of-the-world ARRL Logbook of the World (LoTW)]. ARRL membership is not required.&lt;br /&gt;
|-&lt;br /&gt;
| N1URO  ||AMPRNet/RF faxing || http://wiki.ampr.org/wiki/axMail-FAX || Facsimile || Online IP based Facsimile service. You have the ability to send emergency communications from packet via Fax. || [http://axmail.sourceforge.net axMail-FAX] Sofware is here.&lt;br /&gt;
|-&lt;br /&gt;
| [http://allstarlink.org AllStar Link] || AllStar || http://allstarlink.org || Linking of repeaters || AllStar Link core network services are provided via redundant datacenters using 44net IP space.  || [https://wiki.allstarlink.org/wiki/Main_Page ASL wiki]&lt;br /&gt;
|-&lt;br /&gt;
| N2NOV and G1FEF || Hub_NA and Hub_EU for WWconvers Chat System || 44.68.41.2:3600&amp;lt;br /&amp;gt;44.1.1.25:3600 || Telnet || Only connections from other 44Net addresses allowed using port 3600. Stations like JNOS with a built-in local chat server can link to it.&amp;lt;br /&amp;gt; Individuals without a local chat portal can use an IRC client to a public IP address that must be arranged with the owner. || None&lt;br /&gt;
|-&lt;br /&gt;
| N2NOV || AMPRNet NE US Regional Portal || http://n2nov.ampr.org/hamgate.html || HTTP || AMPRNet NE US Regional Portal || None&lt;br /&gt;
|-&lt;br /&gt;
| [https://flscg.org/ FSG]|| HamWAN Remote || https://flscg.org/2022/04/hamwan-remote/ || VPN/BGP || We provide a VPN based remote site connection to [https://flscg.org/hamwan/ HamWAN Tampa] and can announce your IP space.  Performance of over 1gbit/s is possible and we provide an local connection point for amateurs in the South East || https://wiki.w9cr.net/index.php/HamWAN_Remote_Site &lt;br /&gt;
|-&lt;br /&gt;
| [https://hamwan.org HamWAN]||[https://hamwan.org/Labs/Open%20Peering%20Policy.html OPP Website]||Open Peering ||BGP feed||We provide IPsec VPN w/ BGP peering + Internet announcing.||&lt;br /&gt;
|-}&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Services&amp;diff=1093</id>
		<title>Services</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Services&amp;diff=1093"/>
		<updated>2024-04-24T15:20:39Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maintainer !! Service Name!! URL/IP !! Service Type !! Description !! Other Information&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[Portal]] ||  https://portal.ampr.org || HTTPS || manage [[Gateway]], [[Encap.txt]] preferences and ampr.org domain entries (domain entry functionality still under development)|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||Website ||  https://www.ampr.org || HTTPS || AMPRNet Main Page|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||Wiki ||  https://wiki.ampr.org || HTTPS || This Wiki|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||44Net discussion group ||  https://ardc.groups.io/g/44net || HTTPS || AMPR discussion group|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||ARDC announcements ||  https://ardc.groups.io/g/main || HTTPS || ARDC announcements|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||AMPRNet [[Gateway]] (AMPRGW) || 169.228.34.84 || IP and IPENCAP [[Tunnel]]|| main AMPRNet Router|| Gateways use IP Protocol 4 (IPENCAP) to receive traffic via AMPRGW. Allocation must be registered in the [[Portal]] and gateways must run an AMPRNet routing protocol (i.e. [[RIP]]44 or [[munge script]]).&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[RIP]]44 || provided via [https://en.wikipedia.org/wiki/Broadcasting_%28networking%29 broadcast] from 44.0.0.1 to all [[gateway]]s registered in the [[portal]] || Routing Information (modified RIPv2 protocol) || distributed by main AMPRNet Router to multicast address 224.0.0.9|| 1.) an enabled IPENCAP tunnel, and 2.) [[ampr-ripd]] or [[rip44d]] must be running and properly configured on your registered gateway&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[Encap.txt]] || N/A || Routing Information (EMAIL/FTP/HTTP)|| routing information for download|| file must be must be parsed by a self-developed [[munge script]]&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators||[[Ampr.org]] DNS and Reverse DNS (44.in-addr.arpa) ||&lt;br /&gt;
(These hosts are authoritative for AMPR.ORG and the 44.IN-ADDR.ARPA DNS Zones:)&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
gw.ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
ns.ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
a.gw4.uk&amp;lt;br /&amp;gt;&lt;br /&gt;
ns2.us.ardc.net&amp;lt;br /&amp;gt;&lt;br /&gt;
ns1.de.ardc.net&amp;lt;br /&amp;gt;&lt;br /&gt;
(These hosts maintain a copy of AMPR.ORG and the &#039;[0-191].44.in-addr.arpa&#039; DNS Zones. 44.0/9 thru 44.128/10 hosts may use as recursive/Client DNS servers:)&amp;lt;br /&amp;gt;&lt;br /&gt;
dns-mdc.ampr.org (44.60.44.3)&amp;lt;br /&amp;gt;&lt;br /&gt;
|| DNS || name resolution services|| zone files can be downloaded from ftp://gw.ampr.org/pub/&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators||Network Tools||&lt;br /&gt;
http://whatismyip.ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
http://yo2tm.ampr.org/nettools.php&amp;lt;br /&amp;gt;&lt;br /&gt;
http://kb3vwg-010.ampr.org/tools&amp;lt;br /&amp;gt;&lt;br /&gt;
http://speedtest.ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
http://n1uro.ampr.org/do.shtml&amp;lt;br /&amp;gt;&lt;br /&gt;
 || HTTP|| source IP checker, speed test, Ping, Traceroute, etc.|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators ||Network Time Protocol Server || gw.ampr.org (Stratum 1, US)&amp;lt;br /&amp;gt;ntp.vk2hff.ampr.org (Stratum 1, AU)&amp;lt;br /&amp;gt;ntp.g1fef.ampr.org (Stratum 1, UK)&amp;lt;br /&amp;gt;kb3vwg-001.ampr.org (Stratum 2, US)&amp;lt;br /&amp;gt;gw-44-137.pi9noz.ampr.org (Stratum 2)&amp;lt;br /&amp;gt;server.yo2loj.ampr.org (Stratum 2)&amp;lt;br /&amp;gt;f4gve.ampr.org (Stratum 3)&amp;lt;br /&amp;gt;ntp1.on3rvh.ampr.org&amp;lt;br /&amp;gt; || NTP|| Stratum 2 Network Time Server - References US, Canadian and Mexican|| AMPRNet hosts have OPEN ACCESS to these time servers &lt;br /&gt;
|-&lt;br /&gt;
| OH7LZB ||[[AMPRNet_VPN]] || http://wiki.ampr.org/wiki/AMPRNet_VPN || VPN|| [http://en.wikipedia.org/wiki/OpenVPN OpenVPN]-based || You must have a X.509 certificate issued by [http://www.arrl.org/logbook-of-the-world ARRL Logbook of the World (LoTW)]. ARRL membership is not required.&lt;br /&gt;
|-&lt;br /&gt;
| N1URO  ||AMPRNet/RF faxing || http://wiki.ampr.org/wiki/axMail-FAX || Facsimile || Online IP based Facsimile service. You have the ability to send emergency communications from packet via Fax. || [http://axmail.sourceforge.net axMail-FAX] Sofware is here.&lt;br /&gt;
|-&lt;br /&gt;
| [http://allstarlink.org AllStar Link] || AllStar || http://allstarlink.org || Linking of repeaters || AllStar Link core network services are provided via redundant datacenters using 44net IP space.  || [https://wiki.allstarlink.org/wiki/Main_Page ASL wiki]&lt;br /&gt;
|-&lt;br /&gt;
| N2NOV and G1FEF || Hub_NA and Hub_EU for WWconvers Chat System || 44.68.41.2:3600&amp;lt;br /&amp;gt;44.1.1.25:3600 || Telnet || Only connections from other 44Net addresses allowed using port 3600. Stations like JNOS with a built-in local chat server can link to it.&amp;lt;br /&amp;gt; Individuals without a local chat portal can use an IRC client to a public IP address that must be arranged with the owner. || None&lt;br /&gt;
|-&lt;br /&gt;
| N2NOV || AMPRNet NE US Regional Portal || http://n2nov.ampr.org/hamgate.html || HTTP || AMPRNet NE US Regional Portal || None&lt;br /&gt;
|-&lt;br /&gt;
| [https://flscg.org/ FSG]|| HamWAN Remote || https://flscg.org/2022/04/hamwan-remote/ || VPN/BGP || We provide a VPN based remote site connection to [https://flscg.org/hamwan/ HamWAN Tampa] and can announce your IP space.  Performance of over 1gbit/s is possible and we provide an local connection point for amateurs in the South East || https://wiki.w9cr.net/index.php/HamWAN_Remote_Site &lt;br /&gt;
|-&lt;br /&gt;
| [https://hamwan.org HamWAN]||[https://hamwan.org/Labs/Open%20Peering%20Policy.html OPP Website]||Open Peering ||BGP feed||We provide IPsec VPN w/ BGP peering + Internet announcing.||&lt;br /&gt;
|-}&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Services&amp;diff=935</id>
		<title>Services</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Services&amp;diff=935"/>
		<updated>2022-03-15T23:54:19Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: added by request of N2NOV - added NE US AMPRNet Regional Portal&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maintainer !! Service Name!! URL/IP !! Service Type !! Description !! Other Information&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[Portal]] ||  https://portal.ampr.org || HTTPS || manage [[Gateway]], [[Encap.txt]] preferences and ampr.org domain entries (domain entry functionality still under development)|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||Website ||  http://www.ampr.org || HTTP || AMPRNet Main Page|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||Wiki ||  http://wiki.ampr.org || HTTP || This Wiki|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[44Net mailing list]] ||  https://mailman.ampr.org/mailman/listinfo/44net || HTTP || mailing list discussion|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||AMPRNet [[Gateway]] (AMPRGW) || 169.228.34.84 || IP and IPENCAP [[Tunnel]]|| main AMPRNet Router|| Gateways use IP Protocol 4 (IPENCAP) to receive traffic via AMPRGW. Allocation must be registered in the [[Portal]] and gateways must run an AMPRNet routing protocol (i.e. [[RIP]]44 or [[munge script]]).&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[RIP]]44 || provided via [https://en.wikipedia.org/wiki/Broadcasting_%28networking%29 broadcast] from 44.0.0.1 to all [[gateway]]s registered in the [[portal]] || Routing Information (modified RIPv2 protocol) || distributed by main AMPRNet Router to multicast address 224.0.0.9|| 1.) an enabled IPENCAP tunnel, and 2.) [[ampr-ripd]] or [[rip44d]] must be running and properly configured on your registered gateway&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[Encap.txt]] || N/A || Routing Information (EMAIL/FTP/HTTP)|| routing information for download|| file must be must be parsed by a self-developed [[munge script]]&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators||[[Ampr.org]] DNS and Reverse DNS (44.in-addr.arpa) ||&lt;br /&gt;
(These hosts maintain a copy of AMPR.ORG and the 44.IN-ADDR.ARPA DNS Zones:)&lt;br /&gt;
&amp;lt;br /&amp;gt;ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
ns2.threshinc.com&amp;lt;br /&amp;gt;&lt;br /&gt;
munnari.OZ.AU&amp;lt;br /&amp;gt;&lt;br /&gt;
a.coreservers.uk&amp;lt;br /&amp;gt;&lt;br /&gt;
ampr-dns.in-berlin.de&amp;lt;br /&amp;gt;&lt;br /&gt;
(These hosts maintain a copy of AMPR.ORG and the 44.in-addr.arpa DNS Zones. 44/8 hosts may use as recursive/Client DNS servers:)&amp;lt;br /&amp;gt;&lt;br /&gt;
gw.ct.ampr.org (44.88.0.1)&amp;lt;br /&amp;gt;&lt;br /&gt;
dns-mdc.ampr.org (44.60.44.3)&amp;lt;br /&amp;gt;&lt;br /&gt;
n1uro.ampr.org (44.88.0.9)&lt;br /&gt;
|| DNS || name resolution services|| zone files can be downloaded from ftp://gw.ampr.org/pub/&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators||Network Tools||&lt;br /&gt;
http://whatismyip.ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
http://yo2tm.ampr.org/nettools.php&amp;lt;br /&amp;gt;&lt;br /&gt;
http://kb3vwg-010.ampr.org/tools&amp;lt;br /&amp;gt;&lt;br /&gt;
http://speedtest.ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
http://n1uro.ampr.org/do.shtml&amp;lt;br /&amp;gt;&lt;br /&gt;
 || HTTP|| source IP checker, speed test, Ping, Traceroute, etc.|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators ||Network Time Protocol Server || gw.ampr.org (Stratum 1, US)&amp;lt;br /&amp;gt;ntp.vk2hff.ampr.org (Stratum 1, AU)&amp;lt;br /&amp;gt;ntp.g1fef.ampr.org (Stratum 1, UK)&amp;lt;br /&amp;gt;kb3vwg-001.ampr.org (Stratum 2, US)&amp;lt;br /&amp;gt;gw-44-137.pi9noz.ampr.org (Stratum 2)&amp;lt;br /&amp;gt;server.yo2loj.ampr.org (Stratum 2)&amp;lt;br /&amp;gt;f4gve.ampr.org (Stratum 3)&amp;lt;br /&amp;gt;ntp1.on3rvh.ampr.org&amp;lt;br /&amp;gt; || NTP|| Stratum 2 Network Time Server - References US, Canadian and Mexican|| AMPRNet hosts have OPEN ACCESS to these time servers &lt;br /&gt;
|-&lt;br /&gt;
| OH7LZB ||[[AMPRNet_VPN]] || http://wiki.ampr.org/wiki/AMPRNet_VPN || VPN|| [http://en.wikipedia.org/wiki/OpenVPN OpenVPN]-based || You must have a X.509 certificate issued by [http://www.arrl.org/logbook-of-the-world ARRL Logbook of the World (LoTW)]. ARRL membership is not required.&lt;br /&gt;
|-&lt;br /&gt;
| N1URO  ||AMPRNet/RF faxing || http://wiki.ampr.org/wiki/axMail-FAX || Facsimile || Online IP based Facsimile service. You have the ability to send emergency communications from packet via Fax. || [http://axmail.sourceforge.net axMail-FAX] Sofware is here.&lt;br /&gt;
|-&lt;br /&gt;
| [http://allstarlink.org AllStar Link] || AllStar || http://allstarlink.org || Linking of repeaters || AllStar Link core network services are provided via redundant datacenters using 44net IP space.  || [https://wiki.allstarlink.org/wiki/Main_Page ASL wiki]&lt;br /&gt;
|-&lt;br /&gt;
| N2NOV and G1FEEF || Hub_NA and Hub_EU for WWconvers Chat System || 44.68.41.2:3600&amp;lt;br /&amp;gt;44.1.1.25:3600 || Telnet || Only connections from other 44Net addresses allowed using port 3600. Stations like JNOS with a built-in local chat server can link to it.&amp;lt;br /&amp;gt; Individuals without a local chat portal can use an IRC client to a public IP address that must be arranged with the owner. || None&lt;br /&gt;
|-&lt;br /&gt;
| N2NOV || AMPRNet NE US Regional Portal || http://n2nov.ampr.org/hamgate.html || HTTP || AMPRNet NE US Regional Portal || None&lt;br /&gt;
|-}&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Services&amp;diff=933</id>
		<title>Services</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Services&amp;diff=933"/>
		<updated>2022-02-05T18:40:00Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: added Hub_NA and Hub_EU for WWconvers Chat System&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maintainer !! Service Name!! URL/IP !! Service Type !! Description !! Other Information&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[Portal]] ||  https://portal.ampr.org || HTTPS || manage [[Gateway]], [[Encap.txt]] preferences and ampr.org domain entries (domain entry functionality still under development)|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||Website ||  http://www.ampr.org || HTTP || AMPRNet Main Page|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||Wiki ||  http://wiki.ampr.org || HTTP || This Wiki|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[44Net mailing list]] ||  https://mailman.ampr.org/mailman/listinfo/44net || HTTP || mailing list discussion|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||AMPRNet [[Gateway]] (AMPRGW) || 169.228.34.84 || IP and IPENCAP [[Tunnel]]|| main AMPRNet Router|| Gateways use IP Protocol 4 (IPENCAP) to receive traffic via AMPRGW. Allocation must be registered in the [[Portal]] and gateways must run an AMPRNet routing protocol (i.e. [[RIP]]44 or [[munge script]]).&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[RIP]]44 || provided via [https://en.wikipedia.org/wiki/Broadcasting_%28networking%29 broadcast] from 44.0.0.1 to all [[gateway]]s registered in the [[portal]] || Routing Information (modified RIPv2 protocol) || distributed by main AMPRNet Router to multicast address 224.0.0.9|| 1.) an enabled IPENCAP tunnel, and 2.) [[ampr-ripd]] or [[rip44d]] must be running and properly configured on your registered gateway&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[Encap.txt]] || N/A || Routing Information (EMAIL/FTP/HTTP)|| routing information for download|| file must be must be parsed by a self-developed [[munge script]]&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators||[[Ampr.org]] DNS and Reverse DNS (44.in-addr.arpa) ||&lt;br /&gt;
(These hosts maintain a copy of AMPR.ORG and the 44.IN-ADDR.ARPA DNS Zones:)&lt;br /&gt;
&amp;lt;br /&amp;gt;ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
ns2.threshinc.com&amp;lt;br /&amp;gt;&lt;br /&gt;
munnari.OZ.AU&amp;lt;br /&amp;gt;&lt;br /&gt;
a.coreservers.uk&amp;lt;br /&amp;gt;&lt;br /&gt;
ampr-dns.in-berlin.de&amp;lt;br /&amp;gt;&lt;br /&gt;
(These hosts maintain a copy of AMPR.ORG and the 44.in-addr.arpa DNS Zones. 44/8 hosts may use as recursive/Client DNS servers:)&amp;lt;br /&amp;gt;&lt;br /&gt;
gw.ct.ampr.org (44.88.0.1)&amp;lt;br /&amp;gt;&lt;br /&gt;
dns-mdc.ampr.org (44.60.44.3)&amp;lt;br /&amp;gt;&lt;br /&gt;
n1uro.ampr.org (44.88.0.9)&lt;br /&gt;
|| DNS || name resolution services|| zone files can be downloaded from ftp://gw.ampr.org/pub/&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators||Network Tools||&lt;br /&gt;
http://whatismyip.ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
http://yo2tm.ampr.org/nettools.php&amp;lt;br /&amp;gt;&lt;br /&gt;
http://kb3vwg-010.ampr.org/tools&amp;lt;br /&amp;gt;&lt;br /&gt;
http://speedtest.ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
http://n1uro.ampr.org/do.shtml&amp;lt;br /&amp;gt;&lt;br /&gt;
 || HTTP|| source IP checker, speed test, Ping, Traceroute, etc.|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators ||Network Time Protocol Server || gw.ampr.org (Stratum 1, US)&amp;lt;br /&amp;gt;ntp.vk2hff.ampr.org (Stratum 1, AU)&amp;lt;br /&amp;gt;ntp.g1fef.ampr.org (Stratum 1, UK)&amp;lt;br /&amp;gt;kb3vwg-001.ampr.org (Stratum 2, US)&amp;lt;br /&amp;gt;gw-44-137.pi9noz.ampr.org (Stratum 2)&amp;lt;br /&amp;gt;server.yo2loj.ampr.org (Stratum 2)&amp;lt;br /&amp;gt;f4gve.ampr.org (Stratum 3)&amp;lt;br /&amp;gt;ntp1.on3rvh.ampr.org&amp;lt;br /&amp;gt; || NTP|| Stratum 2 Network Time Server - References US, Canadian and Mexican|| AMPRNet hosts have OPEN ACCESS to these time servers &lt;br /&gt;
|-&lt;br /&gt;
| OH7LZB ||[[AMPRNet_VPN]] || http://wiki.ampr.org/wiki/AMPRNet_VPN || VPN|| [http://en.wikipedia.org/wiki/OpenVPN OpenVPN]-based || You must have a X.509 certificate issued by [http://www.arrl.org/logbook-of-the-world ARRL Logbook of the World (LoTW)]. ARRL membership is not required.&lt;br /&gt;
|-&lt;br /&gt;
| N1URO  ||AMPRNet/RF faxing || http://wiki.ampr.org/wiki/axMail-FAX || Facsimile || Online IP based Facsimile service. You have the ability to send emergency communications from packet via Fax. || [http://axmail.sourceforge.net axMail-FAX] Sofware is here.&lt;br /&gt;
|-&lt;br /&gt;
| [http://allstarlink.org AllStar Link] || AllStar || http://allstarlink.org || Linking of repeaters || AllStar Link core network services are provided via redundant datacenters using 44net IP space.  || [https://wiki.allstarlink.org/wiki/Main_Page ASL wiki]&lt;br /&gt;
|-&lt;br /&gt;
| N2NOV and G1FEEF || Hub_NA and Hub_EU for WWconvers Chat System || 44.68.41.2:3600&amp;lt;br /&amp;gt;44.1.1.25:3600 || Telnet || Only connections from other 44Net addresses allowed using port 3600. Stations like JNOS with a built-in local chat server can link to it.&amp;lt;br /&amp;gt; Individuals without a local chat portal can use an IRC client to a public IP address that must be arranged with the owner. || None&lt;br /&gt;
|-}&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=44Net_mailing_list&amp;diff=892</id>
		<title>44Net mailing list</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=44Net_mailing_list&amp;diff=892"/>
		<updated>2020-11-24T22:12:01Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: updated 44 mailing list URL&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [https://mailman.ampr.org/mailman/listinfo/44net working group discussion list] is a mailing list where amprnet users and gateway operators discuss all things [[AMPRNet]]. Subscribe and browse the archives to learn more!&lt;br /&gt;
&lt;br /&gt;
* [https://mailman.ampr.org/mailman/listinfo/44net https://mailman.ampr.org/mailman/listinfo/44net]&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Services&amp;diff=891</id>
		<title>Services</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Services&amp;diff=891"/>
		<updated>2020-11-24T22:11:15Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: updated 44 mailing list URL&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maintainer !! Service Name!! URL/IP !! Service Type !! Description !! Other Information&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[Portal]] ||  https://portal.ampr.org || HTTPS || manage [[Gateway]], [[Encap.txt]] preferences and ampr.org domain entries (domain entry functionality still under development)|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||Website ||  http://www.ampr.org || HTTP || AMPRNet Main Page|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||Wiki ||  http://wiki.ampr.org || HTTP || This Wiki|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[44Net mailing list]] ||  https://mailman.ampr.org/mailman/listinfo/44net || HTTP || mailing list discussion|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||AMPRNet [[Gateway]] (AMPRGW) || 169.228.34.84 || IP and IPENCAP [[Tunnel]]|| main AMPRNet Router|| Gateways use IP Protocol 4 (IPENCAP) to receive traffic via AMPRGW. Allocation must be registered in the [[Portal]] and gateways must run an AMPRNet routing protocol (i.e. [[RIP]]44 or [[munge script]]).&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[RIP]]44 || provided via [https://en.wikipedia.org/wiki/Broadcasting_%28networking%29 broadcast] from 44.0.0.1 to all [[gateway]]s registered in the [[portal]] || Routing Information (modified RIPv2 protocol) || distributed by main AMPRNet Router to multicast address 224.0.0.9|| 1.) an enabled IPENCAP tunnel, and 2.) [[ampr-ripd]] or [[rip44d]] must be running and properly configured on your registered gateway&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[Encap.txt]] || N/A || Routing Information (EMAIL/FTP/HTTP)|| routing information for download|| file must be must be parsed by a self-developed [[munge script]]&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators||[[Ampr.org]] DNS and Reverse DNS (44.in-addr.arpa) ||&lt;br /&gt;
(These hosts maintain a copy of AMPR.ORG and the 44.IN-ADDR.ARPA DNS Zones:)&lt;br /&gt;
&amp;lt;br /&amp;gt;ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
ns2.threshinc.com&amp;lt;br /&amp;gt;&lt;br /&gt;
munnari.OZ.AU&amp;lt;br /&amp;gt;&lt;br /&gt;
a.coreservers.uk&amp;lt;br /&amp;gt;&lt;br /&gt;
ampr-dns.in-berlin.de&amp;lt;br /&amp;gt;&lt;br /&gt;
(These hosts maintain a copy of AMPR.ORG and the 44.in-addr.arpa DNS Zones. 44/8 hosts may use as recursive/Client DNS servers:)&amp;lt;br /&amp;gt;&lt;br /&gt;
gw.ct.ampr.org (44.88.0.1)&amp;lt;br /&amp;gt;&lt;br /&gt;
dns-mdc.ampr.org (44.60.44.3)&amp;lt;br /&amp;gt;&lt;br /&gt;
n1uro.ampr.org (44.88.0.9)&lt;br /&gt;
|| DNS || name resolution services|| zone files can be downloaded from ftp://gw.ampr.org/pub/&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators||Network Tools||&lt;br /&gt;
http://whatismyip.ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
http://yo2tm.ampr.org/nettools.php&amp;lt;br /&amp;gt;&lt;br /&gt;
http://kb3vwg-010.ampr.org/tools&amp;lt;br /&amp;gt;&lt;br /&gt;
http://speedtest.ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
http://n1uro.ampr.org/do.shtml&amp;lt;br /&amp;gt;&lt;br /&gt;
 || HTTP|| source IP checker, speed test, Ping, Traceroute, etc.|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators ||Network Time Protocol Server || gw.ampr.org (Stratum 1, US)&amp;lt;br /&amp;gt;ntp.vk2hff.ampr.org (Stratum 1, AU)&amp;lt;br /&amp;gt;ntp.g1fef.ampr.org (Stratum 1, UK)&amp;lt;br /&amp;gt;kb3vwg-001.ampr.org (Stratum 2, US)&amp;lt;br /&amp;gt;gw-44-137.pi9noz.ampr.org (Stratum 2)&amp;lt;br /&amp;gt;server.yo2loj.ampr.org (Stratum 2)&amp;lt;br /&amp;gt;f4gve.ampr.org (Stratum 3)&amp;lt;br /&amp;gt;ntp1.on3rvh.ampr.org&amp;lt;br /&amp;gt; || NTP|| Stratum 2 Network Time Server - References US, Canadian and Mexican|| AMPRNet hosts have OPEN ACCESS to these time servers &lt;br /&gt;
|-&lt;br /&gt;
| OH7LZB ||[[AMPRNet_VPN]] || http://wiki.ampr.org/wiki/AMPRNet_VPN || VPN|| [http://en.wikipedia.org/wiki/OpenVPN OpenVPN]-based || You must have a X.509 certificate issued by [http://www.arrl.org/logbook-of-the-world ARRL Logbook of the World (LoTW)]. ARRL membership is not required.&lt;br /&gt;
|-&lt;br /&gt;
| N1URO  ||AMPRNet/RF faxing || http://wiki.ampr.org/wiki/axMail-FAX || Facsimile || Online IP based Facsimile service. You have the ability to send emergency communications from packet via Fax. || [http://axmail.sourceforge.net axMail-FAX] Sofware is here.&lt;br /&gt;
|-&lt;br /&gt;
| OH1KK  || KiwiSDR Kaustinen || http://44.139.48.2 || SDR-receiver || KiwiSDR receiver located at Kaustinen, Finland · 0-30 MHz · Antenna switch extension · Northern Europe || Experimental. Also available on non-amprnet at address http://sdr.vy.fi&lt;br /&gt;
|-&lt;br /&gt;
| [http://allstarlink.org AllStar Link] || AllStar || http://allstarlink.org || Linking of repeaters || AllStar Link core network services are provided via redundant datacenters using 44net IP space.  || [https://wiki.allstarlink.org/wiki/Main_Page ASL wiki]&lt;br /&gt;
|-}&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Setting_up_a_gateway_on_OpenWRT&amp;diff=890</id>
		<title>Setting up a gateway on OpenWRT</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Setting_up_a_gateway_on_OpenWRT&amp;diff=890"/>
		<updated>2020-11-07T06:51:01Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: /* Setup and configuration of OpenWrt */ added update for https://openwrt.org/packages/pkgdata/libstdcpp6&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Wiki provides operators a straightforward method of configuring your OpenWrt device for use with the [[ARDC]] network.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running the [[RIP| RIP44 protocol]] ==&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* To operate a [[Gateway]] on [[AMPRNet]], you must run software to obtain up-to-date route information - a variant of [https://en.wikipedia.org/wiki/Routing_Information_Protocol RIP version 2] protocol named [[RIP| RIP44]] is used&lt;br /&gt;
* The implementation of [https://en.wikipedia.org/wiki/Routing_Information_Protocol RIP version 2] and RIP44 &#039;&#039;&#039;[[RIP#What&#039;s the difference?|are not the same]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Therefore:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;You must have access to a binary [https://en.wikipedia.org/wiki/Executable executable] of [[ampr-ripd]] that is compatible with the [https://en.wikipedia.org/wiki/Central_processing_unit CPU] in your OpenWrt device (e.g. i386, i586, x86_64, MIPS, PPC, etc.). If you do not, you must [https://en.wikipedia.org/wiki/Compiler compile] ampr-ripd yourself, or install the packages necessary to run [[rip44d]].&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;[[ampr-ripd]]&#039;&#039;&#039; (written in C by YO2LOJ) is used in this Wiki example, as fewer prerequisite software are required (e.g. C++ library), compared to [[rip44d]]&lt;br /&gt;
* &#039;&#039;There is also an experimental [[RIP44.lua]] daemon which should run with standard packages&#039;&#039;&lt;br /&gt;
* &#039;&#039;For information about compiling for OpenWrt devices, see:&#039;&#039;&lt;br /&gt;
** [https://openwrt.org/docs/guide-developer/crosscompile Cross Compile - OpenWrt]&lt;br /&gt;
** [https://openwrt.org/docs/start OpenWrt Manual]&lt;br /&gt;
&lt;br /&gt;
== Before we begin - assumptions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE - &#039;&#039;&#039; &#039;&#039;these instructions assume:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* That you have been assigned AMPRNet IP address allocations that are properly claimed; and your [[Gateway]] IP or hostname configured on your account in the [[Portal]]&lt;br /&gt;
* &#039;&#039;While not a requirement, that the allocation is /30 (preferablly /29) or larger - that you have enough usable IPs for: tunl0, AMPRLAN and for downstream client usage&#039;&#039;&lt;br /&gt;
** NAT is not used on the AMPRLAN side of this example&lt;br /&gt;
* &#039;&#039;&#039;That you have properly enabled DNS PTR records with your AMPRNet regional coordinator - this enables global IP addresses usage&#039;&#039;&#039;&lt;br /&gt;
* That you intend to configure your OpenWrt-based (version 14.07 or greater) AMPRNet [[Gateway]] to be a [https://en.wikipedia.org/wiki/Stateful_firewall stateful firewall] for your AMPRNet allocations (i.e. enabling connection tracking). If you prefer to forward all traffic to your allocated AMPRNet IP addresses, you may follow these instructions; but configure your Firewall Zones to forward all traffic to/from AMPRLAN to AMPRWAN&lt;br /&gt;
* These instructions configure your AMPRNet Tunnel and AMPRNet Local Interfaces in their own [https://en.wikipedia.org/wiki/Policy-based_routing policy-based routing] scenario; and places all local AMPRNet allocations in the main routing instance (you must provide routing rules for your local AMPR subnets to reach local subnets, if you desire)&lt;br /&gt;
* Since the OpenWrt Kernel is aware that your AMPRNet allocations exist locally (and are populated on the MAIN ROUTING TABLE), you must provide routing rules for AMPRLAN to reach these local subnets, or omit those rules (not permitting your AMPRLAN to route to your local subnets)&lt;br /&gt;
* Lastly, that the user:&lt;br /&gt;
** can navigate the default OpenWrt LuCI web-based graphical user interface locally; and that they are using a device capable of having the packages installed&lt;br /&gt;
** is familiar with the [https://en.wikipedia.org/wiki/Chmod chmod] command, and/or&lt;br /&gt;
** familiar with entering OpenWrt UCI (Unified Configuration Interface) commands by serial console or SSH.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Setup and configuration of OpenWrt ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* [https://openwrt.org/packages/pkgdata/kmod-ipip kmod-ipip]&lt;br /&gt;
* [https://openwrt.org/packages/pkgdata/ip-full ip-full]&lt;br /&gt;
* [https://openwrt.org/packages/pkgdata/libstdcpp libstdcpp] (depending on version, it may now be named [https://openwrt.org/packages/pkgdata/libstdcpp6 libstdcpp6])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Paste:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[ampr-ripd]]&#039;&#039;&#039; to &#039;&#039;&#039;/etc/config/&#039;&#039;&#039; (always run [[RIP| RIP44]] software in console mode FIRST after installation to verify execution and obtain the password, the execution of the file is commented-out below)&lt;br /&gt;
* &#039;&#039;optional&#039;&#039; - dynamic firewall script to /etc/config/load_ipipfilter.sh (see the [[Firewalls#ipset|ipset]] section of the firewall wiki)&lt;br /&gt;
* the following to /etc/rc.local or on web GUI at&#039;&#039;&#039;System &amp;gt; Startup &amp;gt; Local Startup:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ip tunnel add tunl0&lt;br /&gt;
 ip tunnel change tunl0 mode ipip ttl 64 tos inherit pmtudisc&lt;br /&gt;
 # Optional to assign a single /32 IP to tunl0&lt;br /&gt;
 # needed if you use -L ampr-ripd argument&lt;br /&gt;
 # or to test AMPRWAN side of connection&lt;br /&gt;
 &#039;&#039;&#039;# ip addr add 44.xxx.xxx.xxx/32 dev tunl0&#039;&#039;&#039;&lt;br /&gt;
 ip link set tunl0 mtu 1480 up&lt;br /&gt;
 &#039;&#039;&#039;# This directory is not persistent on OpenWrt, it must be made on boot for dynamic filtering&lt;br /&gt;
 mkdir /var/lib/ampr-ripd&lt;br /&gt;
 # A blank bootstrap file must be created at /etc/config/encap.txt for this to work&lt;br /&gt;
 # Running &#039;&#039;&#039;touch /etc/config/encap.txt&#039;&#039;&#039; once can create it&lt;br /&gt;
 # after which, you may run ampr-ripd to populate it&lt;br /&gt;
 ln -s /etc/config/encap.txt /tmp/lib/ampr-ripd/encap.txt&lt;br /&gt;
 # Dynamic filter, script executed by -x argument&lt;br /&gt;
 # Dynamic filter, -s argument creates encap.txt&lt;br /&gt;
 &#039;&#039;&#039;# ./etc/config/ampr-ripd -p &amp;lt;PASSWORD&amp;gt; -s -t 44 -a &amp;lt;44.xxx.xxx.xxx/xx&amp;gt; -x ./etc/config/load_ipipfilter.sh &amp;amp;&#039;&#039;&#039;&lt;br /&gt;
 ## Allows traceroute to respond using 44net IP of tunl0 or br-amprlan ##&lt;br /&gt;
 echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_errors_use_inbound_ifaddr&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;AMPRNet Policy Routes&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # add IP Route to /etc/config/network&lt;br /&gt;
 &lt;br /&gt;
 config route&lt;br /&gt;
 	option interface &#039;amprwan&#039;&lt;br /&gt;
 	option target &#039;0.0.0.0&#039;&lt;br /&gt;
 	option netmask &#039;0.0.0.0&#039;&lt;br /&gt;
 	option gateway &#039;&#039;&#039;&#039;&amp;lt;AMPRGW&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
 	option onlink &#039;1&#039;&lt;br /&gt;
 	option table &#039;44&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;AMPRNet Policy Rules&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # add IP Rules to /etc/config/network&lt;br /&gt;
 &lt;br /&gt;
 #OPTIONAL AMPR TO LAN RULES (NUMBER 22-2X ACCORDINGLY)&lt;br /&gt;
 config rule&lt;br /&gt;
 	option src &#039;44.xxx.xxx.0/24&#039;&lt;br /&gt;
 	option dest &#039;192.168.xxx.0/24&#039;&lt;br /&gt;
 	option priority &#039;22&#039;&lt;br /&gt;
 	option lookup &#039;main&#039;&lt;br /&gt;
 &lt;br /&gt;
 #ADD A MAIN RULE FOR EVERY LOCAL AMPR SUBNET, RENUMBER 44-4X ACCORDINGLY)&lt;br /&gt;
 config rule&lt;br /&gt;
 	option dest &#039;44.xxx.xxx.0/24&#039;&lt;br /&gt;
 	option priority &#039;44&#039;&lt;br /&gt;
 	option lookup &#039;main&#039;&lt;br /&gt;
 &lt;br /&gt;
 ### This ensures all traffic received on tunl0 uses table 44&lt;br /&gt;
 config rule&lt;br /&gt;
 	option in &#039;amprwan&#039;&lt;br /&gt;
 	option dest &#039;0.0.0.0/0&#039;&lt;br /&gt;
 	option priority &#039;45&#039;&lt;br /&gt;
 	option lookup &#039;44&#039;&lt;br /&gt;
 &lt;br /&gt;
 ###Add this after you create the AMPRLAN bridge, this ensures all traffic from AMPRLAN uses table 44&lt;br /&gt;
 config rule&lt;br /&gt;
 	option in &#039;amprnet&#039;&lt;br /&gt;
 	option dest &#039;0.0.0.0/0&#039;&lt;br /&gt;
 	option priority &#039;46&#039;&lt;br /&gt;
 	option lookup &#039;44&#039;&lt;br /&gt;
 &lt;br /&gt;
 ### You must add an IP rule for all 44net IPs residing on the device&lt;br /&gt;
 config rule&lt;br /&gt;
 	option src &#039;44.xxx.xxx.0/24&lt;br /&gt;
 	option priority &#039;47&#039;&lt;br /&gt;
 	option lookup &#039;44&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;reboot&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Enumerating tunnel/VLAN (AMPRWAN/AMPRLAN) Interfaces and firewall zones ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;REMINDER: In OpenWrt 14.07 or lower - be sure to enable connection tracking if you will not masquerade.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Interfaces&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Create an unmanaged Interface instance for tunl0 (&#039;&#039;&#039;AMPRWAN&#039;&#039;&#039;) - &#039;&#039;&#039;set to not bring up on boot&#039;&#039;&#039;, adding it to a new own firewall zone &#039;&#039;&#039;amprwan&#039;&#039;&#039; using&lt;br /&gt;
**Input: Drop (or Reject)&lt;br /&gt;
**Output: Drop (or Reject)&lt;br /&gt;
**Forward: Drop (or Reject)&lt;br /&gt;
* Create an interface instance for a new VLAN and bridge (AMPRNET). &#039;&#039;&#039;Assign an IP from your allocation to this interface - this will become the the Default Route/Gateway IP used on other 44 clients in your VLAN&#039;&#039;&#039; - add it to its own new firewall zone using&lt;br /&gt;
** Input: Accept (if you wish for you AMPRLAN devices to reach the router)&lt;br /&gt;
** Output: Accept; and&lt;br /&gt;
** Forward: Drop (or Reject, depending if you have other downstream routers in this VLAN)&lt;br /&gt;
* &#039;&#039;&#039;reboot&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;General Firewalling&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Permit forwarding from AMPRLAN to AMPRWAN and WAN (you must masquerade this traffic when using WAN)&lt;br /&gt;
* Permit forwarding from LAN to AMPRLAN (as desired, NOTE: you must make an IP Rule for the AMPRLAN to use the LAN&#039;s route on the Main Routing Table)&lt;br /&gt;
* &#039;&#039;For IPENCAP in&#039;&#039; - create Traffic Input rule to allow IPv4 IPENCAP (IP protocol type 4) from Any IP on WAN to any IP on Router &#039;&#039;(or configure optional dynamic script above, see [[Firewalls#OpenWrt|Firewalls - OpenWrt]])&#039;&#039;&lt;br /&gt;
** specify WAN IP instead of &#039;&#039;Any&#039;&#039; - if statically assigned by ISP&lt;br /&gt;
* &#039;&#039;For [[RIP| RIP44]] packets in&#039;&#039; - create Traffic Input rule to allow IPv4 udp/520 from 44.0.0.1 in AMPRWAN to 224.0.0.9 at port udp/520 IP on Router&lt;br /&gt;
* Create Traffic Forward rules for any inbound services (as desired)&lt;br /&gt;
* assign the new VLAN to any switch/trunk ports (as desired)&lt;br /&gt;
* make ampr-ripd and load_ipipfilter.sh executable using &#039;&#039;&#039;chmod +x&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Lastly&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* test ampr-ripd in console using the &#039;&#039;&#039;-d&#039;&#039;&#039; argument&lt;br /&gt;
* add password to the &#039;&#039;&#039;Local Startup&#039;&#039;&#039; entry and uncomment ampr-ripd line&lt;br /&gt;
* &#039;&#039;&#039;reboot&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[ampr-ripd]]&lt;br /&gt;
* [[Firewalls#OpenWrt|Firewalls - OpenWrt]]&lt;br /&gt;
* [[RIP44.lua]]&lt;br /&gt;
* https://openwrt.org/docs/guide-user/network/start&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Requesting_a_block&amp;diff=887</id>
		<title>Requesting a block</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Requesting_a_block&amp;diff=887"/>
		<updated>2020-03-25T13:29:44Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: add dialogue about licensed amateurs only&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Drafted for ARDC/44-net&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You &#039;&#039;&#039;must&#039;&#039;&#039; request an amprnet block direct from the Portal.&lt;br /&gt;
First you must create your account at the [https://portal.ampr.org/ Portal].&lt;br /&gt;
Once you do, you must login. &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;You also must login every 3-6 months even if it&#039;s just to check in to keep your block active, you&#039;ve been warned!&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;AMPRNet is a closed network that is only accessible to licensed radio amateurs.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Once logged in, from the &#039;&#039;&#039;top&#039;&#039;&#039; home tab, you next select the [https://portal.ampr.org/networks.php Networks]tab on the&lt;br /&gt;
row below. You will see a listing of blocks pre-allocated to the&lt;br /&gt;
people who coordinate for those blocks. Find the country you are&lt;br /&gt;
from and click on the block to the left that&#039;s associated with&lt;br /&gt;
the place you live in. If you&#039;re in the United States, than&lt;br /&gt;
you would first select 44.0.0.0/9, and then search for the state&lt;br /&gt;
you live in and click on that block assignment to the left.&lt;br /&gt;
&lt;br /&gt;
Once you find the block associated with your QTH, you then click &lt;br /&gt;
on that block. When it opens you&#039;ll see a listing of pre-allocated&lt;br /&gt;
IP space for that block assigned by that area&#039;s coordinator. You&lt;br /&gt;
will also notice the following:&lt;br /&gt;
&amp;quot;If the address range you want is not within any of the subnets above, or the region you are located in is not listed above, you may request an allocation from the parent network by clicking here: x.x.x.x/16&amp;quot;&lt;br /&gt;
This will open up a new screen. This will bring you to the &amp;quot;Request Allocation&amp;quot; page.&lt;br /&gt;
&lt;br /&gt;
Your origin&#039;s subnet will automatically be selected as a /16 subnet however&lt;br /&gt;
you need to enter in the actual subnet below it in which would suit your&lt;br /&gt;
needs. Don&#039;t be &#039;&#039;&#039;greedy&#039;&#039;&#039; request what you actually need for service&lt;br /&gt;
nodes. This would not include any 802.11 routers for use on &#039;&#039;HamWan/HamNet&#039;&#039; as&lt;br /&gt;
doing so would make you quite insecure. ISPs don&#039;t configure their routers&lt;br /&gt;
with publicly routable IP space for end users, why would you? To start with, I suggest&lt;br /&gt;
a /29 or if you feel you have a handful of devices such as a dozen Raspberry Pi &lt;br /&gt;
units you wish to host [http://wiki.ampr.org/wiki/URONode Nodes] with a /28&lt;br /&gt;
may better suit your needs.&lt;br /&gt;
&lt;br /&gt;
Basic space allocation per block request and usable hosts within such as a quick&lt;br /&gt;
guideline would be:&lt;br /&gt;
*/32 - 1 usable host&lt;br /&gt;
*/30 - 2 usable hosts&lt;br /&gt;
*/29 - 6 usable hosts&lt;br /&gt;
*/28 - 14 usable hosts&lt;br /&gt;
*/27 - 30 usable hosts&lt;br /&gt;
&lt;br /&gt;
Plan out your topology accordinly before you request your subnet. Many devices may share IPs for&lt;br /&gt;
the services you might plan to host on them. An example for a full service [http://wiki.ampr.org/wiki/URONode Node]&lt;br /&gt;
you may have 44.1.2.3.4 and that may bind to such things as:&lt;br /&gt;
*SMTP/[http://wiki.ampr.org/wiki/URONode axMail]&lt;br /&gt;
*[http://wiki.ampr.org/wiki/URONode Node]&lt;br /&gt;
*APRS&lt;br /&gt;
*BBS&lt;br /&gt;
*IMAP&lt;br /&gt;
*POP3&lt;br /&gt;
*HTTP/HTTPS&lt;br /&gt;
*and more!&lt;br /&gt;
All the above services may use a single IP on 1 host as these each may use 1 IP port each on the same IP address. As an example&lt;br /&gt;
if you had 4 Raspberry Pi units, and 4 PCs you were going to deploy out, that&#039;d be 8 individual devices&lt;br /&gt;
in which you&#039;d want a /28 subnet for because a /29 would leave you short 2 IPs for the host devices.&lt;br /&gt;
&lt;br /&gt;
In the description field, I suggest you enter your callsign. It makes your subnet easier to locate in the portal.&lt;br /&gt;
&lt;br /&gt;
Type will always be: &#039;&#039;&#039;End User&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Underneath that will be 3 tick boxes:&lt;br /&gt;
*Radio&lt;br /&gt;
*Tunnel&lt;br /&gt;
*[http://wiki.ampr.org/wiki/Announcing_your_allocation_directly Direct]&lt;br /&gt;
Unless you&#039;re jumping right into the fire and intend on BGP announcing your subnet,&lt;br /&gt;
you can ignore the last one otherwise click on the link above to see how to do BGP with the AmprNet.&lt;br /&gt;
If you&#039;ll be routing IP via RF you&#039;ll obviously want to tick on &#039;&#039;Radio&#039;&#039;. If you&#039;ll have IP &lt;br /&gt;
connectivity via your ISP you&#039;ll want to also tick on &#039;&#039;Tunnel&#039;&#039;. Note: Not all ISPs allow for the &lt;br /&gt;
passing of our tunnel protocol however most do. If you find you can not tunnel, check with your router&#039;s &lt;br /&gt;
manufacturer to insure they allow for passing of IP protocol 4. You may also want to place your main amprnet&lt;br /&gt;
device&#039;s lan IP into your local router&#039;s DMZ so that anything coming into your IP will default&lt;br /&gt;
route into the device you&#039;ll designate as your amprnet routing device. (Note: Raspberry Pi&lt;br /&gt;
units are a great device for this and you can turn them into a Wifi hotspot to route 44/8&lt;br /&gt;
via 802.11a/b/g/n)&lt;br /&gt;
&lt;br /&gt;
Lastly you&#039;ll want to send a note to your coordinator. You&#039;ll find this to be a good way to&lt;br /&gt;
open communications with your coordinator as well as helping them sort out your needs for a&lt;br /&gt;
subnet.&lt;br /&gt;
&lt;br /&gt;
Your next step is [http://wiki.ampr.org/wiki/Registering_Your_Gateway Here] to register your AmprNet Gateway.&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=846</id>
		<title>Firewalls</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=846"/>
		<updated>2019-04-25T16:17:08Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: /* OpenWrt */ added information about MSS Clamping&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the Firewall Wiki.&lt;br /&gt;
&lt;br /&gt;
This page is intended to be edited by the community to add use practices, command syntax, etc. regarding firewalling and security on AMPRNet nodes. While each operator is ultimately responsible for the administration of their node, it is highly suggested amongst the [[44Net mailing list]] Community that nodes be firewalled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cisco ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DD-WRT ==&lt;br /&gt;
&lt;br /&gt;
DD-WRT uses an iptables-based firewall (see iptables below). Custom rules can be entered at &#039;&#039;&#039;Administration &amp;gt; Commands &amp;gt; &amp;quot;Save Firewall&amp;quot;&#039;&#039;&#039; on the web GUI.&lt;br /&gt;
&lt;br /&gt;
See:&lt;br /&gt;
&lt;br /&gt;
* https://www.dd-wrt.com/wiki/index.php/Iptables&lt;br /&gt;
* https://www.dd-wrt.com/wiki/index.php/Firewall&lt;br /&gt;
&lt;br /&gt;
== D-Link ==&lt;br /&gt;
&lt;br /&gt;
On some D-Link devices, the port forwarding feature allows for the options: TCP, UDP and Other. The &amp;quot;Other&amp;quot; option on these models are capable of Destination NAT of IPENCAP packets.&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4) &#039;&#039;&#039;Note: this rule is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In Port Forwarding on the web GUI:&lt;br /&gt;
&lt;br /&gt;
* Create a new Port Forward&lt;br /&gt;
* Enter the LAN IP of your AMPR node&lt;br /&gt;
* Select &amp;quot;Other&amp;quot;&lt;br /&gt;
* Type the number &#039;&#039;&#039;4&#039;&#039;&#039; into the field&lt;br /&gt;
&lt;br /&gt;
== iptables ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* On an iptables-based firewall, you must enable connection tracking on the tunl0 interface in order to enable Stateful Packet Inspection (i.e. a stateful firewall).&lt;br /&gt;
* Since the IPENCAP Linux Kernel Module IPIP is in the kernel, &#039;&#039;&#039;you must set the default forwarding policy to DROP or REJECT.&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;If you set your default routing policy to ACCEPT, all packets that have not been explicitly DROPped or REJECTed elsewhere, will route, regardless of firewall policies.&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;For most embedded devices, it is suggested to use [[Firewalls#ipset|ipset]] rules instead&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;General Bogon rules&#039;&#039;&#039; - see: https://en.wikipedia.org/wiki/Bogon_filtering&lt;br /&gt;
&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS IP TRAFFIC THAT&#039;S INVALID ENTERING OR EXITING AMPR&lt;br /&gt;
 # THIS PREVENTS A GENERAL LOOP&lt;br /&gt;
 iptables -I FORWARD -i tunl0 -o tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND IPs NOT FROM YOUR ALLOCATION (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING ! -s 44.xxx.xxx.xxx/xx -i br-amprnet -j DROP&lt;br /&gt;
 # DROPS ROGUE INBOUND ASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 44.xxx.xxx.xxx/xx -i tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND UNASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 # YOU MUST ADD A RULE UNDER THIS LINE TO MAKE EXCEPTIONS (BCP 38)&lt;br /&gt;
 iptables -I FORWARD ! -s 44.xxx.xxx.xxx/xx -o tunl0 -j DROP&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS BOGONS ENTERING AMPRNet&lt;br /&gt;
 # SEE http://www.team-cymru.org/Services/Bogons/bogon-bn-nonagg.txt&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 0.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 10.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 100.64.0.0/10 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 127.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 169.254.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 172.16.0.0/12 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.0.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.2.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.168.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.18.0.0/15 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.51.100.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 203.0.113.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 224.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 240.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 # Block of Test AMPRNet Subnet&lt;br /&gt;
 # iptables -t raw -I PREROUTING -s 44.128.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 # (you can optionally block your subnet)&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # THIS PREVENTS NESTED IPENCAP (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING -p 4 -i tunl0 -j DROP&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes (using iptables)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable dynamic filtering of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NOTE:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;This script needs work, see Thu Jan 10 11:09:27 PST 2019 message in the [[44Net mailing list]] archive. Due to extreme overheard running on many devices, the ipset script is suggested instead.&#039;&#039;&lt;br /&gt;
* This rule (or one of the ipset or static rules below) is required for other AMPR nodes to initiate inbound traffic to your node.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;REQUIRED:&#039;&#039;&lt;br /&gt;
[[ampr-ripd]] (using the -x and -d arguments), the diff command from the [http://www.gnu.org/software/diffutils/manual/diffutils.html diffutils package] and the [https://www.gnu.org/software/sed/manual/sed.html sed command].&lt;br /&gt;
&lt;br /&gt;
 # Place this rule a the last firewall command&lt;br /&gt;
 # Uncomment sleep command below if the rule does not appear&lt;br /&gt;
 # as load_ipipfilter.sh is still executing&lt;br /&gt;
 # sleep 10&lt;br /&gt;
 # load ipipfilter list rule&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF WAN&amp;gt;&#039;&#039;&#039; -j ipipfilter&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 # by Rob, PE1CHL&lt;br /&gt;
 # load_ipipfilter.sh&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 AMPRGW=&amp;quot;&#039;&#039;&#039;&amp;lt;AMPRGW&amp;gt;&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
 gwfile=&amp;quot;/tmp/gw&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 # Parse encap.txt for Node IPs and place in /tmp/gw&lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u &amp;gt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
 # Run command to create CHAIN, IF no system output, CHAIN was created&lt;br /&gt;
 iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 if [ $? -eq 0 ]&lt;br /&gt;
 &#039;&#039;&#039;# DO NOT PLACE EMPTY LINES BETWEEN THE TWO COMMANDS ABOVE. ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# THE EQUATION ASKS IF THE LAST SYSTEM COMMAND ENTERED ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# RETURNS &amp;quot;NOTHING.&amp;quot; ADDING A SPACE WILL CHANGE RESULTS OF THE IF COMMAND. ###&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 ##The two lines above replace the line below, which does not work on OpenWRT&lt;br /&gt;
 # if iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 ## &lt;br /&gt;
 &lt;br /&gt;
 # IF no system output, THEN flush the CHAIN and add AMPRGW,&lt;br /&gt;
 # add nodes in encap.txt and a final DROP rule&lt;br /&gt;
 then&lt;br /&gt;
     iptables -F ipipfilter&lt;br /&gt;
     iptables -A ipipfilter -s $AMPRGW -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
     while read ip&lt;br /&gt;
     do&lt;br /&gt;
         iptables -A ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
     done &amp;lt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
     iptables -A ipipfilter -j DROP&lt;br /&gt;
 &lt;br /&gt;
 # ELSE, the CHAIN already exists, determine changes&lt;br /&gt;
 # and INSERT new nodes and DELETE old nodes (excluding AMPRGW)&lt;br /&gt;
 else&lt;br /&gt;
     iptables -L ipipfilter -n | grep ACCEPT | fgrep -v $AMPRGW | \&lt;br /&gt;
         sed -e &#039;s/.*--  //&#039; -e &#039;s/ .*//&#039; | sort | diff - $gwfile | \&lt;br /&gt;
         while read d ip&lt;br /&gt;
         do&lt;br /&gt;
             case &amp;quot;$d&amp;quot; in&lt;br /&gt;
             &amp;quot;&amp;gt;&amp;quot;)&lt;br /&gt;
                 iptables -I ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             &amp;quot;&amp;lt;&amp;quot;)&lt;br /&gt;
                 iptables -D ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             *)&lt;br /&gt;
                 ;;&lt;br /&gt;
             esac&lt;br /&gt;
         done&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 # Delete /tmp/gw when done&lt;br /&gt;
 rm -f $gwfile&lt;br /&gt;
 &lt;br /&gt;
 # The full pathname of this script /usr/local/sbin/load_ipipfilter is passed with the new -x&lt;br /&gt;
 # option to ampr-ripd.   It will load the entire filter the first time, and later it will only update&lt;br /&gt;
 # the filters that have changed.  It is required that the -s option is passed as well, so the&lt;br /&gt;
 # encap.txt file is created by ampr-ripd.&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Static IPENCAP Filtering of AMPR Nodes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note:&#039;&#039;&lt;br /&gt;
* This rule (the dynamic rule above, or the ipset rules) is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF YOUR WAN&amp;gt;&#039;&#039;&#039; -j ACCEPT &lt;br /&gt;
&lt;br /&gt;
If your AMPR node is downstream, you will create an INPUT &#039;&#039;&#039;and&#039;&#039;&#039; DNAT forward rule to the destination LAN IP of your AMPR node.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;To enable receipt of [[RIP]]44&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p udp -s 44.0.0.1 --sport 520 -d 224.0.0.9 --dport 520 -i tunl0 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Masquerade LAN Subnets to AMPRNet&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* In this instance, eth1 is your 192.168.1.0/24 LAN - (thanks to Brian, N1URO)&lt;br /&gt;
&#039;&#039;See: https://n1uro.ampr.org/linuxconf/44nat.html&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # NAT setup&lt;br /&gt;
 iptables -t nat -A POSTROUTING -s 192.168.0/24 -o tunl0 -j MASQUERADE -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -m state --state RELATED,ESTABLISHED -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
&lt;br /&gt;
== ipset ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;General Bogon rules using ipset&#039;&#039;&#039; - see: https://en.wikipedia.org/wiki/Bogon_filtering&lt;br /&gt;
&lt;br /&gt;
 #######################BOGON FILTER ########################                                                                                                                                          &lt;br /&gt;
 ipset create bogons hash:net&lt;br /&gt;
 # BOGON LIST                                                                                                                                                                                          &lt;br /&gt;
 # SEE http://www.team-cymru.org/Services/Bogons/bogon-bn-nonagg.txt                                                                                                                                   &lt;br /&gt;
 ipset -A bogons 0.0.0.0/8                                                                                                                                                                             &lt;br /&gt;
 ipset -A bogons 10.0.0.0/8                                                                                                                                                                            &lt;br /&gt;
 ipset -A bogons 100.64.0.0/10                                                                                                                                                                         &lt;br /&gt;
 ipset -A bogons 127.0.0.0/8                                                                                                                                                                           &lt;br /&gt;
 ipset -A bogons 169.254.0.0/16                                                                                                                                                                        &lt;br /&gt;
 ipset -A bogons 172.16.0.0/12                                                                                                                                                                         &lt;br /&gt;
 ipset -A bogons 192.0.0.0/24                                                                                                                                                                          &lt;br /&gt;
 ipset -A bogons 192.0.2.0/24                                                                                                                                                                          &lt;br /&gt;
 ipset -A bogons 192.168.0.0/16                                                                                                                                                                        &lt;br /&gt;
 ipset -A bogons 198.18.0.0/15                                                                                                                                                                         &lt;br /&gt;
 ipset -A bogons 198.51.100.0/24                                                                                                                                                                       &lt;br /&gt;
 ipset -A bogons 203.0.113.0/24                                                                                                                                                                        &lt;br /&gt;
 ipset -A bogons 224.0.0.0/4                                                                                                                                                                           &lt;br /&gt;
 ipset -A bogons 240.0.0.0/4   &lt;br /&gt;
 # Block of your own AMPRNet Subnet                                                                                                                                                                        &lt;br /&gt;
 # ipset -A bogons 44.xxx.xxx.xxx/xx&lt;br /&gt;
 # Block of Test AMPRNet Subnet&lt;br /&gt;
 # ipset -A bogons 44.128.0.0/16&lt;br /&gt;
&lt;br /&gt;
(you can optionally block your subnet)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes (using ipset)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable dynamic filtering of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;REQUIRED:&#039;&#039; [[ampr-ripd]] (using the -x and -d arguments) and the ipset package.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 ipset -N ipipfilter hash:ip 2&amp;gt;/dev/null&lt;br /&gt;
 ipset flush ipipfilter&lt;br /&gt;
 ipset -A ipipfilter &amp;lt;AMPRGW&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u | while read ip&lt;br /&gt;
 do&lt;br /&gt;
     ipset -A ipipfilter $ip&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
== Microtik ==&lt;br /&gt;
&lt;br /&gt;
== OpenWrt ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;See: [[Firewalls#iptables|iptables]] and [[Firewalls#ipset|ipset]] (above), and the Instructions for [[setting up a gateway on OpenWRT|setting up a gateway on OpenWRT]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* the Bogon ipset script is added to &#039;&#039;&#039;System &amp;gt; Startup&#039;&#039;&#039; on the web GUI - or into the Unified Configuration Interface (UCI) file &#039;&#039;/etc/rc.local&#039;&#039;&lt;br /&gt;
* [[Firewalls#iptables|iptables]]-based scripts are entered at &#039;&#039;&#039;Network &amp;gt; Firewall &amp;gt; Custom Firewall&#039;&#039;&#039; on the LuCI web GUI interface - or into the Unified Configuration Interface (UCI) file &#039;&#039;/etc/firewall.user&#039;&#039;&lt;br /&gt;
* [[Firewalls#ipset|ipset]]-based rules are entered on the command line - into the Unified Configuration Interface (UCI) file &#039;&#039;/etc/config/firewall&#039;&#039; &#039;&#039;(OpenWrt syntax must be used in this file!)&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;MSS Clamping is enabled in the Firewall Section, you should enable this on both the AMPRLAN and AMPRWAN interfaces&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Adding Bogon drop rule to OpenWrt (using [[Firewalls#ipset|ipset]])&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # in /etc/config/firewall&lt;br /&gt;
 config rule&lt;br /&gt;
 	option name &#039;Drop-Bogons_In_AMPRWAN&#039;&lt;br /&gt;
 	option family &#039;ipv4&#039;&lt;br /&gt;
 	option proto &#039;all&#039;&lt;br /&gt;
 	option src &#039;amprwan&#039;&lt;br /&gt;
 	option target &#039;DROP&#039;&lt;br /&gt;
 	option extra &#039;-m set --match-set bogons src&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Adding IPENCAP Filtering of AMPR Nodes to OpenWrt (using [[Firewalls#ipset|ipset]])&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # in /etc/config/firewall&lt;br /&gt;
 config rule&lt;br /&gt;
 	option target &#039;ACCEPT&#039;&lt;br /&gt;
 	option src &#039;wan&#039;&lt;br /&gt;
 	option family &#039;ipv4&#039;&lt;br /&gt;
 	option proto &#039;4&#039;&lt;br /&gt;
 	option name &#039;Allow-AMPR_IPENCAP&#039;&lt;br /&gt;
 	option extra &#039;-m set --match-set ipipfilter src&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Adding ICMP Filtering of AMPR Nodes to OpenWrt (using [[Firewalls#ipset|ipset]])&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # in /etc/config/firewall&lt;br /&gt;
 config rule&lt;br /&gt;
 	option target &#039;ACCEPT&#039;&lt;br /&gt;
 	option family &#039;ipv4&#039;&lt;br /&gt;
 	option proto &#039;icmp&#039;&lt;br /&gt;
 	list icmp_type &#039;echo-request&#039;&lt;br /&gt;
 	option src &#039;*&#039; &lt;br /&gt;
 	option extra &#039;-m set --match-set ipipfilter src&#039;&lt;br /&gt;
 	option name &#039;Ping_fromIPENCAPS&#039;&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Ampr-ripd&amp;diff=794</id>
		<title>Ampr-ripd</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Ampr-ripd&amp;diff=794"/>
		<updated>2019-01-25T00:11:41Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: spelling correction&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;ampr-ripd is a GNU/Linux C daemon writen by Y02LOJ that listens for AMPRNet [[gateway]] announcements and can update routing tables based on the information it receives.&lt;br /&gt;
&lt;br /&gt;
ampr-ripd source code and instructions can be found [http://www.yo2loj.ro/hamprojects/ here].&lt;br /&gt;
&lt;br /&gt;
* [[ampr-ripd]] has been compiled for the AppliedMicro APM82181 and Atheros 71xx router CPUs&lt;br /&gt;
* Considering embedded devices such as [[Setting up a gateway on OpenWRT|OpenWrt]], the routing table is relatively small - so the performance or memory consumption of this daemon isn&#039;t very critical&lt;br /&gt;
* new [[Gateway]] operators should compile the source code if they do not have access to an executable copy of this software&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Setting_up_a_gateway_on_OpenWRT&amp;diff=793</id>
		<title>Setting up a gateway on OpenWRT</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Setting_up_a_gateway_on_OpenWRT&amp;diff=793"/>
		<updated>2019-01-22T13:38:00Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: /* Before we begin - assumptions */ added information about subnet size&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Wiki provides operators a straightforward method of configuring your OpenWrt device for use with the [[ARDC]] network.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running the [[RIP| RIP44 protocol]] ==&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* To operate a [[Gateway]] on [[AMPRNet]], you must run software to obtain up-to-date route information - a variant of [https://en.wikipedia.org/wiki/Routing_Information_Protocol RIP version 2] protocol named [[RIP| RIP44]] is used&lt;br /&gt;
* The implementation of [https://en.wikipedia.org/wiki/Routing_Information_Protocol RIP version 2] and RIP44 &#039;&#039;&#039;[[RIP#What&#039;s the difference?|are not the same]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Therefore:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;You must have access to a binary [https://en.wikipedia.org/wiki/Executable executable] of [[ampr-ripd]] that is compatible with the [https://en.wikipedia.org/wiki/Central_processing_unit CPU] in your OpenWrt device (e.g. i386, i586, x86_64, MIPS, PPC, etc.). If you do not, you must [https://en.wikipedia.org/wiki/Compiler compile] ampr-ripd yourself, or install the packages necessary to run [[rip44d]].&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;[[ampr-ripd]]&#039;&#039;&#039; (written in C by YO2LOJ) is used in this Wiki example, as fewer prerequisite software are required (e.g. C++ library), compared to [[rip44d]]&lt;br /&gt;
* &#039;&#039;There is also an experimental [[RIP44.lua]] daemon which should run with standard packages&#039;&#039;&lt;br /&gt;
* &#039;&#039;For information about compiling for OpenWrt devices, see:&#039;&#039;&lt;br /&gt;
** [https://openwrt.org/docs/guide-developer/crosscompile Cross Compile - OpenWrt]&lt;br /&gt;
** [https://openwrt.org/docs/start OpenWrt Manual]&lt;br /&gt;
&lt;br /&gt;
== Before we begin - assumptions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE - &#039;&#039;&#039; &#039;&#039;these instructions assume:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* That you have been assigned AMPRNet IP address allocations that are properly claimed; and your [[Gateway]] IP or hostname configured on your account in the [[Portal]]&lt;br /&gt;
* &#039;&#039;While not a requirement, that the allocation is /30 (preferablly /29) or larger - that you have enough usable IPs for: tunl0, AMPRLAN and for downstream client usage&#039;&#039;&lt;br /&gt;
** NAT is not used on the AMPRLAN side of this example&lt;br /&gt;
* &#039;&#039;&#039;That you have properly enabled DNS PTR records with your AMPRNet regional coordinator - this enables global IP addresses usage&#039;&#039;&#039;&lt;br /&gt;
* That you intend to configure your OpenWrt-based (version 14.07 or greater) AMPRNet [[Gateway]] to be a [https://en.wikipedia.org/wiki/Stateful_firewall stateful firewall] for your AMPRNet allocations (i.e. enabling connection tracking). If you prefer to forward all traffic to your allocated AMPRNet IP addresses, you may follow these instructions; but configure your Firewall Zones to forward all traffic to/from AMPRLAN to AMPRWAN&lt;br /&gt;
* These instructions configure your AMPRNet Tunnel and AMPRNet Local Interfaces in their own [https://en.wikipedia.org/wiki/Policy-based_routing policy-based routing] scenario; and places all local AMPRNet allocations in the main routing instance (you must provide routing rules for your local AMPR subnets to reach local subnets, if you desire)&lt;br /&gt;
* Since the OpenWrt Kernel is aware that your AMPRNet allocations exist locally (and are populated on the MAIN ROUTING TABLE), you must provide routing rules for AMPRLAN to reach these local subnets, or omit those rules (not permitting your AMPRLAN to route to your local subnets)&lt;br /&gt;
* Lastly, that the user:&lt;br /&gt;
** can navigate the default OpenWrt LuCI web-based graphical user interface locally; and that they are using a device capable of having the packages installed&lt;br /&gt;
** is familiar with the [https://en.wikipedia.org/wiki/Chmod chmod] command, and/or&lt;br /&gt;
** familiar with entering OpenWrt UCI (Unified Configuration Interface) commands by serial console or SSH.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Setup and configuration of OpenWrt ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* [https://openwrt.org/packages/pkgdata/kmod-ipip kmod-ipip]&lt;br /&gt;
* [https://openwrt.org/packages/pkgdata/ip-full ip-full]&lt;br /&gt;
* [https://openwrt.org/packages/pkgdata/libstdcpp libstdcpp]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Paste:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[ampr-ripd]]&#039;&#039;&#039; to &#039;&#039;&#039;/etc/config/&#039;&#039;&#039; (always run [[RIP| RIP44]] software in console mode FIRST after installation to verify execution and obtain the password, the execution of the file is commented-out below)&lt;br /&gt;
* &#039;&#039;optional&#039;&#039; - dynamic firewall script to /etc/config/load_ipipfilter.sh (see the [[Firewalls#ipset|ipset]] section of the firewall wiki)&lt;br /&gt;
* the following to /etc/rc.local or on web GUI at&#039;&#039;&#039;System &amp;gt; Startup &amp;gt; Local Startup:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ip tunnel add tunl0&lt;br /&gt;
 ip tunnel change tunl0 mode ipip ttl 64 tos inherit pmtudisc&lt;br /&gt;
 # Optional to assign a single /32 IP to tunl0&lt;br /&gt;
 # needed if you use -L ampr-ripd argument&lt;br /&gt;
 # or to test AMPRWAN side of connection&lt;br /&gt;
 &#039;&#039;&#039;# ip addr add 44.xxx.xxx.xxx/32 dev tunl0&#039;&#039;&#039;&lt;br /&gt;
 ip link set tunl0 mtu 1480 up&lt;br /&gt;
 &#039;&#039;&#039;# This directory is not persistent on OpenWrt, it must be made on boot for dynamic filtering&lt;br /&gt;
 mkdir /var/lib/ampr-ripd&lt;br /&gt;
 # A blank bootstrap file must be created at /etc/config/encap.txt for this to work&lt;br /&gt;
 # Running &#039;&#039;&#039;touch /etc/config/encap.txt&#039;&#039;&#039; once can create it&lt;br /&gt;
 # after which, you may run ampr-ripd to populate it&lt;br /&gt;
 ln -s /etc/config/encap.txt /tmp/lib/ampr-ripd/encap.txt&lt;br /&gt;
 # Dynamic filter, script executed by -x argument&lt;br /&gt;
 # Dynamic filter, -s argument creates encap.txt&lt;br /&gt;
 &#039;&#039;&#039;# ./etc/config/ampr-ripd -p &amp;lt;PASSWORD&amp;gt; -s -t 44 -a &amp;lt;44.xxx.xxx.xxx/xx&amp;gt; -x ./etc/config/load_ipipfilter.sh &amp;amp;&#039;&#039;&#039;&lt;br /&gt;
 ## Allows traceroute to respond using 44net IP of tunl0 or br-amprlan ##&lt;br /&gt;
 echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_errors_use_inbound_ifaddr&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;AMPRNet Policy Routes&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # add IP Route to /etc/config/network&lt;br /&gt;
 &lt;br /&gt;
 config route&lt;br /&gt;
 	option interface &#039;amprwan&#039;&lt;br /&gt;
 	option target &#039;0.0.0.0&#039;&lt;br /&gt;
 	option netmask &#039;0.0.0.0&#039;&lt;br /&gt;
 	option gateway &#039;&#039;&#039;&#039;&amp;lt;AMPRGW&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
 	option onlink &#039;1&#039;&lt;br /&gt;
 	option table &#039;44&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;AMPRNet Policy Rules&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # add IP Rules to /etc/config/network&lt;br /&gt;
 &lt;br /&gt;
 #OPTIONAL AMPR TO LAN RULES (NUMBER 22-2X ACCORDINGLY)&lt;br /&gt;
 config rule&lt;br /&gt;
 	option src &#039;44.xxx.xxx.0/24&#039;&lt;br /&gt;
 	option dest &#039;192.168.xxx.0/24&#039;&lt;br /&gt;
 	option priority &#039;22&#039;&lt;br /&gt;
 	option lookup &#039;main&#039;&lt;br /&gt;
 &lt;br /&gt;
 #ADD A MAIN RULE FOR EVERY LOCAL AMPR SUBNET, RENUMBER 44-4X ACCORDINGLY)&lt;br /&gt;
 config rule&lt;br /&gt;
 	option dest &#039;44.xxx.xxx.0/24&#039;&lt;br /&gt;
 	option priority &#039;44&#039;&lt;br /&gt;
 	option lookup &#039;main&#039;&lt;br /&gt;
 &lt;br /&gt;
 ### This ensures all traffic received on tunl0 uses table 44&lt;br /&gt;
 config rule&lt;br /&gt;
 	option in &#039;amprwan&#039;&lt;br /&gt;
 	option dest &#039;0.0.0.0/0&#039;&lt;br /&gt;
 	option priority &#039;45&#039;&lt;br /&gt;
 	option lookup &#039;44&#039;&lt;br /&gt;
 &lt;br /&gt;
 ###Add this after you create the AMPRLAN bridge, this ensures all traffic from AMPRLAN uses table 44&lt;br /&gt;
 config rule&lt;br /&gt;
 	option in &#039;amprnet&#039;&lt;br /&gt;
 	option dest &#039;0.0.0.0/0&#039;&lt;br /&gt;
 	option priority &#039;46&#039;&lt;br /&gt;
 	option lookup &#039;44&#039;&lt;br /&gt;
 &lt;br /&gt;
 ### You must add an IP rule for all 44net IPs residing on the device&lt;br /&gt;
 config rule&lt;br /&gt;
 	option src &#039;44.xxx.xxx.0/24&lt;br /&gt;
 	option priority &#039;47&#039;&lt;br /&gt;
 	option lookup &#039;44&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;reboot&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Enumerating tunnel/VLAN (AMPRWAN/AMPRLAN) Interfaces and firewall zones ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;REMINDER: In OpenWrt 14.07 or lower - be sure to enable connection tracking if you will not masquerade.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Interfaces&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Create an unmanaged Interface instance for tunl0 (&#039;&#039;&#039;AMPRWAN&#039;&#039;&#039;) - &#039;&#039;&#039;set to not bring up on boot&#039;&#039;&#039;, adding it to a new own firewall zone &#039;&#039;&#039;amprwan&#039;&#039;&#039; using&lt;br /&gt;
**Input: Drop (or Reject)&lt;br /&gt;
**Output: Drop (or Reject)&lt;br /&gt;
**Forward: Drop (or Reject)&lt;br /&gt;
* Create an interface instance for a new VLAN and bridge (AMPRNET). &#039;&#039;&#039;Assign an IP from your allocation to this interface - this will become the the Default Route/Gateway IP used on other 44 clients in your VLAN&#039;&#039;&#039; - add it to its own new firewall zone using&lt;br /&gt;
** Input: Accept (if you wish for you AMPRLAN devices to reach the router)&lt;br /&gt;
** Output: Accept; and&lt;br /&gt;
** Forward: Drop (or Reject, depending if you have other downstream routers in this VLAN)&lt;br /&gt;
* &#039;&#039;&#039;reboot&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;General Firewalling&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Permit forwarding from AMPRLAN to AMPRWAN and WAN (you must masquerade this traffic when using WAN)&lt;br /&gt;
* Permit forwarding from LAN to AMPRLAN (as desired, NOTE: you must make an IP Rule for the AMPRLAN to use the LAN&#039;s route on the Main Routing Table)&lt;br /&gt;
* &#039;&#039;For IPENCAP in&#039;&#039; - create Traffic Input rule to allow IPv4 IPENCAP (IP protocol type 4) from Any IP on WAN to any IP on Router &#039;&#039;(or configure optional dynamic script above, see [[Firewalls#OpenWrt|Firewalls - OpenWrt]])&#039;&#039;&lt;br /&gt;
** specify WAN IP instead of &#039;&#039;Any&#039;&#039; - if statically assigned by ISP&lt;br /&gt;
* &#039;&#039;For [[RIP| RIP44]] packets in&#039;&#039; - create Traffic Input rule to allow IPv4 udp/520 from 44.0.0.1 in AMPRWAN to 224.0.0.9 at port udp/520 IP on Router&lt;br /&gt;
* Create Traffic Forward rules for any inbound services (as desired)&lt;br /&gt;
* assign the new VLAN to any switch/trunk ports (as desired)&lt;br /&gt;
* make ampr-ripd and load_ipipfilter.sh executable using &#039;&#039;&#039;chmod +x&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Lastly&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* test ampr-ripd in console using the &#039;&#039;&#039;-d&#039;&#039;&#039; argument&lt;br /&gt;
* add password to the &#039;&#039;&#039;Local Startup&#039;&#039;&#039; entry and uncomment ampr-ripd line&lt;br /&gt;
* &#039;&#039;&#039;reboot&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[ampr-ripd]]&lt;br /&gt;
* [[Firewalls#OpenWrt|Firewalls - OpenWrt]]&lt;br /&gt;
* [[RIP44.lua]]&lt;br /&gt;
* https://openwrt.org/docs/guide-user/network/start&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Setting_up_a_gateway_on_OpenWRT&amp;diff=792</id>
		<title>Setting up a gateway on OpenWRT</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Setting_up_a_gateway_on_OpenWRT&amp;diff=792"/>
		<updated>2019-01-22T13:27:49Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: /* Setup and configuration of OpenWrt */ add tunl0 IP information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Wiki provides operators a straightforward method of configuring your OpenWrt device for use with the [[ARDC]] network.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running the [[RIP| RIP44 protocol]] ==&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* To operate a [[Gateway]] on [[AMPRNet]], you must run software to obtain up-to-date route information - a variant of [https://en.wikipedia.org/wiki/Routing_Information_Protocol RIP version 2] protocol named [[RIP| RIP44]] is used&lt;br /&gt;
* The implementation of [https://en.wikipedia.org/wiki/Routing_Information_Protocol RIP version 2] and RIP44 &#039;&#039;&#039;[[RIP#What&#039;s the difference?|are not the same]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Therefore:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;You must have access to a binary [https://en.wikipedia.org/wiki/Executable executable] of [[ampr-ripd]] that is compatible with the [https://en.wikipedia.org/wiki/Central_processing_unit CPU] in your OpenWrt device (e.g. i386, i586, x86_64, MIPS, PPC, etc.). If you do not, you must [https://en.wikipedia.org/wiki/Compiler compile] ampr-ripd yourself, or install the packages necessary to run [[rip44d]].&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;[[ampr-ripd]]&#039;&#039;&#039; (written in C by YO2LOJ) is used in this Wiki example, as fewer prerequisite software are required (e.g. C++ library), compared to [[rip44d]]&lt;br /&gt;
* &#039;&#039;There is also an experimental [[RIP44.lua]] daemon which should run with standard packages&#039;&#039;&lt;br /&gt;
* &#039;&#039;For information about compiling for OpenWrt devices, see:&#039;&#039;&lt;br /&gt;
** [https://openwrt.org/docs/guide-developer/crosscompile Cross Compile - OpenWrt]&lt;br /&gt;
** [https://openwrt.org/docs/start OpenWrt Manual]&lt;br /&gt;
&lt;br /&gt;
== Before we begin - assumptions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE - &#039;&#039;&#039; &#039;&#039;these instructions assume:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* That you have been assigned AMPRNet IP address allocations that are properly claimed; and your [[Gateway]] IP or hostname configured on your account in the [[Portal]]&lt;br /&gt;
* &#039;&#039;&#039;That you have properly enabled DNS PTR records with your AMPRNet regional coordinator - this enables global IP addresses usage&#039;&#039;&#039;&lt;br /&gt;
* That you intend to configure your OpenWrt-based (version 14.07 or greater) AMPRNet [[Gateway]] to be a [https://en.wikipedia.org/wiki/Stateful_firewall stateful firewall] for your AMPRNet allocations (i.e. enabling connection tracking). If you prefer to forward all traffic to your allocated AMPRNet IP addresses, you may follow these instructions; but configure your Firewall Zones to forward all traffic to/from AMPRLAN to AMPRWAN&lt;br /&gt;
* These instructions configure your AMPRNet Tunnel and AMPRNet Local Interfaces in their own [https://en.wikipedia.org/wiki/Policy-based_routing policy-based routing] scenario; and places all local AMPRNet allocations in the main routing instance (you must provide routing rules for your local AMPR subnets to reach local subnets, if you desire)&lt;br /&gt;
* Since the OpenWrt Kernel is aware that your AMPRNet allocations exist locally (and are populated on the MAIN ROUTING TABLE), you must provide routing rules for AMPRLAN to reach these local subnets, or omit those rules (not permitting your AMPRLAN to route to your local subnets)&lt;br /&gt;
* Lastly, that the user:&lt;br /&gt;
** can navigate the default OpenWrt LuCI web-based graphical user interface locally; and that they are using a device capable of having the packages installed&lt;br /&gt;
** is familiar with the [https://en.wikipedia.org/wiki/Chmod chmod] command, and/or&lt;br /&gt;
** familiar with entering OpenWrt UCI (Unified Configuration Interface) commands by serial console or SSH.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Setup and configuration of OpenWrt ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* [https://openwrt.org/packages/pkgdata/kmod-ipip kmod-ipip]&lt;br /&gt;
* [https://openwrt.org/packages/pkgdata/ip-full ip-full]&lt;br /&gt;
* [https://openwrt.org/packages/pkgdata/libstdcpp libstdcpp]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Paste:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[ampr-ripd]]&#039;&#039;&#039; to &#039;&#039;&#039;/etc/config/&#039;&#039;&#039; (always run [[RIP| RIP44]] software in console mode FIRST after installation to verify execution and obtain the password, the execution of the file is commented-out below)&lt;br /&gt;
* &#039;&#039;optional&#039;&#039; - dynamic firewall script to /etc/config/load_ipipfilter.sh (see the [[Firewalls#ipset|ipset]] section of the firewall wiki)&lt;br /&gt;
* the following to /etc/rc.local or on web GUI at&#039;&#039;&#039;System &amp;gt; Startup &amp;gt; Local Startup:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ip tunnel add tunl0&lt;br /&gt;
 ip tunnel change tunl0 mode ipip ttl 64 tos inherit pmtudisc&lt;br /&gt;
 # Optional to assign a single /32 IP to tunl0&lt;br /&gt;
 # needed if you use -L ampr-ripd argument&lt;br /&gt;
 # or to test AMPRWAN side of connection&lt;br /&gt;
 &#039;&#039;&#039;# ip addr add 44.xxx.xxx.xxx/32 dev tunl0&#039;&#039;&#039;&lt;br /&gt;
 ip link set tunl0 mtu 1480 up&lt;br /&gt;
 &#039;&#039;&#039;# This directory is not persistent on OpenWrt, it must be made on boot for dynamic filtering&lt;br /&gt;
 mkdir /var/lib/ampr-ripd&lt;br /&gt;
 # A blank bootstrap file must be created at /etc/config/encap.txt for this to work&lt;br /&gt;
 # Running &#039;&#039;&#039;touch /etc/config/encap.txt&#039;&#039;&#039; once can create it&lt;br /&gt;
 # after which, you may run ampr-ripd to populate it&lt;br /&gt;
 ln -s /etc/config/encap.txt /tmp/lib/ampr-ripd/encap.txt&lt;br /&gt;
 # Dynamic filter, script executed by -x argument&lt;br /&gt;
 # Dynamic filter, -s argument creates encap.txt&lt;br /&gt;
 &#039;&#039;&#039;# ./etc/config/ampr-ripd -p &amp;lt;PASSWORD&amp;gt; -s -t 44 -a &amp;lt;44.xxx.xxx.xxx/xx&amp;gt; -x ./etc/config/load_ipipfilter.sh &amp;amp;&#039;&#039;&#039;&lt;br /&gt;
 ## Allows traceroute to respond using 44net IP of tunl0 or br-amprlan ##&lt;br /&gt;
 echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_errors_use_inbound_ifaddr&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;AMPRNet Policy Routes&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # add IP Route to /etc/config/network&lt;br /&gt;
 &lt;br /&gt;
 config route&lt;br /&gt;
 	option interface &#039;amprwan&#039;&lt;br /&gt;
 	option target &#039;0.0.0.0&#039;&lt;br /&gt;
 	option netmask &#039;0.0.0.0&#039;&lt;br /&gt;
 	option gateway &#039;&#039;&#039;&#039;&amp;lt;AMPRGW&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
 	option onlink &#039;1&#039;&lt;br /&gt;
 	option table &#039;44&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;AMPRNet Policy Rules&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # add IP Rules to /etc/config/network&lt;br /&gt;
 &lt;br /&gt;
 #OPTIONAL AMPR TO LAN RULES (NUMBER 22-2X ACCORDINGLY)&lt;br /&gt;
 config rule&lt;br /&gt;
 	option src &#039;44.xxx.xxx.0/24&#039;&lt;br /&gt;
 	option dest &#039;192.168.xxx.0/24&#039;&lt;br /&gt;
 	option priority &#039;22&#039;&lt;br /&gt;
 	option lookup &#039;main&#039;&lt;br /&gt;
 &lt;br /&gt;
 #ADD A MAIN RULE FOR EVERY LOCAL AMPR SUBNET, RENUMBER 44-4X ACCORDINGLY)&lt;br /&gt;
 config rule&lt;br /&gt;
 	option dest &#039;44.xxx.xxx.0/24&#039;&lt;br /&gt;
 	option priority &#039;44&#039;&lt;br /&gt;
 	option lookup &#039;main&#039;&lt;br /&gt;
 &lt;br /&gt;
 ### This ensures all traffic received on tunl0 uses table 44&lt;br /&gt;
 config rule&lt;br /&gt;
 	option in &#039;amprwan&#039;&lt;br /&gt;
 	option dest &#039;0.0.0.0/0&#039;&lt;br /&gt;
 	option priority &#039;45&#039;&lt;br /&gt;
 	option lookup &#039;44&#039;&lt;br /&gt;
 &lt;br /&gt;
 ###Add this after you create the AMPRLAN bridge, this ensures all traffic from AMPRLAN uses table 44&lt;br /&gt;
 config rule&lt;br /&gt;
 	option in &#039;amprnet&#039;&lt;br /&gt;
 	option dest &#039;0.0.0.0/0&#039;&lt;br /&gt;
 	option priority &#039;46&#039;&lt;br /&gt;
 	option lookup &#039;44&#039;&lt;br /&gt;
 &lt;br /&gt;
 ### You must add an IP rule for all 44net IPs residing on the device&lt;br /&gt;
 config rule&lt;br /&gt;
 	option src &#039;44.xxx.xxx.0/24&lt;br /&gt;
 	option priority &#039;47&#039;&lt;br /&gt;
 	option lookup &#039;44&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;reboot&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Enumerating tunnel/VLAN (AMPRWAN/AMPRLAN) Interfaces and firewall zones ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;REMINDER: In OpenWrt 14.07 or lower - be sure to enable connection tracking if you will not masquerade.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Interfaces&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Create an unmanaged Interface instance for tunl0 (&#039;&#039;&#039;AMPRWAN&#039;&#039;&#039;) - &#039;&#039;&#039;set to not bring up on boot&#039;&#039;&#039;, adding it to a new own firewall zone &#039;&#039;&#039;amprwan&#039;&#039;&#039; using&lt;br /&gt;
**Input: Drop (or Reject)&lt;br /&gt;
**Output: Drop (or Reject)&lt;br /&gt;
**Forward: Drop (or Reject)&lt;br /&gt;
* Create an interface instance for a new VLAN and bridge (AMPRNET). &#039;&#039;&#039;Assign an IP from your allocation to this interface - this will become the the Default Route/Gateway IP used on other 44 clients in your VLAN&#039;&#039;&#039; - add it to its own new firewall zone using&lt;br /&gt;
** Input: Accept (if you wish for you AMPRLAN devices to reach the router)&lt;br /&gt;
** Output: Accept; and&lt;br /&gt;
** Forward: Drop (or Reject, depending if you have other downstream routers in this VLAN)&lt;br /&gt;
* &#039;&#039;&#039;reboot&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;General Firewalling&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Permit forwarding from AMPRLAN to AMPRWAN and WAN (you must masquerade this traffic when using WAN)&lt;br /&gt;
* Permit forwarding from LAN to AMPRLAN (as desired, NOTE: you must make an IP Rule for the AMPRLAN to use the LAN&#039;s route on the Main Routing Table)&lt;br /&gt;
* &#039;&#039;For IPENCAP in&#039;&#039; - create Traffic Input rule to allow IPv4 IPENCAP (IP protocol type 4) from Any IP on WAN to any IP on Router &#039;&#039;(or configure optional dynamic script above, see [[Firewalls#OpenWrt|Firewalls - OpenWrt]])&#039;&#039;&lt;br /&gt;
** specify WAN IP instead of &#039;&#039;Any&#039;&#039; - if statically assigned by ISP&lt;br /&gt;
* &#039;&#039;For [[RIP| RIP44]] packets in&#039;&#039; - create Traffic Input rule to allow IPv4 udp/520 from 44.0.0.1 in AMPRWAN to 224.0.0.9 at port udp/520 IP on Router&lt;br /&gt;
* Create Traffic Forward rules for any inbound services (as desired)&lt;br /&gt;
* assign the new VLAN to any switch/trunk ports (as desired)&lt;br /&gt;
* make ampr-ripd and load_ipipfilter.sh executable using &#039;&#039;&#039;chmod +x&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Lastly&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* test ampr-ripd in console using the &#039;&#039;&#039;-d&#039;&#039;&#039; argument&lt;br /&gt;
* add password to the &#039;&#039;&#039;Local Startup&#039;&#039;&#039; entry and uncomment ampr-ripd line&lt;br /&gt;
* &#039;&#039;&#039;reboot&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[ampr-ripd]]&lt;br /&gt;
* [[Firewalls#OpenWrt|Firewalls - OpenWrt]]&lt;br /&gt;
* [[RIP44.lua]]&lt;br /&gt;
* https://openwrt.org/docs/guide-user/network/start&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=791</id>
		<title>Firewalls</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=791"/>
		<updated>2019-01-21T20:54:24Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: accidentally added my own subnet to ipset bogons, edited ipset to properly reflect&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the Firewall Wiki.&lt;br /&gt;
&lt;br /&gt;
This page is intended to be edited by the community to add use practices, command syntax, etc. regarding firewalling and security on AMPRNet nodes. While each operator is ultimately responsible for the administration of their node, it is highly suggested amongst the [[44Net mailing list]] Community that nodes be firewalled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cisco ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DD-WRT ==&lt;br /&gt;
&lt;br /&gt;
DD-WRT uses an iptables-based firewall (see iptables below). Custom rules can be entered at &#039;&#039;&#039;Administration &amp;gt; Commands &amp;gt; &amp;quot;Save Firewall&amp;quot;&#039;&#039;&#039; on the web GUI.&lt;br /&gt;
&lt;br /&gt;
See:&lt;br /&gt;
&lt;br /&gt;
* https://www.dd-wrt.com/wiki/index.php/Iptables&lt;br /&gt;
* https://www.dd-wrt.com/wiki/index.php/Firewall&lt;br /&gt;
&lt;br /&gt;
== D-Link ==&lt;br /&gt;
&lt;br /&gt;
On some D-Link devices, the port forwarding feature allows for the options: TCP, UDP and Other. The &amp;quot;Other&amp;quot; option on these models are capable of Destination NAT of IPENCAP packets.&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4) &#039;&#039;&#039;Note: this rule is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In Port Forwarding on the web GUI:&lt;br /&gt;
&lt;br /&gt;
* Create a new Port Forward&lt;br /&gt;
* Enter the LAN IP of your AMPR node&lt;br /&gt;
* Select &amp;quot;Other&amp;quot;&lt;br /&gt;
* Type the number &#039;&#039;&#039;4&#039;&#039;&#039; into the field&lt;br /&gt;
&lt;br /&gt;
== iptables ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* On an iptables-based firewall, you must enable connection tracking on the tunl0 interface in order to enable Stateful Packet Inspection (i.e. a stateful firewall).&lt;br /&gt;
* Since the IPENCAP Linux Kernel Module IPIP is in the kernel, &#039;&#039;&#039;you must set the default forwarding policy to DROP or REJECT.&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;If you set your default routing policy to ACCEPT, all packets that have not been explicitly DROPped or REJECTed elsewhere, will route, regardless of firewall policies.&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;For most embedded devices, it is suggested to use [[Firewalls#ipset|ipset]] rules instead&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;General Bogon rules&#039;&#039;&#039; - see: https://en.wikipedia.org/wiki/Bogon_filtering&lt;br /&gt;
&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS IP TRAFFIC THAT&#039;S INVALID ENTERING OR EXITING AMPR&lt;br /&gt;
 # THIS PREVENTS A GENERAL LOOP&lt;br /&gt;
 iptables -I FORWARD -i tunl0 -o tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND IPs NOT FROM YOUR ALLOCATION (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING ! -s 44.xxx.xxx.xxx/xx -i br-amprnet -j DROP&lt;br /&gt;
 # DROPS ROGUE INBOUND ASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 44.xxx.xxx.xxx/xx -i tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND UNASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 # YOU MUST ADD A RULE UNDER THIS LINE TO MAKE EXCEPTIONS (BCP 38)&lt;br /&gt;
 iptables -I FORWARD ! -s 44.xxx.xxx.xxx/xx -o tunl0 -j DROP&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS BOGONS ENTERING AMPRNet&lt;br /&gt;
 # SEE http://www.team-cymru.org/Services/Bogons/bogon-bn-nonagg.txt&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 0.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 10.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 100.64.0.0/10 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 127.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 169.254.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 172.16.0.0/12 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.0.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.2.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.168.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.18.0.0/15 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.51.100.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 203.0.113.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 224.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 240.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 # Block of Test AMPRNet Subnet&lt;br /&gt;
 # iptables -t raw -I PREROUTING -s 44.128.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 # (you can optionally block your subnet)&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # THIS PREVENTS NESTED IPENCAP (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING -p 4 -i tunl0 -j DROP&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes (using iptables)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable dynamic filtering of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NOTE:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;This script needs work, see Thu Jan 10 11:09:27 PST 2019 message in the [[44Net mailing list]] archive. Due to extreme overheard running on many devices, the ipset script is suggested instead.&#039;&#039;&lt;br /&gt;
* This rule (or one of the ipset or static rules below) is required for other AMPR nodes to initiate inbound traffic to your node.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;REQUIRED:&#039;&#039;&lt;br /&gt;
[[ampr-ripd]] (using the -x and -d arguments), the diff command from the [http://www.gnu.org/software/diffutils/manual/diffutils.html diffutils package] and the [https://www.gnu.org/software/sed/manual/sed.html sed command].&lt;br /&gt;
&lt;br /&gt;
 # Place this rule a the last firewall command&lt;br /&gt;
 # Uncomment sleep command below if the rule does not appear&lt;br /&gt;
 # as load_ipipfilter.sh is still executing&lt;br /&gt;
 # sleep 10&lt;br /&gt;
 # load ipipfilter list rule&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF WAN&amp;gt;&#039;&#039;&#039; -j ipipfilter&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 # by Rob, PE1CHL&lt;br /&gt;
 # load_ipipfilter.sh&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 AMPRGW=&amp;quot;&#039;&#039;&#039;&amp;lt;AMPRGW&amp;gt;&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
 gwfile=&amp;quot;/tmp/gw&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 # Parse encap.txt for Node IPs and place in /tmp/gw&lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u &amp;gt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
 # Run command to create CHAIN, IF no system output, CHAIN was created&lt;br /&gt;
 iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 if [ $? -eq 0 ]&lt;br /&gt;
 &#039;&#039;&#039;# DO NOT PLACE EMPTY LINES BETWEEN THE TWO COMMANDS ABOVE. ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# THE EQUATION ASKS IF THE LAST SYSTEM COMMAND ENTERED ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# RETURNS &amp;quot;NOTHING.&amp;quot; ADDING A SPACE WILL CHANGE RESULTS OF THE IF COMMAND. ###&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 ##The two lines above replace the line below, which does not work on OpenWRT&lt;br /&gt;
 # if iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 ## &lt;br /&gt;
 &lt;br /&gt;
 # IF no system output, THEN flush the CHAIN and add AMPRGW,&lt;br /&gt;
 # add nodes in encap.txt and a final DROP rule&lt;br /&gt;
 then&lt;br /&gt;
     iptables -F ipipfilter&lt;br /&gt;
     iptables -A ipipfilter -s $AMPRGW -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
     while read ip&lt;br /&gt;
     do&lt;br /&gt;
         iptables -A ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
     done &amp;lt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
     iptables -A ipipfilter -j DROP&lt;br /&gt;
 &lt;br /&gt;
 # ELSE, the CHAIN already exists, determine changes&lt;br /&gt;
 # and INSERT new nodes and DELETE old nodes (excluding AMPRGW)&lt;br /&gt;
 else&lt;br /&gt;
     iptables -L ipipfilter -n | grep ACCEPT | fgrep -v $AMPRGW | \&lt;br /&gt;
         sed -e &#039;s/.*--  //&#039; -e &#039;s/ .*//&#039; | sort | diff - $gwfile | \&lt;br /&gt;
         while read d ip&lt;br /&gt;
         do&lt;br /&gt;
             case &amp;quot;$d&amp;quot; in&lt;br /&gt;
             &amp;quot;&amp;gt;&amp;quot;)&lt;br /&gt;
                 iptables -I ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             &amp;quot;&amp;lt;&amp;quot;)&lt;br /&gt;
                 iptables -D ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             *)&lt;br /&gt;
                 ;;&lt;br /&gt;
             esac&lt;br /&gt;
         done&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 # Delete /tmp/gw when done&lt;br /&gt;
 rm -f $gwfile&lt;br /&gt;
 &lt;br /&gt;
 # The full pathname of this script /usr/local/sbin/load_ipipfilter is passed with the new -x&lt;br /&gt;
 # option to ampr-ripd.   It will load the entire filter the first time, and later it will only update&lt;br /&gt;
 # the filters that have changed.  It is required that the -s option is passed as well, so the&lt;br /&gt;
 # encap.txt file is created by ampr-ripd.&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Static IPENCAP Filtering of AMPR Nodes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note:&#039;&#039;&lt;br /&gt;
* This rule (the dynamic rule above, or the ipset rules) is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF YOUR WAN&amp;gt;&#039;&#039;&#039; -j ACCEPT &lt;br /&gt;
&lt;br /&gt;
If your AMPR node is downstream, you will create an INPUT &#039;&#039;&#039;and&#039;&#039;&#039; DNAT forward rule to the destination LAN IP of your AMPR node.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;To enable receipt of [[RIP]]44&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p udp -s 44.0.0.1 --sport 520 -d 224.0.0.9 --dport 520 -i tunl0 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Masquerade LAN Subnets to AMPRNet&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* In this instance, eth1 is your 192.168.1.0/24 LAN - (thanks to Brian, N1URO)&lt;br /&gt;
&#039;&#039;See: https://n1uro.ampr.org/linuxconf/44nat.html&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # NAT setup&lt;br /&gt;
 iptables -t nat -A POSTROUTING -s 192.168.0/24 -o tunl0 -j MASQUERADE -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -m state --state RELATED,ESTABLISHED -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
&lt;br /&gt;
== ipset ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;General Bogon rules using ipset&#039;&#039;&#039; - see: https://en.wikipedia.org/wiki/Bogon_filtering&lt;br /&gt;
&lt;br /&gt;
 #######################BOGON FILTER ########################                                                                                                                                          &lt;br /&gt;
 ipset create bogons hash:net&lt;br /&gt;
 # BOGON LIST                                                                                                                                                                                          &lt;br /&gt;
 # SEE http://www.team-cymru.org/Services/Bogons/bogon-bn-nonagg.txt                                                                                                                                   &lt;br /&gt;
 ipset -A bogons 0.0.0.0/8                                                                                                                                                                             &lt;br /&gt;
 ipset -A bogons 10.0.0.0/8                                                                                                                                                                            &lt;br /&gt;
 ipset -A bogons 100.64.0.0/10                                                                                                                                                                         &lt;br /&gt;
 ipset -A bogons 127.0.0.0/8                                                                                                                                                                           &lt;br /&gt;
 ipset -A bogons 169.254.0.0/16                                                                                                                                                                        &lt;br /&gt;
 ipset -A bogons 172.16.0.0/12                                                                                                                                                                         &lt;br /&gt;
 ipset -A bogons 192.0.0.0/24                                                                                                                                                                          &lt;br /&gt;
 ipset -A bogons 192.0.2.0/24                                                                                                                                                                          &lt;br /&gt;
 ipset -A bogons 192.168.0.0/16                                                                                                                                                                        &lt;br /&gt;
 ipset -A bogons 198.18.0.0/15                                                                                                                                                                         &lt;br /&gt;
 ipset -A bogons 198.51.100.0/24                                                                                                                                                                       &lt;br /&gt;
 ipset -A bogons 203.0.113.0/24                                                                                                                                                                        &lt;br /&gt;
 ipset -A bogons 224.0.0.0/4                                                                                                                                                                           &lt;br /&gt;
 ipset -A bogons 240.0.0.0/4   &lt;br /&gt;
 # Block of your own AMPRNet Subnet                                                                                                                                                                        &lt;br /&gt;
 # ipset -A bogons 44.xxx.xxx.xxx/xx&lt;br /&gt;
 # Block of Test AMPRNet Subnet&lt;br /&gt;
 # ipset -A bogons 44.128.0.0/16&lt;br /&gt;
&lt;br /&gt;
(you can optionally block your subnet)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes (using ipset)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable dynamic filtering of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;REQUIRED:&#039;&#039; [[ampr-ripd]] (using the -x and -d arguments) and the ipset package.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 ipset -N ipipfilter hash:ip 2&amp;gt;/dev/null&lt;br /&gt;
 ipset flush ipipfilter&lt;br /&gt;
 ipset -A ipipfilter &amp;lt;AMPRGW&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u | while read ip&lt;br /&gt;
 do&lt;br /&gt;
     ipset -A ipipfilter $ip&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
== Microtik ==&lt;br /&gt;
&lt;br /&gt;
== OpenWrt ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;See: [[Firewalls#iptables|iptables]] and [[Firewalls#ipset|ipset]] (above), and the Instructions for [[setting up a gateway on OpenWRT|setting up a gateway on OpenWRT]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* the Bogon ipset script is added to &#039;&#039;&#039;System &amp;gt; Startup&#039;&#039;&#039; on the web GUI - or into the Unified Configuration Interface (UCI) file &#039;&#039;/etc/rc.local&#039;&#039;&lt;br /&gt;
* [[Firewalls#iptables|iptables]]-based scripts are entered at &#039;&#039;&#039;Network &amp;gt; Firewall &amp;gt; Custom Firewall&#039;&#039;&#039; on the LuCI web GUI interface - or into the Unified Configuration Interface (UCI) file &#039;&#039;/etc/firewall.user&#039;&#039;&lt;br /&gt;
* [[Firewalls#ipset|ipset]]-based rules are entered on the command line - into the Unified Configuration Interface (UCI) file &#039;&#039;/etc/config/firewall&#039;&#039; &#039;&#039;(OpenWrt syntax must be used in this file!)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Adding Bogon drop rule to OpenWrt (using [[Firewalls#ipset|ipset]])&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # in /etc/config/firewall&lt;br /&gt;
 config rule&lt;br /&gt;
 	option name &#039;Drop-Bogons_In_AMPRWAN&#039;&lt;br /&gt;
 	option family &#039;ipv4&#039;&lt;br /&gt;
 	option proto &#039;all&#039;&lt;br /&gt;
 	option src &#039;amprwan&#039;&lt;br /&gt;
 	option target &#039;DROP&#039;&lt;br /&gt;
 	option extra &#039;-m set --match-set bogons src&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Adding IPENCAP Filtering of AMPR Nodes to OpenWrt (using [[Firewalls#ipset|ipset]])&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # in /etc/config/firewall&lt;br /&gt;
 config rule&lt;br /&gt;
 	option target &#039;ACCEPT&#039;&lt;br /&gt;
 	option src &#039;wan&#039;&lt;br /&gt;
 	option family &#039;ipv4&#039;&lt;br /&gt;
 	option proto &#039;4&#039;&lt;br /&gt;
 	option name &#039;Allow-AMPR_IPENCAP&#039;&lt;br /&gt;
 	option extra &#039;-m set --match-set ipipfilter src&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Adding ICMP Filtering of AMPR Nodes to OpenWrt (using [[Firewalls#ipset|ipset]])&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # in /etc/config/firewall&lt;br /&gt;
 config rule&lt;br /&gt;
 	option target &#039;ACCEPT&#039;&lt;br /&gt;
 	option family &#039;ipv4&#039;&lt;br /&gt;
 	option proto &#039;icmp&#039;&lt;br /&gt;
 	list icmp_type &#039;echo-request&#039;&lt;br /&gt;
 	option src &#039;*&#039; &lt;br /&gt;
 	option extra &#039;-m set --match-set ipipfilter src&#039;&lt;br /&gt;
 	option name &#039;Ping_fromIPENCAPS&#039;&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=790</id>
		<title>Firewalls</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=790"/>
		<updated>2019-01-12T16:09:19Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: added warning about using iptables on embeded devices - ipset prefered&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the Firewall Wiki.&lt;br /&gt;
&lt;br /&gt;
This page is intended to be edited by the community to add use practices, command syntax, etc. regarding firewalling and security on AMPRNet nodes. While each operator is ultimately responsible for the administration of their node, it is highly suggested amongst the [[44Net mailing list]] Community that nodes be firewalled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cisco ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DD-WRT ==&lt;br /&gt;
&lt;br /&gt;
DD-WRT uses an iptables-based firewall (see iptables below). Custom rules can be entered at &#039;&#039;&#039;Administration &amp;gt; Commands &amp;gt; &amp;quot;Save Firewall&amp;quot;&#039;&#039;&#039; on the web GUI.&lt;br /&gt;
&lt;br /&gt;
See:&lt;br /&gt;
&lt;br /&gt;
* https://www.dd-wrt.com/wiki/index.php/Iptables&lt;br /&gt;
* https://www.dd-wrt.com/wiki/index.php/Firewall&lt;br /&gt;
&lt;br /&gt;
== D-Link ==&lt;br /&gt;
&lt;br /&gt;
On some D-Link devices, the port forwarding feature allows for the options: TCP, UDP and Other. The &amp;quot;Other&amp;quot; option on these models are capable of Destination NAT of IPENCAP packets.&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4) &#039;&#039;&#039;Note: this rule is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In Port Forwarding on the web GUI:&lt;br /&gt;
&lt;br /&gt;
* Create a new Port Forward&lt;br /&gt;
* Enter the LAN IP of your AMPR node&lt;br /&gt;
* Select &amp;quot;Other&amp;quot;&lt;br /&gt;
* Type the number &#039;&#039;&#039;4&#039;&#039;&#039; into the field&lt;br /&gt;
&lt;br /&gt;
== iptables ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* On an iptables-based firewall, you must enable connection tracking on the tunl0 interface in order to enable Stateful Packet Inspection (i.e. a stateful firewall).&lt;br /&gt;
* Since the IPENCAP Linux Kernel Module IPIP is in the kernel, &#039;&#039;&#039;you must set the default forwarding policy to DROP or REJECT.&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;If you set your default routing policy to ACCEPT, all packets that have not been explicitly DROPped or REJECTed elsewhere, will route, regardless of firewall policies.&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;For most embedded devices, it is suggested to use [[Firewalls#ipset|ipset]] rules instead&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;General Bogon rules&#039;&#039;&#039; - see: https://en.wikipedia.org/wiki/Bogon_filtering&lt;br /&gt;
&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS IP TRAFFIC THAT&#039;S INVALID ENTERING OR EXITING AMPR&lt;br /&gt;
 # THIS PREVENTS A GENERAL LOOP&lt;br /&gt;
 iptables -I FORWARD -i tunl0 -o tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND IPs NOT FROM YOUR ALLOCATION (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING ! -s 44.xxx.xxx.xxx/xx -i br-amprnet -j DROP&lt;br /&gt;
 # DROPS ROGUE INBOUND ASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 44.xxx.xxx.xxx/xx -i tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND UNASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 # YOU MUST ADD A RULE UNDER THIS LINE TO MAKE EXCEPTIONS (BCP 38)&lt;br /&gt;
 iptables -I FORWARD ! -s 44.xxx.xxx.xxx/xx -o tunl0 -j DROP&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS BOGONS ENTERING AMPRNet&lt;br /&gt;
 # SEE http://www.team-cymru.org/Services/Bogons/bogon-bn-nonagg.txt&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 0.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 10.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 100.64.0.0/10 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 127.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 169.254.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 172.16.0.0/12 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.0.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.2.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.168.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.18.0.0/15 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.51.100.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 203.0.113.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 224.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 240.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 # Block of Test AMPRNet Subnet&lt;br /&gt;
 # iptables -t raw -I PREROUTING -s 44.128.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 # (you can optionally block your subnet)&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # THIS PREVENTS NESTED IPENCAP (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING -p 4 -i tunl0 -j DROP&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes (using iptables)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable dynamic filtering of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NOTE:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;This script needs work, see Thu Jan 10 11:09:27 PST 2019 message in the [[44Net mailing list]] archive. Due to extreme overheard running on many devices, the ipset script is suggested instead.&#039;&#039;&lt;br /&gt;
* This rule (or one of the ipset or static rules below) is required for other AMPR nodes to initiate inbound traffic to your node.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;REQUIRED:&#039;&#039;&lt;br /&gt;
[[ampr-ripd]] (using the -x and -d arguments), the diff command from the [http://www.gnu.org/software/diffutils/manual/diffutils.html diffutils package] and the [https://www.gnu.org/software/sed/manual/sed.html sed command].&lt;br /&gt;
&lt;br /&gt;
 # Place this rule a the last firewall command&lt;br /&gt;
 # Uncomment sleep command below if the rule does not appear&lt;br /&gt;
 # as load_ipipfilter.sh is still executing&lt;br /&gt;
 # sleep 10&lt;br /&gt;
 # load ipipfilter list rule&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF WAN&amp;gt;&#039;&#039;&#039; -j ipipfilter&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 # by Rob, PE1CHL&lt;br /&gt;
 # load_ipipfilter.sh&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 AMPRGW=&amp;quot;&#039;&#039;&#039;&amp;lt;AMPRGW&amp;gt;&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
 gwfile=&amp;quot;/tmp/gw&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 # Parse encap.txt for Node IPs and place in /tmp/gw&lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u &amp;gt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
 # Run command to create CHAIN, IF no system output, CHAIN was created&lt;br /&gt;
 iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 if [ $? -eq 0 ]&lt;br /&gt;
 &#039;&#039;&#039;# DO NOT PLACE EMPTY LINES BETWEEN THE TWO COMMANDS ABOVE. ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# THE EQUATION ASKS IF THE LAST SYSTEM COMMAND ENTERED ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# RETURNS &amp;quot;NOTHING.&amp;quot; ADDING A SPACE WILL CHANGE RESULTS OF THE IF COMMAND. ###&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 ##The two lines above replace the line below, which does not work on OpenWRT&lt;br /&gt;
 # if iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 ## &lt;br /&gt;
 &lt;br /&gt;
 # IF no system output, THEN flush the CHAIN and add AMPRGW,&lt;br /&gt;
 # add nodes in encap.txt and a final DROP rule&lt;br /&gt;
 then&lt;br /&gt;
     iptables -F ipipfilter&lt;br /&gt;
     iptables -A ipipfilter -s $AMPRGW -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
     while read ip&lt;br /&gt;
     do&lt;br /&gt;
         iptables -A ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
     done &amp;lt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
     iptables -A ipipfilter -j DROP&lt;br /&gt;
 &lt;br /&gt;
 # ELSE, the CHAIN already exists, determine changes&lt;br /&gt;
 # and INSERT new nodes and DELETE old nodes (excluding AMPRGW)&lt;br /&gt;
 else&lt;br /&gt;
     iptables -L ipipfilter -n | grep ACCEPT | fgrep -v $AMPRGW | \&lt;br /&gt;
         sed -e &#039;s/.*--  //&#039; -e &#039;s/ .*//&#039; | sort | diff - $gwfile | \&lt;br /&gt;
         while read d ip&lt;br /&gt;
         do&lt;br /&gt;
             case &amp;quot;$d&amp;quot; in&lt;br /&gt;
             &amp;quot;&amp;gt;&amp;quot;)&lt;br /&gt;
                 iptables -I ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             &amp;quot;&amp;lt;&amp;quot;)&lt;br /&gt;
                 iptables -D ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             *)&lt;br /&gt;
                 ;;&lt;br /&gt;
             esac&lt;br /&gt;
         done&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 # Delete /tmp/gw when done&lt;br /&gt;
 rm -f $gwfile&lt;br /&gt;
 &lt;br /&gt;
 # The full pathname of this script /usr/local/sbin/load_ipipfilter is passed with the new -x&lt;br /&gt;
 # option to ampr-ripd.   It will load the entire filter the first time, and later it will only update&lt;br /&gt;
 # the filters that have changed.  It is required that the -s option is passed as well, so the&lt;br /&gt;
 # encap.txt file is created by ampr-ripd.&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Static IPENCAP Filtering of AMPR Nodes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note:&#039;&#039;&lt;br /&gt;
* This rule (the dynamic rule above, or the ipset rules) is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF YOUR WAN&amp;gt;&#039;&#039;&#039; -j ACCEPT &lt;br /&gt;
&lt;br /&gt;
If your AMPR node is downstream, you will create an INPUT &#039;&#039;&#039;and&#039;&#039;&#039; DNAT forward rule to the destination LAN IP of your AMPR node.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;To enable receipt of [[RIP]]44&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p udp -s 44.0.0.1 --sport 520 -d 224.0.0.9 --dport 520 -i tunl0 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Masquerade LAN Subnets to AMPRNet&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* In this instance, eth1 is your 192.168.1.0/24 LAN - (thanks to Brian, N1URO)&lt;br /&gt;
&#039;&#039;See: https://n1uro.ampr.org/linuxconf/44nat.html&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # NAT setup&lt;br /&gt;
 iptables -t nat -A POSTROUTING -s 192.168.0/24 -o tunl0 -j MASQUERADE -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -m state --state RELATED,ESTABLISHED -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
&lt;br /&gt;
== ipset ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;General Bogon rules using ipset&#039;&#039;&#039; - see: https://en.wikipedia.org/wiki/Bogon_filtering&lt;br /&gt;
&lt;br /&gt;
 #######################BOGON FILTER ########################                                                                                                                                          &lt;br /&gt;
 ipset create bogons hash:net&lt;br /&gt;
 # BOGON LIST                                                                                                                                                                                          &lt;br /&gt;
 # SEE http://www.team-cymru.org/Services/Bogons/bogon-bn-nonagg.txt                                                                                                                                   &lt;br /&gt;
 ipset -A bogons 0.0.0.0/8                                                                                                                                                                             &lt;br /&gt;
 ipset -A bogons 10.0.0.0/8                                                                                                                                                                            &lt;br /&gt;
 ipset -A bogons 100.64.0.0/10                                                                                                                                                                         &lt;br /&gt;
 ipset -A bogons 127.0.0.0/8                                                                                                                                                                           &lt;br /&gt;
 ipset -A bogons 169.254.0.0/16                                                                                                                                                                        &lt;br /&gt;
 ipset -A bogons 172.16.0.0/12                                                                                                                                                                         &lt;br /&gt;
 ipset -A bogons 192.0.0.0/24                                                                                                                                                                          &lt;br /&gt;
 ipset -A bogons 192.0.2.0/24                                                                                                                                                                          &lt;br /&gt;
 ipset -A bogons 192.168.0.0/16                                                                                                                                                                        &lt;br /&gt;
 ipset -A bogons 198.18.0.0/15                                                                                                                                                                         &lt;br /&gt;
 ipset -A bogons 198.51.100.0/24                                                                                                                                                                       &lt;br /&gt;
 ipset -A bogons 203.0.113.0/24                                                                                                                                                                        &lt;br /&gt;
 ipset -A bogons 224.0.0.0/4                                                                                                                                                                           &lt;br /&gt;
 ipset -A bogons 240.0.0.0/4                                                                                                                                                                           &lt;br /&gt;
 ipset -A bogons 44.60.44.0/24&lt;br /&gt;
 # Block of Test AMPRNet Subnet&lt;br /&gt;
 # ipset -A bogons 44.128.0.0/16&lt;br /&gt;
&lt;br /&gt;
(you can optionally block your subnet)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes (using ipset)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable dynamic filtering of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;REQUIRED:&#039;&#039; [[ampr-ripd]] (using the -x and -d arguments) and the ipset package.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 ipset -N ipipfilter hash:ip 2&amp;gt;/dev/null&lt;br /&gt;
 ipset flush ipipfilter&lt;br /&gt;
 ipset -A ipipfilter &amp;lt;AMPRGW&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u | while read ip&lt;br /&gt;
 do&lt;br /&gt;
     ipset -A ipipfilter $ip&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
== Microtik ==&lt;br /&gt;
&lt;br /&gt;
== OpenWrt ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;See: [[Firewalls#iptables|iptables]] and [[Firewalls#ipset|ipset]] (above), and the Instructions for [[setting up a gateway on OpenWRT|setting up a gateway on OpenWRT]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* the Bogon ipset script is added to &#039;&#039;&#039;System &amp;gt; Startup&#039;&#039;&#039; on the web GUI - or into the Unified Configuration Interface (UCI) file &#039;&#039;/etc/rc.local&#039;&#039;&lt;br /&gt;
* [[Firewalls#iptables|iptables]]-based scripts are entered at &#039;&#039;&#039;Network &amp;gt; Firewall &amp;gt; Custom Firewall&#039;&#039;&#039; on the LuCI web GUI interface - or into the Unified Configuration Interface (UCI) file &#039;&#039;/etc/firewall.user&#039;&#039;&lt;br /&gt;
* [[Firewalls#ipset|ipset]]-based rules are entered on the command line - into the Unified Configuration Interface (UCI) file &#039;&#039;/etc/config/firewall&#039;&#039; &#039;&#039;(OpenWrt syntax must be used in this file!)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Adding Bogon drop rule to OpenWrt (using [[Firewalls#ipset|ipset]])&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # in /etc/config/firewall&lt;br /&gt;
 config rule&lt;br /&gt;
 	option name &#039;Drop-Bogons_In_AMPRWAN&#039;&lt;br /&gt;
 	option family &#039;ipv4&#039;&lt;br /&gt;
 	option proto &#039;all&#039;&lt;br /&gt;
 	option src &#039;amprwan&#039;&lt;br /&gt;
 	option target &#039;DROP&#039;&lt;br /&gt;
 	option extra &#039;-m set --match-set bogons src&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Adding IPENCAP Filtering of AMPR Nodes to OpenWrt (using [[Firewalls#ipset|ipset]])&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # in /etc/config/firewall&lt;br /&gt;
 config rule&lt;br /&gt;
 	option target &#039;ACCEPT&#039;&lt;br /&gt;
 	option src &#039;wan&#039;&lt;br /&gt;
 	option family &#039;ipv4&#039;&lt;br /&gt;
 	option proto &#039;4&#039;&lt;br /&gt;
 	option name &#039;Allow-AMPR_IPENCAP&#039;&lt;br /&gt;
 	option extra &#039;-m set --match-set ipipfilter src&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Adding ICMP Filtering of AMPR Nodes to OpenWrt (using [[Firewalls#ipset|ipset]])&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # in /etc/config/firewall&lt;br /&gt;
 config rule&lt;br /&gt;
 	option target &#039;ACCEPT&#039;&lt;br /&gt;
 	option family &#039;ipv4&#039;&lt;br /&gt;
 	option proto &#039;icmp&#039;&lt;br /&gt;
 	list icmp_type &#039;echo-request&#039;&lt;br /&gt;
 	option src &#039;*&#039; &lt;br /&gt;
 	option extra &#039;-m set --match-set ipipfilter src&#039;&lt;br /&gt;
 	option name &#039;Ping_fromIPENCAPS&#039;&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=789</id>
		<title>Firewalls</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=789"/>
		<updated>2019-01-12T16:05:24Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: add ipset bogon config&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the Firewall Wiki.&lt;br /&gt;
&lt;br /&gt;
This page is intended to be edited by the community to add use practices, command syntax, etc. regarding firewalling and security on AMPRNet nodes. While each operator is ultimately responsible for the administration of their node, it is highly suggested amongst the [[44Net mailing list]] Community that nodes be firewalled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cisco ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DD-WRT ==&lt;br /&gt;
&lt;br /&gt;
DD-WRT uses an iptables-based firewall (see iptables below). Custom rules can be entered at &#039;&#039;&#039;Administration &amp;gt; Commands &amp;gt; &amp;quot;Save Firewall&amp;quot;&#039;&#039;&#039; on the web GUI.&lt;br /&gt;
&lt;br /&gt;
See:&lt;br /&gt;
&lt;br /&gt;
* https://www.dd-wrt.com/wiki/index.php/Iptables&lt;br /&gt;
* https://www.dd-wrt.com/wiki/index.php/Firewall&lt;br /&gt;
&lt;br /&gt;
== D-Link ==&lt;br /&gt;
&lt;br /&gt;
On some D-Link devices, the port forwarding feature allows for the options: TCP, UDP and Other. The &amp;quot;Other&amp;quot; option on these models are capable of Destination NAT of IPENCAP packets.&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4) &#039;&#039;&#039;Note: this rule is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In Port Forwarding on the web GUI:&lt;br /&gt;
&lt;br /&gt;
* Create a new Port Forward&lt;br /&gt;
* Enter the LAN IP of your AMPR node&lt;br /&gt;
* Select &amp;quot;Other&amp;quot;&lt;br /&gt;
* Type the number &#039;&#039;&#039;4&#039;&#039;&#039; into the field&lt;br /&gt;
&lt;br /&gt;
== iptables ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* On an iptables-based firewall, you must enable connection tracking on the tunl0 interface in order to enable Stateful Packet Inspection (i.e. a stateful firewall).&lt;br /&gt;
* Since the IPENCAP Linux Kernel Module IPIP is in the kernel, &#039;&#039;&#039;you must set the default forwarding policy to DROP or REJECT.&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;If you set your default routing policy to ACCEPT, all packets that have not been explicitly DROPped or REJECTed elsewhere, will route, regardless of firewall policies.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;General Bogon rules&#039;&#039;&#039; - see: https://en.wikipedia.org/wiki/Bogon_filtering&lt;br /&gt;
&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS IP TRAFFIC THAT&#039;S INVALID ENTERING OR EXITING AMPR&lt;br /&gt;
 # THIS PREVENTS A GENERAL LOOP&lt;br /&gt;
 iptables -I FORWARD -i tunl0 -o tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND IPs NOT FROM YOUR ALLOCATION (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING ! -s 44.xxx.xxx.xxx/xx -i br-amprnet -j DROP&lt;br /&gt;
 # DROPS ROGUE INBOUND ASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 44.xxx.xxx.xxx/xx -i tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND UNASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 # YOU MUST ADD A RULE UNDER THIS LINE TO MAKE EXCEPTIONS (BCP 38)&lt;br /&gt;
 iptables -I FORWARD ! -s 44.xxx.xxx.xxx/xx -o tunl0 -j DROP&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS BOGONS ENTERING AMPRNet&lt;br /&gt;
 # SEE http://www.team-cymru.org/Services/Bogons/bogon-bn-nonagg.txt&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 0.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 10.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 100.64.0.0/10 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 127.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 169.254.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 172.16.0.0/12 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.0.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.2.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.168.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.18.0.0/15 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.51.100.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 203.0.113.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 224.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 240.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 # Block of Test AMPRNet Subnet&lt;br /&gt;
 # iptables -t raw -I PREROUTING -s 44.128.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 # (you can optionally block your subnet)&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # THIS PREVENTS NESTED IPENCAP (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING -p 4 -i tunl0 -j DROP&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes (using iptables)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable dynamic filtering of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NOTE:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;This script needs work, see Thu Jan 10 11:09:27 PST 2019 message in the [[44Net mailing list]] archive. Due to overheard running on many devices, the ipset script is suggested instead.&#039;&#039;&lt;br /&gt;
* This rule (or one of the ipset or static rules below) is required for other AMPR nodes to initiate inbound traffic to your node.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;REQUIRED:&#039;&#039;&lt;br /&gt;
[[ampr-ripd]] (using the -x and -d arguments), the diff command from the [http://www.gnu.org/software/diffutils/manual/diffutils.html diffutils package] and the [https://www.gnu.org/software/sed/manual/sed.html sed command].&lt;br /&gt;
&lt;br /&gt;
 # Place this rule a the last firewall command&lt;br /&gt;
 # Uncomment sleep command below if the rule does not appear&lt;br /&gt;
 # as load_ipipfilter.sh is still executing&lt;br /&gt;
 # sleep 10&lt;br /&gt;
 # load ipipfilter list rule&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF WAN&amp;gt;&#039;&#039;&#039; -j ipipfilter&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 # by Rob, PE1CHL&lt;br /&gt;
 # load_ipipfilter.sh&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 AMPRGW=&amp;quot;&#039;&#039;&#039;&amp;lt;AMPRGW&amp;gt;&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
 gwfile=&amp;quot;/tmp/gw&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 # Parse encap.txt for Node IPs and place in /tmp/gw&lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u &amp;gt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
 # Run command to create CHAIN, IF no system output, CHAIN was created&lt;br /&gt;
 iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 if [ $? -eq 0 ]&lt;br /&gt;
 &#039;&#039;&#039;# DO NOT PLACE EMPTY LINES BETWEEN THE TWO COMMANDS ABOVE. ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# THE EQUATION ASKS IF THE LAST SYSTEM COMMAND ENTERED ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# RETURNS &amp;quot;NOTHING.&amp;quot; ADDING A SPACE WILL CHANGE RESULTS OF THE IF COMMAND. ###&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 ##The two lines above replace the line below, which does not work on OpenWRT&lt;br /&gt;
 # if iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 ## &lt;br /&gt;
 &lt;br /&gt;
 # IF no system output, THEN flush the CHAIN and add AMPRGW,&lt;br /&gt;
 # add nodes in encap.txt and a final DROP rule&lt;br /&gt;
 then&lt;br /&gt;
     iptables -F ipipfilter&lt;br /&gt;
     iptables -A ipipfilter -s $AMPRGW -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
     while read ip&lt;br /&gt;
     do&lt;br /&gt;
         iptables -A ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
     done &amp;lt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
     iptables -A ipipfilter -j DROP&lt;br /&gt;
 &lt;br /&gt;
 # ELSE, the CHAIN already exists, determine changes&lt;br /&gt;
 # and INSERT new nodes and DELETE old nodes (excluding AMPRGW)&lt;br /&gt;
 else&lt;br /&gt;
     iptables -L ipipfilter -n | grep ACCEPT | fgrep -v $AMPRGW | \&lt;br /&gt;
         sed -e &#039;s/.*--  //&#039; -e &#039;s/ .*//&#039; | sort | diff - $gwfile | \&lt;br /&gt;
         while read d ip&lt;br /&gt;
         do&lt;br /&gt;
             case &amp;quot;$d&amp;quot; in&lt;br /&gt;
             &amp;quot;&amp;gt;&amp;quot;)&lt;br /&gt;
                 iptables -I ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             &amp;quot;&amp;lt;&amp;quot;)&lt;br /&gt;
                 iptables -D ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             *)&lt;br /&gt;
                 ;;&lt;br /&gt;
             esac&lt;br /&gt;
         done&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 # Delete /tmp/gw when done&lt;br /&gt;
 rm -f $gwfile&lt;br /&gt;
 &lt;br /&gt;
 # The full pathname of this script /usr/local/sbin/load_ipipfilter is passed with the new -x&lt;br /&gt;
 # option to ampr-ripd.   It will load the entire filter the first time, and later it will only update&lt;br /&gt;
 # the filters that have changed.  It is required that the -s option is passed as well, so the&lt;br /&gt;
 # encap.txt file is created by ampr-ripd.&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Static IPENCAP Filtering of AMPR Nodes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note:&#039;&#039;&lt;br /&gt;
* This rule (the dynamic rule above, or the ipset rules) is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF YOUR WAN&amp;gt;&#039;&#039;&#039; -j ACCEPT &lt;br /&gt;
&lt;br /&gt;
If your AMPR node is downstream, you will create an INPUT &#039;&#039;&#039;and&#039;&#039;&#039; DNAT forward rule to the destination LAN IP of your AMPR node.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;To enable receipt of [[RIP]]44&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p udp -s 44.0.0.1 --sport 520 -d 224.0.0.9 --dport 520 -i tunl0 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Masquerade LAN Subnets to AMPRNet&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* In this instance, eth1 is your 192.168.1.0/24 LAN - (thanks to Brian, N1URO)&lt;br /&gt;
&#039;&#039;See: https://n1uro.ampr.org/linuxconf/44nat.html&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # NAT setup&lt;br /&gt;
 iptables -t nat -A POSTROUTING -s 192.168.0/24 -o tunl0 -j MASQUERADE -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -m state --state RELATED,ESTABLISHED -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
&lt;br /&gt;
== ipset ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;General Bogon rules using ipset&#039;&#039;&#039; - see: https://en.wikipedia.org/wiki/Bogon_filtering&lt;br /&gt;
&lt;br /&gt;
 #######################BOGON FILTER ########################                                                                                                                                          &lt;br /&gt;
 ipset create bogons hash:net&lt;br /&gt;
 # BOGON LIST                                                                                                                                                                                          &lt;br /&gt;
 # SEE http://www.team-cymru.org/Services/Bogons/bogon-bn-nonagg.txt                                                                                                                                   &lt;br /&gt;
 ipset -A bogons 0.0.0.0/8                                                                                                                                                                             &lt;br /&gt;
 ipset -A bogons 10.0.0.0/8                                                                                                                                                                            &lt;br /&gt;
 ipset -A bogons 100.64.0.0/10                                                                                                                                                                         &lt;br /&gt;
 ipset -A bogons 127.0.0.0/8                                                                                                                                                                           &lt;br /&gt;
 ipset -A bogons 169.254.0.0/16                                                                                                                                                                        &lt;br /&gt;
 ipset -A bogons 172.16.0.0/12                                                                                                                                                                         &lt;br /&gt;
 ipset -A bogons 192.0.0.0/24                                                                                                                                                                          &lt;br /&gt;
 ipset -A bogons 192.0.2.0/24                                                                                                                                                                          &lt;br /&gt;
 ipset -A bogons 192.168.0.0/16                                                                                                                                                                        &lt;br /&gt;
 ipset -A bogons 198.18.0.0/15                                                                                                                                                                         &lt;br /&gt;
 ipset -A bogons 198.51.100.0/24                                                                                                                                                                       &lt;br /&gt;
 ipset -A bogons 203.0.113.0/24                                                                                                                                                                        &lt;br /&gt;
 ipset -A bogons 224.0.0.0/4                                                                                                                                                                           &lt;br /&gt;
 ipset -A bogons 240.0.0.0/4                                                                                                                                                                           &lt;br /&gt;
 ipset -A bogons 44.60.44.0/24&lt;br /&gt;
 # Block of Test AMPRNet Subnet&lt;br /&gt;
 # ipset -A bogons 44.128.0.0/16&lt;br /&gt;
&lt;br /&gt;
(you can optionally block your subnet)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes (using ipset)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable dynamic filtering of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;REQUIRED:&#039;&#039; [[ampr-ripd]] (using the -x and -d arguments) and the ipset package.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 ipset -N ipipfilter hash:ip 2&amp;gt;/dev/null&lt;br /&gt;
 ipset flush ipipfilter&lt;br /&gt;
 ipset -A ipipfilter &amp;lt;AMPRGW&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u | while read ip&lt;br /&gt;
 do&lt;br /&gt;
     ipset -A ipipfilter $ip&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
== Microtik ==&lt;br /&gt;
&lt;br /&gt;
== OpenWrt ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;See: [[Firewalls#iptables|iptables]] and [[Firewalls#ipset|ipset]] (above), and the Instructions for [[setting up a gateway on OpenWRT|setting up a gateway on OpenWRT]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* the Bogon ipset script is added to &#039;&#039;&#039;System &amp;gt; Startup&#039;&#039;&#039; on the web GUI - or into the Unified Configuration Interface (UCI) file &#039;&#039;/etc/rc.local&#039;&#039;&lt;br /&gt;
* [[Firewalls#iptables|iptables]]-based scripts are entered at &#039;&#039;&#039;Network &amp;gt; Firewall &amp;gt; Custom Firewall&#039;&#039;&#039; on the LuCI web GUI interface - or into the Unified Configuration Interface (UCI) file &#039;&#039;/etc/firewall.user&#039;&#039;&lt;br /&gt;
* [[Firewalls#ipset|ipset]]-based rules are entered on the command line - into the Unified Configuration Interface (UCI) file &#039;&#039;/etc/config/firewall&#039;&#039; &#039;&#039;(OpenWrt syntax must be used in this file!)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Adding Bogon drop rule to OpenWrt (using [[Firewalls#ipset|ipset]])&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # in /etc/config/firewall&lt;br /&gt;
 config rule&lt;br /&gt;
 	option name &#039;Drop-Bogons_In_AMPRWAN&#039;&lt;br /&gt;
 	option family &#039;ipv4&#039;&lt;br /&gt;
 	option proto &#039;all&#039;&lt;br /&gt;
 	option src &#039;amprwan&#039;&lt;br /&gt;
 	option target &#039;DROP&#039;&lt;br /&gt;
 	option extra &#039;-m set --match-set bogons src&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Adding IPENCAP Filtering of AMPR Nodes to OpenWrt (using [[Firewalls#ipset|ipset]])&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # in /etc/config/firewall&lt;br /&gt;
 config rule&lt;br /&gt;
 	option target &#039;ACCEPT&#039;&lt;br /&gt;
 	option src &#039;wan&#039;&lt;br /&gt;
 	option family &#039;ipv4&#039;&lt;br /&gt;
 	option proto &#039;4&#039;&lt;br /&gt;
 	option name &#039;Allow-AMPR_IPENCAP&#039;&lt;br /&gt;
 	option extra &#039;-m set --match-set ipipfilter src&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Adding ICMP Filtering of AMPR Nodes to OpenWrt (using [[Firewalls#ipset|ipset]])&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # in /etc/config/firewall&lt;br /&gt;
 config rule&lt;br /&gt;
 	option target &#039;ACCEPT&#039;&lt;br /&gt;
 	option family &#039;ipv4&#039;&lt;br /&gt;
 	option proto &#039;icmp&#039;&lt;br /&gt;
 	list icmp_type &#039;echo-request&#039;&lt;br /&gt;
 	option src &#039;*&#039; &lt;br /&gt;
 	option extra &#039;-m set --match-set ipipfilter src&#039;&lt;br /&gt;
 	option name &#039;Ping_fromIPENCAPS&#039;&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=788</id>
		<title>Firewalls</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=788"/>
		<updated>2019-01-11T17:57:30Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: cleanup&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the Firewall Wiki.&lt;br /&gt;
&lt;br /&gt;
This page is intended to be edited by the community to add use practices, command syntax, etc. regarding firewalling and security on AMPRNet nodes. While each operator is ultimately responsible for the administration of their node, it is highly suggested amongst the [[44Net mailing list]] Community that nodes be firewalled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Cisco ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DD-WRT ==&lt;br /&gt;
&lt;br /&gt;
DD-WRT uses an iptables-based firewall (see iptables below). Custom rules can be entered at &#039;&#039;&#039;Administration &amp;gt; Commands &amp;gt; &amp;quot;Save Firewall&amp;quot;&#039;&#039;&#039; on the web GUI.&lt;br /&gt;
&lt;br /&gt;
See:&lt;br /&gt;
&lt;br /&gt;
* https://www.dd-wrt.com/wiki/index.php/Iptables&lt;br /&gt;
* https://www.dd-wrt.com/wiki/index.php/Firewall&lt;br /&gt;
&lt;br /&gt;
== D-Link ==&lt;br /&gt;
&lt;br /&gt;
On some D-Link devices, the port forwarding feature allows for the options: TCP, UDP and Other. The &amp;quot;Other&amp;quot; option on these models are capable of Destination NAT of IPENCAP packets.&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4) &#039;&#039;&#039;Note: this rule is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In Port Forwarding on the web GUI:&lt;br /&gt;
&lt;br /&gt;
* Create a new Port Forward&lt;br /&gt;
* Enter the LAN IP of your AMPR node&lt;br /&gt;
* Select &amp;quot;Other&amp;quot;&lt;br /&gt;
* Type the number &#039;&#039;&#039;4&#039;&#039;&#039; into the field&lt;br /&gt;
&lt;br /&gt;
== iptables ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* On an iptables-based firewall, you must enable connection tracking on the tunl0 interface in order to enable Stateful Packet Inspection (i.e. a stateful firewall).&lt;br /&gt;
* Since the IPENCAP Linux Kernel Module IPIP is in the kernel, &#039;&#039;&#039;you must set the default forwarding policy to DROP or REJECT.&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;If you set your default routing policy to ACCEPT, all packets that have not been explicitly DROPped or REJECTed elsewhere, will route, regardless of firewall policies.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;General Bogon rules&#039;&#039;&#039; - see: https://en.wikipedia.org/wiki/Bogon_filtering&lt;br /&gt;
&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS IP TRAFFIC THAT&#039;S INVALID ENTERING OR EXITING AMPR&lt;br /&gt;
 # THIS PREVENTS A GENERAL LOOP&lt;br /&gt;
 iptables -I FORWARD -i tunl0 -o tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND IPs NOT FROM YOUR ALLOCATION (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING ! -s 44.xxx.xxx.xxx/xx -i br-amprnet -j DROP&lt;br /&gt;
 # DROPS ROGUE INBOUND ASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 44.xxx.xxx.xxx/xx -i tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND UNASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 # YOU MUST ADD A RULE UNDER THIS LINE TO MAKE EXCEPTIONS (BCP 38)&lt;br /&gt;
 iptables -I FORWARD ! -s 44.xxx.xxx.xxx/xx -o tunl0 -j DROP&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS BOGONS ENTERING AMPRNet&lt;br /&gt;
 # SEE http://www.team-cymru.org/Services/Bogons/bogon-bn-nonagg.txt&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 0.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 10.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 100.64.0.0/10 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 127.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 169.254.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 172.16.0.0/12 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.0.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.2.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.168.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.18.0.0/15 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.51.100.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 203.0.113.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 224.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 240.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 # Block of Test AMPRNet Subnet&lt;br /&gt;
 # iptables -t raw -I PREROUTING -s 44.128.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # THIS PREVENTS NESTED IPENCAP (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING -p 4 -i tunl0 -j DROP&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes (using iptables)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable dynamic filtering of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NOTE:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;This script needs work, see Thu Jan 10 11:09:27 PST 2019 message in the [[44Net mailing list]] archive. Due to overheard running on many devices, the ipset script is suggested instead.&#039;&#039;&lt;br /&gt;
* This rule (or one of the ipset or static rules below) is required for other AMPR nodes to initiate inbound traffic to your node.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;REQUIRED:&#039;&#039;&lt;br /&gt;
[[ampr-ripd]] (using the -x and -d arguments), the diff command from the [http://www.gnu.org/software/diffutils/manual/diffutils.html diffutils package] and the [https://www.gnu.org/software/sed/manual/sed.html sed command].&lt;br /&gt;
&lt;br /&gt;
 # Place this rule a the last firewall command&lt;br /&gt;
 # Uncomment sleep command below if the rule does not appear&lt;br /&gt;
 # as load_ipipfilter.sh is still executing&lt;br /&gt;
 # sleep 10&lt;br /&gt;
 # load ipipfilter list rule&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF WAN&amp;gt;&#039;&#039;&#039; -j ipipfilter&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 # by Rob, PE1CHL&lt;br /&gt;
 # load_ipipfilter.sh&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 AMPRGW=&amp;quot;&#039;&#039;&#039;&amp;lt;AMPRGW&amp;gt;&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
 gwfile=&amp;quot;/tmp/gw&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 # Parse encap.txt for Node IPs and place in /tmp/gw&lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u &amp;gt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
 # Run command to create CHAIN, IF no system output, CHAIN was created&lt;br /&gt;
 iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 if [ $? -eq 0 ]&lt;br /&gt;
 &#039;&#039;&#039;# DO NOT PLACE EMPTY LINES BETWEEN THE TWO COMMANDS ABOVE. ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# THE EQUATION ASKS IF THE LAST SYSTEM COMMAND ENTERED ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# RETURNS &amp;quot;NOTHING.&amp;quot; ADDING A SPACE WILL CHANGE RESULTS OF THE IF COMMAND. ###&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 ##The two lines above replace the line below, which does not work on OpenWRT&lt;br /&gt;
 # if iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 ## &lt;br /&gt;
 &lt;br /&gt;
 # IF no system output, THEN flush the CHAIN and add AMPRGW,&lt;br /&gt;
 # add nodes in encap.txt and a final DROP rule&lt;br /&gt;
 then&lt;br /&gt;
     iptables -F ipipfilter&lt;br /&gt;
     iptables -A ipipfilter -s $AMPRGW -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
     while read ip&lt;br /&gt;
     do&lt;br /&gt;
         iptables -A ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
     done &amp;lt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
     iptables -A ipipfilter -j DROP&lt;br /&gt;
 &lt;br /&gt;
 # ELSE, the CHAIN already exists, determine changes&lt;br /&gt;
 # and INSERT new nodes and DELETE old nodes (excluding AMPRGW)&lt;br /&gt;
 else&lt;br /&gt;
     iptables -L ipipfilter -n | grep ACCEPT | fgrep -v $AMPRGW | \&lt;br /&gt;
         sed -e &#039;s/.*--  //&#039; -e &#039;s/ .*//&#039; | sort | diff - $gwfile | \&lt;br /&gt;
         while read d ip&lt;br /&gt;
         do&lt;br /&gt;
             case &amp;quot;$d&amp;quot; in&lt;br /&gt;
             &amp;quot;&amp;gt;&amp;quot;)&lt;br /&gt;
                 iptables -I ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             &amp;quot;&amp;lt;&amp;quot;)&lt;br /&gt;
                 iptables -D ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             *)&lt;br /&gt;
                 ;;&lt;br /&gt;
             esac&lt;br /&gt;
         done&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 # Delete /tmp/gw when done&lt;br /&gt;
 rm -f $gwfile&lt;br /&gt;
 &lt;br /&gt;
 # The full pathname of this script /usr/local/sbin/load_ipipfilter is passed with the new -x&lt;br /&gt;
 # option to ampr-ripd.   It will load the entire filter the first time, and later it will only update&lt;br /&gt;
 # the filters that have changed.  It is required that the -s option is passed as well, so the&lt;br /&gt;
 # encap.txt file is created by ampr-ripd.&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Static IPENCAP Filtering of AMPR Nodes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note:&#039;&#039;&lt;br /&gt;
* This rule (the dynamic rule above, or the ipset rules) is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF YOUR WAN&amp;gt;&#039;&#039;&#039; -j ACCEPT &lt;br /&gt;
&lt;br /&gt;
If your AMPR node is downstream, you will create an INPUT &#039;&#039;&#039;and&#039;&#039;&#039; DNAT forward rule to the destination LAN IP of your AMPR node.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;To enable receipt of [[RIP]]44&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p udp -s 44.0.0.1 --sport 520 -d 224.0.0.9 --dport 520 -i tunl0 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Masquerade LAN Subnets to AMPRNet&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* In this instance, eth1 is your 192.168.1.0/24 LAN - (thanks to Brian, N1URO)&lt;br /&gt;
&#039;&#039;See: https://n1uro.ampr.org/linuxconf/44nat.html&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # NAT setup&lt;br /&gt;
 iptables -t nat -A POSTROUTING -s 192.168.0/24 -o tunl0 -j MASQUERADE -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -m state --state RELATED,ESTABLISHED -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
&lt;br /&gt;
== ipset ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes (using ipset)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable dynamic filtering of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;REQUIRED:&#039;&#039; [[ampr-ripd]] (using the -x and -d arguments) and the ipset package.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 ipset -N ipipfilter hash:ip 2&amp;gt;/dev/null&lt;br /&gt;
 ipset flush ipipfilter&lt;br /&gt;
 ipset -A ipipfilter &amp;lt;AMPRGW&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u | while read ip&lt;br /&gt;
 do&lt;br /&gt;
     ipset -A ipipfilter $ip&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
== Microtik ==&lt;br /&gt;
&lt;br /&gt;
== OpenWrt ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;See: [[Firewalls#iptables|iptables]] and [[Firewalls#ipset|ipset]] (above), and the Instructions for [[setting up a gateway on OpenWRT|setting up a gateway on OpenWRT]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* [[Firewalls#iptables|iptables]]-based rules are entered at &#039;&#039;&#039;Network &amp;gt; Firewall &amp;gt; Custom Firewall&#039;&#039;&#039; on the LuCI web GUI interface&lt;br /&gt;
* [[Firewalls#ipset|ipset]]-based rules are entered on the command line - into the Unified Configuration Interface (UCI) file &#039;&#039;/etc/config/firewall&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Adding IPENCAP Filtering of AMPR Nodes to OpenWrt (using [[Firewalls#ipset|ipset]])&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # in /etc/config/firewall&lt;br /&gt;
 config rule&lt;br /&gt;
 	option target &#039;ACCEPT&#039;&lt;br /&gt;
 	option src &#039;wan&#039;&lt;br /&gt;
 	option family &#039;ipv4&#039;&lt;br /&gt;
 	option proto &#039;4&#039;&lt;br /&gt;
 	option name &#039;Allow-AMPR_IPENCAP&#039;&lt;br /&gt;
 	option extra &#039;-m set --match-set ipipfilter src&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Adding ICMP Filtering of AMPR Nodes to OpenWrt (using [[Firewalls#ipset|ipset]])&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # in /etc/config/firewall&lt;br /&gt;
 config rule&lt;br /&gt;
 	option target &#039;ACCEPT&#039;&lt;br /&gt;
 	option family &#039;ipv4&#039;&lt;br /&gt;
 	option proto &#039;icmp&#039;&lt;br /&gt;
 	list icmp_type &#039;echo-request&#039;&lt;br /&gt;
 	option src &#039;*&#039; &lt;br /&gt;
 	option extra &#039;-m set --match-set ipipfilter src&#039;&lt;br /&gt;
 	option name &#039;Ping_fromIPENCAPS&#039;&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Setting_up_a_gateway_on_OpenWRT&amp;diff=787</id>
		<title>Setting up a gateway on OpenWRT</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Setting_up_a_gateway_on_OpenWRT&amp;diff=787"/>
		<updated>2019-01-11T17:48:05Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: cleanup&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This Wiki provides operators a straightforward method of configuring your OpenWrt device for use with the [[ARDC]] network.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Running the [[RIP| RIP44 protocol]] ==&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* To operate a [[Gateway]] on [[AMPRNet]], you must run software to obtain up-to-date route information - a variant of [https://en.wikipedia.org/wiki/Routing_Information_Protocol RIP version 2] protocol named [[RIP| RIP44]] is used&lt;br /&gt;
* The implementation of [https://en.wikipedia.org/wiki/Routing_Information_Protocol RIP version 2] and RIP44 &#039;&#039;&#039;[[RIP#What&#039;s the difference?|are not the same]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Therefore:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;You must have access to a binary [https://en.wikipedia.org/wiki/Executable executable] of [[ampr-ripd]] that is compatible with the [https://en.wikipedia.org/wiki/Central_processing_unit CPU] in your OpenWrt device (e.g. i386, i586, x86_64, MIPS, PPC, etc.). If you do not, you must [https://en.wikipedia.org/wiki/Compiler compile] ampr-ripd yourself, or install the packages necessary to run [[rip44d]].&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;[[ampr-ripd]]&#039;&#039;&#039; (written in C by YO2LOJ) is used in this Wiki example, as fewer prerequisite software are required (e.g. C++ library), compared to [[rip44d]]&lt;br /&gt;
* &#039;&#039;There is also an experimental [[RIP44.lua]] daemon which should run with standard packages&#039;&#039;&lt;br /&gt;
* &#039;&#039;For information about compiling for OpenWrt devices, see:&#039;&#039;&lt;br /&gt;
** [https://openwrt.org/docs/guide-developer/crosscompile Cross Compile - OpenWrt]&lt;br /&gt;
** [https://openwrt.org/docs/start OpenWrt Manual]&lt;br /&gt;
&lt;br /&gt;
== Before we begin - assumptions ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE - &#039;&#039;&#039; &#039;&#039;these instructions assume:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* That you have been assigned AMPRNet IP address allocations that are properly claimed; and your [[Gateway]] IP or hostname configured on your account in the [[Portal]]&lt;br /&gt;
* &#039;&#039;&#039;That you have properly enabled DNS PTR records with your AMPRNet regional coordinator - this enables global IP addresses usage&#039;&#039;&#039;&lt;br /&gt;
* That you intend to configure your OpenWrt-based (version 14.07 or greater) AMPRNet [[Gateway]] to be a [https://en.wikipedia.org/wiki/Stateful_firewall stateful firewall] for your AMPRNet allocations (i.e. enabling connection tracking). If you prefer to forward all traffic to your allocated AMPRNet IP addresses, you may follow these instructions; but configure your Firewall Zones to forward all traffic to/from AMPRLAN to AMPRWAN&lt;br /&gt;
* These instructions configure your AMPRNet Tunnel and AMPRNet Local Interfaces in their own [https://en.wikipedia.org/wiki/Policy-based_routing policy-based routing] scenario; and places all local AMPRNet allocations in the main routing instance (you must provide routing rules for your local AMPR subnets to reach local subnets, if you desire)&lt;br /&gt;
* Since the OpenWrt Kernel is aware that your AMPRNet allocations exist locally (and are populated on the MAIN ROUTING TABLE), you must provide routing rules for AMPRLAN to reach these local subnets, or omit those rules (not permitting your AMPRLAN to route to your local subnets)&lt;br /&gt;
* Lastly, that the user:&lt;br /&gt;
** can navigate the default OpenWrt LuCI web-based graphical user interface locally; and that they are using a device capable of having the packages installed&lt;br /&gt;
** is familiar with the [https://en.wikipedia.org/wiki/Chmod chmod] command, and/or&lt;br /&gt;
** familiar with entering OpenWrt UCI (Unified Configuration Interface) commands by serial console or SSH.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Setup and configuration of OpenWrt ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Install:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* [https://openwrt.org/packages/pkgdata/kmod-ipip kmod-ipip]&lt;br /&gt;
* [https://openwrt.org/packages/pkgdata/ip-full ip-full]&lt;br /&gt;
* [https://openwrt.org/packages/pkgdata/libstdcpp libstdcpp]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Paste:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[ampr-ripd]]&#039;&#039;&#039; to &#039;&#039;&#039;/etc/config/&#039;&#039;&#039; (always run [[RIP| RIP44]] software in console mode FIRST after installation to verify execution and obtain the password, the execution of the file is commented-out below)&lt;br /&gt;
* &#039;&#039;optional&#039;&#039; - dynamic firewall script to /etc/config/load_ipipfilter.sh (see the [[Firewalls#ipset|ipset]] section of the firewall wiki)&lt;br /&gt;
* the following to /etc/rc.local or on web GUI at&#039;&#039;&#039;System &amp;gt; Startup &amp;gt; Local Startup:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ip tunnel add tunl0&lt;br /&gt;
 ip tunnel change tunl0 mode ipip ttl 64 tos inherit pmtudisc&lt;br /&gt;
 ip link set tunl0 mtu 1480 up&lt;br /&gt;
 &#039;&#039;&#039;# This directory is not persistent on OpenWrt, it must be made on boot for dynamic filtering&lt;br /&gt;
 mkdir /var/lib/ampr-ripd&lt;br /&gt;
 # A blank bootstrap file must be created at /etc/config/encap.txt for this to work&lt;br /&gt;
 # Running &#039;&#039;&#039;touch /etc/config/encap.txt&#039;&#039;&#039; once can create it&lt;br /&gt;
 # after which, you may run ampr-ripd to populate it&lt;br /&gt;
 ln -s /etc/config/encap.txt /tmp/lib/ampr-ripd/encap.txt&lt;br /&gt;
 # Dynamic filter, script executed by -x argument&lt;br /&gt;
 # Dynamic filter, -s argument creates encap.txt&lt;br /&gt;
 &#039;&#039;&#039;# ./etc/config/ampr-ripd -p &amp;lt;PASSWORD&amp;gt; -s -t 44 -a &amp;lt;44.xxx.xxx.xxx/xx&amp;gt; -x ./etc/config/load_ipipfilter.sh &amp;amp;&#039;&#039;&#039;&lt;br /&gt;
 ## Allows traceroute to respond using 44net IP of tunl0 or br-amprlan ##&lt;br /&gt;
 echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_errors_use_inbound_ifaddr&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;AMPRNet Policy Routes&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # add IP Route to /etc/config/network&lt;br /&gt;
 &lt;br /&gt;
 config route&lt;br /&gt;
 	option interface &#039;amprwan&#039;&lt;br /&gt;
 	option target &#039;0.0.0.0&#039;&lt;br /&gt;
 	option netmask &#039;0.0.0.0&#039;&lt;br /&gt;
 	option gateway &#039;&#039;&#039;&#039;&amp;lt;AMPRGW&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
 	option onlink &#039;1&#039;&lt;br /&gt;
 	option table &#039;44&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;AMPRNet Policy Rules&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # add IP Rules to /etc/config/network&lt;br /&gt;
 &lt;br /&gt;
 #OPTIONAL AMPR TO LAN RULES (NUMBER 22-2X ACCORDINGLY)&lt;br /&gt;
 config rule&lt;br /&gt;
 	option src &#039;44.xxx.xxx.0/24&#039;&lt;br /&gt;
 	option dest &#039;192.168.xxx.0/24&#039;&lt;br /&gt;
 	option priority &#039;22&#039;&lt;br /&gt;
 	option lookup &#039;main&#039;&lt;br /&gt;
 &lt;br /&gt;
 #ADD A MAIN RULE FOR EVERY LOCAL AMPR SUBNET, RENUMBER 44-4X ACCORDINGLY)&lt;br /&gt;
 config rule&lt;br /&gt;
 	option dest &#039;44.xxx.xxx.0/24&#039;&lt;br /&gt;
 	option priority &#039;44&#039;&lt;br /&gt;
 	option lookup &#039;main&#039;&lt;br /&gt;
 &lt;br /&gt;
 ### This ensures all traffic received on tunl0 uses table 44&lt;br /&gt;
 config rule&lt;br /&gt;
 	option in &#039;amprwan&#039;&lt;br /&gt;
 	option dest &#039;0.0.0.0/0&#039;&lt;br /&gt;
 	option priority &#039;45&#039;&lt;br /&gt;
 	option lookup &#039;44&#039;&lt;br /&gt;
 &lt;br /&gt;
 ###Add this after you create the AMPRLAN bridge, this ensures all traffic from AMPRLAN uses table 44&lt;br /&gt;
 config rule&lt;br /&gt;
 	option in &#039;amprnet&#039;&lt;br /&gt;
 	option dest &#039;0.0.0.0/0&#039;&lt;br /&gt;
 	option priority &#039;46&#039;&lt;br /&gt;
 	option lookup &#039;44&#039;&lt;br /&gt;
 &lt;br /&gt;
 ### You must add an IP rule for all 44net IPs residing on the device&lt;br /&gt;
 config rule&lt;br /&gt;
 	option src &#039;44.xxx.xxx.0/24&lt;br /&gt;
 	option priority &#039;47&#039;&lt;br /&gt;
 	option lookup &#039;44&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;reboot&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Enumerating tunnel/VLAN (AMPRWAN/AMPRLAN) Interfaces and firewall zones ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;REMINDER: In OpenWrt 14.07 or lower - be sure to enable connection tracking if you will not masquerade.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Interfaces&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Create an unmanaged Interface instance for tunl0 (&#039;&#039;&#039;AMPRWAN&#039;&#039;&#039;) - &#039;&#039;&#039;set to not bring up on boot&#039;&#039;&#039;, adding it to a new own firewall zone &#039;&#039;&#039;amprwan&#039;&#039;&#039; using&lt;br /&gt;
**Input: Drop (or Reject)&lt;br /&gt;
**Output: Drop (or Reject)&lt;br /&gt;
**Forward: Drop (or Reject)&lt;br /&gt;
* Create an interface instance for a new VLAN and bridge (AMPRNET). &#039;&#039;&#039;Assign an IP from your allocation to this interface - this will become the the Default Route/Gateway IP used on other 44 clients in your VLAN&#039;&#039;&#039; - add it to its own new firewall zone using&lt;br /&gt;
** Input: Accept (if you wish for you AMPRLAN devices to reach the router)&lt;br /&gt;
** Output: Accept; and&lt;br /&gt;
** Forward: Drop (or Reject, depending if you have other downstream routers in this VLAN)&lt;br /&gt;
* &#039;&#039;&#039;reboot&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;General Firewalling&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* Permit forwarding from AMPRLAN to AMPRWAN and WAN (you must masquerade this traffic when using WAN)&lt;br /&gt;
* Permit forwarding from LAN to AMPRLAN (as desired, NOTE: you must make an IP Rule for the AMPRLAN to use the LAN&#039;s route on the Main Routing Table)&lt;br /&gt;
* &#039;&#039;For IPENCAP in&#039;&#039; - create Traffic Input rule to allow IPv4 IPENCAP (IP protocol type 4) from Any IP on WAN to any IP on Router &#039;&#039;(or configure optional dynamic script above, see [[Firewalls#OpenWrt|Firewalls - OpenWrt]])&#039;&#039;&lt;br /&gt;
** specify WAN IP instead of &#039;&#039;Any&#039;&#039; - if statically assigned by ISP&lt;br /&gt;
* &#039;&#039;For [[RIP| RIP44]] packets in&#039;&#039; - create Traffic Input rule to allow IPv4 udp/520 from 44.0.0.1 in AMPRWAN to 224.0.0.9 at port udp/520 IP on Router&lt;br /&gt;
* Create Traffic Forward rules for any inbound services (as desired)&lt;br /&gt;
* assign the new VLAN to any switch/trunk ports (as desired)&lt;br /&gt;
* make ampr-ripd and load_ipipfilter.sh executable using &#039;&#039;&#039;chmod +x&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Lastly&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* test ampr-ripd in console using the &#039;&#039;&#039;-d&#039;&#039;&#039; argument&lt;br /&gt;
* add password to the &#039;&#039;&#039;Local Startup&#039;&#039;&#039; entry and uncomment ampr-ripd line&lt;br /&gt;
* &#039;&#039;&#039;reboot&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[ampr-ripd]]&lt;br /&gt;
* [[Firewalls#OpenWrt|Firewalls - OpenWrt]]&lt;br /&gt;
* [[RIP44.lua]]&lt;br /&gt;
* https://openwrt.org/docs/guide-user/network/start&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Ampr-ripd&amp;diff=786</id>
		<title>Ampr-ripd</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Ampr-ripd&amp;diff=786"/>
		<updated>2019-01-11T16:30:13Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: cleanup- moved notes from other pages regarding ampr-ripd to here&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;ampr-ripd is a GNU/Linux C daemon writen by Y02LOJ that listens for AMPRNet [[gateway]] announcements and can update routing tables based on the information it receives.&lt;br /&gt;
&lt;br /&gt;
ampr-ripd source code and instructions can be found [http://www.yo2loj.ro/hamprojects/ here].&lt;br /&gt;
&lt;br /&gt;
* [[ampr-ripd]] has been compiled for the AppliedMicro APM82181 and Atheros 71xx router CPUs&lt;br /&gt;
* Considering embedded devices such as [[Setting up a gateway on OpenWRT|OpenWrt]], the routing table is relatively small - so the performance or memory consumption of this daemon isn&#039;t very critical&lt;br /&gt;
* new [[Gateway]] operators should compile the source code if the do not have access to an executable copy of this software&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Ampr-ripd&amp;diff=785</id>
		<title>Ampr-ripd</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Ampr-ripd&amp;diff=785"/>
		<updated>2019-01-11T16:07:30Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;ampr-ripd is a GNU/Linux C daemon writen by Y02LOJ that listens for AMPRNet [[gateway]] announcements and can update routing tables based on the information it receives.&lt;br /&gt;
&lt;br /&gt;
ampr-ripd source code and instructions can be found [http://www.yo2loj.ro/hamprojects/ here].&lt;br /&gt;
&lt;br /&gt;
* [[ampr-ripd]] has been compiled for the AppliedMicro APM82181 and Atheros 71xx router CPUs&lt;br /&gt;
* new [[Gateway]] operators should compile the source code if the do not have access to an executable copy of this software&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Archive/Main_Page&amp;diff=784</id>
		<title>Archive/Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Archive/Main_Page&amp;diff=784"/>
		<updated>2019-01-11T16:04:44Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: /* How to connect to AMPRNet */ added firewall link to main page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the AMPRNet Wiki.&lt;br /&gt;
&lt;br /&gt;
Since its allocation to Amateur Radio in the mid-1980&#039;s, Internet network 44 (44.0.0.0/8), known as the AMPRNet™, has been used by amateur radio operators to conduct scientific research and to experiment with digital communications over radio with a goal of advancing the state of the art of Amateur Radio networking, and to educate amateur radio operators in these techniques. - [http://www.ampr.org/ www.ampr.org]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
== Starting points ==&lt;br /&gt;
* [[Quickstart]] guide for getting onto the [[AMPRNet]]&lt;br /&gt;
* Basic information about the [[AMPRNet]] and the [[ampr.org]] domain&lt;br /&gt;
* [[Services]] available on AMPRNet&lt;br /&gt;
* If you are looking to get an IP allocation within the 44/8 AMPRNet please read the [[Portal]] page.&lt;br /&gt;
* Frequently Asked Questions (FAQ) [[FAQ]]&lt;br /&gt;
&lt;br /&gt;
== How to connect to AMPRNet ==&lt;br /&gt;
&lt;br /&gt;
* Instructions for [[Setting up a gateway on Linux|setting up a Linux gateway]]&lt;br /&gt;
* Instructions for [[Setting up a gateway on OpenBSD|setting up an OpenBSD gateway]]&lt;br /&gt;
* Instructions for [[setting up a gateway on Cisco Routers|setting up a  gateway on Cisco Routers]].&lt;br /&gt;
* Instructions for [[setting up a gateway on MikroTik Routers|setting up a  gateway on MikroTik Routers]].&lt;br /&gt;
* Instructions for [[setting up a gateway on OpenWRT|setting up a gateway on OpenWRT]].&lt;br /&gt;
* Instructions for [[setting up a gateway on Ubiquiti EdgeRouter|setting up a gateway on Ubiquiti EdgeRouter]].&lt;br /&gt;
* Instructions for [[setting up a gateway on a VyOS instance|setting up a gateway on a VyOS instance]].&lt;br /&gt;
* Instructions for [[announcing your allocation directly|directly announcing your allocation via your Internet Service Provider (ISP)]].&lt;br /&gt;
* Instructions for [[AMPRNet VPN|Accessing AMPRNet via VPN]] (experimental).&lt;br /&gt;
* &amp;lt;b&amp;gt;[[Why can&#039;t I just route my AMPRNet allocation directly myself ?]]&amp;lt;/b&amp;gt;&lt;br /&gt;
* If you already operate a [[gateway]] please ensure you have registered on the [[portal]] and &amp;quot;claimed&amp;quot; your [[gateway]].&lt;br /&gt;
* After your gateway is operational, consider &#039;&#039;&#039;[[Firewalls]]&#039;&#039;&#039; and other best practices&lt;br /&gt;
&lt;br /&gt;
== Mailing List ==&lt;br /&gt;
To keep up-to-date on AMPRNet information please consider joining the [[44Net mailing list]].&lt;br /&gt;
&lt;br /&gt;
== Contribute! ==&lt;br /&gt;
If you wish to contribute to the wiki, please send an email to &amp;lt;tt&amp;gt;wiki (at) ampr.org&amp;lt;/tt&amp;gt; introducing yourself. Please specify your full name, amateur radio callsign and your preferred username. A login will then be created for you.&lt;br /&gt;
&lt;br /&gt;
== Terms of Service ==&lt;br /&gt;
Use of 44.0.0.0/8 address space is governed by these [http://www.ampr.org/terms-of-service/ Terms of Service]&lt;br /&gt;
&lt;br /&gt;
== All Pages ==&lt;br /&gt;
[http://wiki.ampr.org/wiki/Special:AllPages Here&#039;s a list of all pages currently on the AMPRNet Wiki]&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=783</id>
		<title>Firewalls</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=783"/>
		<updated>2019-01-11T15:51:50Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: /* OpenWrt */ moved OpenWrt rules here&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the Firewall Wiki.&lt;br /&gt;
&lt;br /&gt;
NOTE: This page is intended to be edited by the community to add use practices, command syntax, etc. regarding firewalling and security on AMPRNet nodes. While each operator is ultimately responsible for the administration of their node, it is highly suggested amongst the [[44Net mailing list]] Community that nodes be firewalled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: On an iptables-based firewall, you must enable connection tracking on the tunl0 interface in order to enable Stateful Packet Inspection (i.e. a stateful firewall). Since the IPENCAP Linux Kernel Module IPIP is in the kernel, &#039;&#039;&#039;you must set the default forwarding policy to DROP or REJECT.&#039;&#039;&#039; If you set your default routing policy to ACCEPT, all packets that have not been explicitly DROPped or REJECTed elsewhere, will route, regardless of firewall policies.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Cisco ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DD-WRT ==&lt;br /&gt;
&lt;br /&gt;
DD-WRT uses an iptables-based firewall (see iptables below). Custom rules can be entered at Administration &amp;gt; Commands &amp;gt; &amp;quot;Save Firewall&amp;quot;&lt;br /&gt;
&lt;br /&gt;
https://www.dd-wrt.com/wiki/index.php/Iptables&lt;br /&gt;
&lt;br /&gt;
https://www.dd-wrt.com/wiki/index.php/Firewall&lt;br /&gt;
&lt;br /&gt;
== D-Link ==&lt;br /&gt;
&lt;br /&gt;
On some D-Link devices, the port forwarding feature allows for the options: TCP, UDP and Other. The &amp;quot;Other&amp;quot; option on these models are capable of Destination NAT of IPENCAP packets.&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4) &#039;&#039;&#039;Note: this rule is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In Port Forwarding&lt;br /&gt;
&lt;br /&gt;
 # Create a new Port Forward&lt;br /&gt;
 # Enter the LAN IP of your AMPR node&lt;br /&gt;
 # Select &amp;quot;Other&amp;quot;&lt;br /&gt;
 # Type the number &#039;&#039;&#039;4&#039;&#039;&#039; into the field&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== iptables ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;General Bogon rules&#039;&#039;&#039; - see: https://en.wikipedia.org/wiki/Bogon_filtering&lt;br /&gt;
&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS IP TRAFFIC THAT&#039;S INVALID ENTERING OR EXITING AMPR&lt;br /&gt;
 # THIS PREVENTS A GENERAL LOOP&lt;br /&gt;
 iptables -I FORWARD -i tunl0 -o tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND IPs NOT FROM YOUR ALLOCATION (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING ! -s 44.xxx.xxx.xxx/xx -i br-amprnet -j DROP&lt;br /&gt;
 # DROPS ROGUE INBOUND ASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 44.xxx.xxx.xxx/xx -i tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND UNASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 # YOU MUST ADD A RULE UNDER THIS LINE TO MAKE EXCEPTIONS (BCP 38)&lt;br /&gt;
 iptables -I FORWARD ! -s 44.xxx.xxx.xxx/xx -o tunl0 -j DROP&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS BOGONS ENTERING AMPRNet&lt;br /&gt;
 # SEE http://www.team-cymru.org/Services/Bogons/bogon-bn-nonagg.txt&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 0.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 10.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 100.64.0.0/10 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 127.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 169.254.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 172.16.0.0/12 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.0.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.2.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.168.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.18.0.0/15 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.51.100.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 203.0.113.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 224.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 240.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 # Block of Test AMPRNet Subnet&lt;br /&gt;
 # iptables -t raw -I PREROUTING -s 44.128.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # THIS PREVENTS NESTED IPENCAP (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING -p 4 -i tunl0 -j DROP&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes (using iptables)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable dynamic filtering of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NOTE:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;This script needs work, see Thu Jan 10 11:09:27 PST 2019 message in the [[44Net mailing list]] archive. Due to overheard running on many devices, the ipset script is suggested instead.&#039;&#039;&lt;br /&gt;
* This rule (or one of the ipset or static rules below) is required for other AMPR nodes to initiate inbound traffic to your node.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;REQUIRED:&#039;&#039;&lt;br /&gt;
[[ampr-ripd]] (using the -x and -d arguments), the diff command from the [http://www.gnu.org/software/diffutils/manual/diffutils.html diffutils package] and the [https://www.gnu.org/software/sed/manual/sed.html sed command].&lt;br /&gt;
&lt;br /&gt;
 # Place this rule a the last firewall command&lt;br /&gt;
 # Uncomment sleep command below if the rule does not appear&lt;br /&gt;
 # as load_ipipfilter.sh is still executing&lt;br /&gt;
 # sleep 10&lt;br /&gt;
 # load ipipfilter list rule&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF WAN&amp;gt;&#039;&#039;&#039; -j ipipfilter&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 # by Rob, PE1CHL&lt;br /&gt;
 # load_ipipfilter.sh&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 AMPRGW=&amp;quot;&#039;&#039;&#039;&amp;lt;AMPRGW&amp;gt;&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
 gwfile=&amp;quot;/tmp/gw&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 # Parse encap.txt for Node IPs and place in /tmp/gw&lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u &amp;gt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
 # Run command to create CHAIN, IF no system output, CHAIN was created&lt;br /&gt;
 iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 if [ $? -eq 0 ]&lt;br /&gt;
 &#039;&#039;&#039;# DO NOT PLACE EMPTY LINES BETWEEN THE TWO COMMANDS ABOVE. ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# THE EQUATION ASKS IF THE LAST SYSTEM COMMAND ENTERED ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# RETURNS &amp;quot;NOTHING.&amp;quot; ADDING A SPACE WILL CHANGE RESULTS OF THE IF COMMAND. ###&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 ##The two lines above replace the line below, which does not work on OpenWRT&lt;br /&gt;
 # if iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 ## &lt;br /&gt;
 &lt;br /&gt;
 # IF no system output, THEN flush the CHAIN and add AMPRGW,&lt;br /&gt;
 # add nodes in encap.txt and a final DROP rule&lt;br /&gt;
 then&lt;br /&gt;
     iptables -F ipipfilter&lt;br /&gt;
     iptables -A ipipfilter -s $AMPRGW -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
     while read ip&lt;br /&gt;
     do&lt;br /&gt;
         iptables -A ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
     done &amp;lt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
     iptables -A ipipfilter -j DROP&lt;br /&gt;
 &lt;br /&gt;
 # ELSE, the CHAIN already exists, determine changes&lt;br /&gt;
 # and INSERT new nodes and DELETE old nodes (excluding AMPRGW)&lt;br /&gt;
 else&lt;br /&gt;
     iptables -L ipipfilter -n | grep ACCEPT | fgrep -v $AMPRGW | \&lt;br /&gt;
         sed -e &#039;s/.*--  //&#039; -e &#039;s/ .*//&#039; | sort | diff - $gwfile | \&lt;br /&gt;
         while read d ip&lt;br /&gt;
         do&lt;br /&gt;
             case &amp;quot;$d&amp;quot; in&lt;br /&gt;
             &amp;quot;&amp;gt;&amp;quot;)&lt;br /&gt;
                 iptables -I ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             &amp;quot;&amp;lt;&amp;quot;)&lt;br /&gt;
                 iptables -D ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             *)&lt;br /&gt;
                 ;;&lt;br /&gt;
             esac&lt;br /&gt;
         done&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 # Delete /tmp/gw when done&lt;br /&gt;
 rm -f $gwfile&lt;br /&gt;
 &lt;br /&gt;
 # The full pathname of this script /usr/local/sbin/load_ipipfilter is passed with the new -x&lt;br /&gt;
 # option to ampr-ripd.   It will load the entire filter the first time, and later it will only update&lt;br /&gt;
 # the filters that have changed.  It is required that the -s option is passed as well, so the&lt;br /&gt;
 # encap.txt file is created by ampr-ripd.&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Static IPENCAP Filtering of AMPR Nodes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note:&#039;&#039;&lt;br /&gt;
* This rule (the dynamic rule above, or the ipset rules) is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF YOUR WAN&amp;gt;&#039;&#039;&#039; -j ACCEPT &lt;br /&gt;
&lt;br /&gt;
If your AMPR node is downstream, you will create an INPUT &#039;&#039;&#039;and&#039;&#039;&#039; DNAT forward rule to the destination LAN IP of your AMPR node.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;To enable receipt of [[RIP]]44&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p udp -s 44.0.0.1 --sport 520 -d 224.0.0.9 --dport 520 -i tunl0 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Masquerade LAN Subnets to AMPRNet&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* In this instance, eth1 is your 192.168.1.0/24 LAN - (thanks to Brian, N1URO)&lt;br /&gt;
&#039;&#039;See: https://n1uro.ampr.org/linuxconf/44nat.html&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # NAT setup&lt;br /&gt;
 iptables -t nat -A POSTROUTING -s 192.168.0/24 -o tunl0 -j MASQUERADE -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -m state --state RELATED,ESTABLISHED -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
&lt;br /&gt;
== ipset ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes (using ipset)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable dynamic filtering of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;REQUIRED:&#039;&#039; [[ampr-ripd]] (using the -x and -d arguments) and the ipset package.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 ipset -N ipipfilter hash:ip 2&amp;gt;/dev/null&lt;br /&gt;
 ipset flush ipipfilter&lt;br /&gt;
 ipset -A ipipfilter &amp;lt;AMPRGW&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u | while read ip&lt;br /&gt;
 do&lt;br /&gt;
     ipset -A ipipfilter $ip&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
== Microtik ==&lt;br /&gt;
&lt;br /&gt;
== OpenWrt ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;See: [[Firewalls#iptables|iptables]] and [[Firewalls#ipset|ipset]] (above), and the Instructions for [[setting up a gateway on OpenWRT|setting up a gateway on OpenWRT]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* [[Firewalls#iptables|iptables]]-based rules are entered at &#039;&#039;&#039;Network &amp;gt; Firewall &amp;gt; Custom Firewall&#039;&#039;&#039; on the LuCI web GUI interface&lt;br /&gt;
* [[Firewalls#ipset|ipset]]-based rules are entered on the command line - into the Unified Configuration Interface (UCI) file &#039;&#039;/etc/config/firewall&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Adding IPENCAP Filtering of AMPR Nodes to OpenWrt (using [[Firewalls#ipset|ipset]])&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # in /etc/config/firewall&lt;br /&gt;
 config rule&lt;br /&gt;
 	option target &#039;ACCEPT&#039;&lt;br /&gt;
 	option src &#039;wan&#039;&lt;br /&gt;
 	option family &#039;ipv4&#039;&lt;br /&gt;
 	option proto &#039;4&#039;&lt;br /&gt;
 	option name &#039;Allow-AMPR_IPENCAP&#039;&lt;br /&gt;
 	option extra &#039;-m set --match-set ipipfilter src&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Adding ICMP Filtering of AMPR Nodes to OpenWrt (using [[Firewalls#ipset|ipset]])&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # in /etc/config/firewall&lt;br /&gt;
 config rule&lt;br /&gt;
 	option target &#039;ACCEPT&#039;&lt;br /&gt;
 	option family &#039;ipv4&#039;&lt;br /&gt;
 	option proto &#039;icmp&#039;&lt;br /&gt;
 	list icmp_type &#039;echo-request&#039;&lt;br /&gt;
 	option src &#039;*&#039; &lt;br /&gt;
 	option extra &#039;-m set --match-set ipipfilter src&#039;&lt;br /&gt;
 	option name &#039;Ping_fromIPENCAPS&#039;&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=782</id>
		<title>Firewalls</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=782"/>
		<updated>2019-01-11T15:35:38Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: /* ipset */  cleanup&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the Firewall Wiki.&lt;br /&gt;
&lt;br /&gt;
NOTE: This page is intended to be edited by the community to add use practices, command syntax, etc. regarding firewalling and security on AMPRNet nodes. While each operator is ultimately responsible for the administration of their node, it is highly suggested amongst the [[44Net mailing list]] Community that nodes be firewalled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: On an iptables-based firewall, you must enable connection tracking on the tunl0 interface in order to enable Stateful Packet Inspection (i.e. a stateful firewall). Since the IPENCAP Linux Kernel Module IPIP is in the kernel, &#039;&#039;&#039;you must set the default forwarding policy to DROP or REJECT.&#039;&#039;&#039; If you set your default routing policy to ACCEPT, all packets that have not been explicitly DROPped or REJECTed elsewhere, will route, regardless of firewall policies.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Cisco ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DD-WRT ==&lt;br /&gt;
&lt;br /&gt;
DD-WRT uses an iptables-based firewall (see iptables below). Custom rules can be entered at Administration &amp;gt; Commands &amp;gt; &amp;quot;Save Firewall&amp;quot;&lt;br /&gt;
&lt;br /&gt;
https://www.dd-wrt.com/wiki/index.php/Iptables&lt;br /&gt;
&lt;br /&gt;
https://www.dd-wrt.com/wiki/index.php/Firewall&lt;br /&gt;
&lt;br /&gt;
== D-Link ==&lt;br /&gt;
&lt;br /&gt;
On some D-Link devices, the port forwarding feature allows for the options: TCP, UDP and Other. The &amp;quot;Other&amp;quot; option on these models are capable of Destination NAT of IPENCAP packets.&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4) &#039;&#039;&#039;Note: this rule is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In Port Forwarding&lt;br /&gt;
&lt;br /&gt;
 # Create a new Port Forward&lt;br /&gt;
 # Enter the LAN IP of your AMPR node&lt;br /&gt;
 # Select &amp;quot;Other&amp;quot;&lt;br /&gt;
 # Type the number &#039;&#039;&#039;4&#039;&#039;&#039; into the field&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== iptables ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;General Bogon rules&#039;&#039;&#039; - see: https://en.wikipedia.org/wiki/Bogon_filtering&lt;br /&gt;
&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS IP TRAFFIC THAT&#039;S INVALID ENTERING OR EXITING AMPR&lt;br /&gt;
 # THIS PREVENTS A GENERAL LOOP&lt;br /&gt;
 iptables -I FORWARD -i tunl0 -o tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND IPs NOT FROM YOUR ALLOCATION (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING ! -s 44.xxx.xxx.xxx/xx -i br-amprnet -j DROP&lt;br /&gt;
 # DROPS ROGUE INBOUND ASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 44.xxx.xxx.xxx/xx -i tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND UNASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 # YOU MUST ADD A RULE UNDER THIS LINE TO MAKE EXCEPTIONS (BCP 38)&lt;br /&gt;
 iptables -I FORWARD ! -s 44.xxx.xxx.xxx/xx -o tunl0 -j DROP&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS BOGONS ENTERING AMPRNet&lt;br /&gt;
 # SEE http://www.team-cymru.org/Services/Bogons/bogon-bn-nonagg.txt&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 0.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 10.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 100.64.0.0/10 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 127.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 169.254.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 172.16.0.0/12 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.0.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.2.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.168.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.18.0.0/15 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.51.100.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 203.0.113.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 224.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 240.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 # Block of Test AMPRNet Subnet&lt;br /&gt;
 # iptables -t raw -I PREROUTING -s 44.128.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # THIS PREVENTS NESTED IPENCAP (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING -p 4 -i tunl0 -j DROP&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes (using iptables)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable dynamic filtering of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NOTE:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;This script needs work, see Thu Jan 10 11:09:27 PST 2019 message in the [[44Net mailing list]] archive. Due to overheard running on many devices, the ipset script is suggested instead.&#039;&#039;&lt;br /&gt;
* This rule (or one of the ipset or static rules below) is required for other AMPR nodes to initiate inbound traffic to your node.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;REQUIRED:&#039;&#039;&lt;br /&gt;
[[ampr-ripd]] (using the -x and -d arguments), the diff command from the [http://www.gnu.org/software/diffutils/manual/diffutils.html diffutils package] and the [https://www.gnu.org/software/sed/manual/sed.html sed command].&lt;br /&gt;
&lt;br /&gt;
 # Place this rule a the last firewall command&lt;br /&gt;
 # Uncomment sleep command below if the rule does not appear&lt;br /&gt;
 # as load_ipipfilter.sh is still executing&lt;br /&gt;
 # sleep 10&lt;br /&gt;
 # load ipipfilter list rule&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF WAN&amp;gt;&#039;&#039;&#039; -j ipipfilter&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 # by Rob, PE1CHL&lt;br /&gt;
 # load_ipipfilter.sh&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 AMPRGW=&amp;quot;&#039;&#039;&#039;&amp;lt;AMPRGW&amp;gt;&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
 gwfile=&amp;quot;/tmp/gw&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 # Parse encap.txt for Node IPs and place in /tmp/gw&lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u &amp;gt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
 # Run command to create CHAIN, IF no system output, CHAIN was created&lt;br /&gt;
 iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 if [ $? -eq 0 ]&lt;br /&gt;
 &#039;&#039;&#039;# DO NOT PLACE EMPTY LINES BETWEEN THE TWO COMMANDS ABOVE. ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# THE EQUATION ASKS IF THE LAST SYSTEM COMMAND ENTERED ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# RETURNS &amp;quot;NOTHING.&amp;quot; ADDING A SPACE WILL CHANGE RESULTS OF THE IF COMMAND. ###&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 ##The two lines above replace the line below, which does not work on OpenWRT&lt;br /&gt;
 # if iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 ## &lt;br /&gt;
 &lt;br /&gt;
 # IF no system output, THEN flush the CHAIN and add AMPRGW,&lt;br /&gt;
 # add nodes in encap.txt and a final DROP rule&lt;br /&gt;
 then&lt;br /&gt;
     iptables -F ipipfilter&lt;br /&gt;
     iptables -A ipipfilter -s $AMPRGW -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
     while read ip&lt;br /&gt;
     do&lt;br /&gt;
         iptables -A ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
     done &amp;lt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
     iptables -A ipipfilter -j DROP&lt;br /&gt;
 &lt;br /&gt;
 # ELSE, the CHAIN already exists, determine changes&lt;br /&gt;
 # and INSERT new nodes and DELETE old nodes (excluding AMPRGW)&lt;br /&gt;
 else&lt;br /&gt;
     iptables -L ipipfilter -n | grep ACCEPT | fgrep -v $AMPRGW | \&lt;br /&gt;
         sed -e &#039;s/.*--  //&#039; -e &#039;s/ .*//&#039; | sort | diff - $gwfile | \&lt;br /&gt;
         while read d ip&lt;br /&gt;
         do&lt;br /&gt;
             case &amp;quot;$d&amp;quot; in&lt;br /&gt;
             &amp;quot;&amp;gt;&amp;quot;)&lt;br /&gt;
                 iptables -I ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             &amp;quot;&amp;lt;&amp;quot;)&lt;br /&gt;
                 iptables -D ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             *)&lt;br /&gt;
                 ;;&lt;br /&gt;
             esac&lt;br /&gt;
         done&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 # Delete /tmp/gw when done&lt;br /&gt;
 rm -f $gwfile&lt;br /&gt;
 &lt;br /&gt;
 # The full pathname of this script /usr/local/sbin/load_ipipfilter is passed with the new -x&lt;br /&gt;
 # option to ampr-ripd.   It will load the entire filter the first time, and later it will only update&lt;br /&gt;
 # the filters that have changed.  It is required that the -s option is passed as well, so the&lt;br /&gt;
 # encap.txt file is created by ampr-ripd.&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Static IPENCAP Filtering of AMPR Nodes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note:&#039;&#039;&lt;br /&gt;
* This rule (the dynamic rule above, or the ipset rules) is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF YOUR WAN&amp;gt;&#039;&#039;&#039; -j ACCEPT &lt;br /&gt;
&lt;br /&gt;
If your AMPR node is downstream, you will create an INPUT &#039;&#039;&#039;and&#039;&#039;&#039; DNAT forward rule to the destination LAN IP of your AMPR node.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;To enable receipt of [[RIP]]44&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p udp -s 44.0.0.1 --sport 520 -d 224.0.0.9 --dport 520 -i tunl0 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Masquerade LAN Subnets to AMPRNet&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* In this instance, eth1 is your 192.168.1.0/24 LAN - (thanks to Brian, N1URO)&lt;br /&gt;
&#039;&#039;See: https://n1uro.ampr.org/linuxconf/44nat.html&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # NAT setup&lt;br /&gt;
 iptables -t nat -A POSTROUTING -s 192.168.0/24 -o tunl0 -j MASQUERADE -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -m state --state RELATED,ESTABLISHED -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
&lt;br /&gt;
== ipset ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes (using ipset)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable dynamic filtering of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;REQUIRED:&#039;&#039; [[ampr-ripd]] (using the -x and -d arguments) and the ipset package.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 ipset -N ipipfilter hash:ip 2&amp;gt;/dev/null&lt;br /&gt;
 ipset flush ipipfilter&lt;br /&gt;
 ipset -A ipipfilter &amp;lt;AMPRGW&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u | while read ip&lt;br /&gt;
 do&lt;br /&gt;
     ipset -A ipipfilter $ip&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
== Microtik ==&lt;br /&gt;
&lt;br /&gt;
== OpenWRT ==&lt;br /&gt;
&lt;br /&gt;
See: iptables and ipset (above), and the Instructions for [[setting up a gateway on OpenWRT|setting up a gateway on OpenWRT]].&lt;br /&gt;
&lt;br /&gt;
iptables-based rules can be entered in Network &amp;gt; Firewall &amp;gt; Custom Firewall on the LuCI web interface; or via the command prompt via UCI.&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=781</id>
		<title>Firewalls</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=781"/>
		<updated>2019-01-11T15:32:01Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: /* iptables */ cleanup&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the Firewall Wiki.&lt;br /&gt;
&lt;br /&gt;
NOTE: This page is intended to be edited by the community to add use practices, command syntax, etc. regarding firewalling and security on AMPRNet nodes. While each operator is ultimately responsible for the administration of their node, it is highly suggested amongst the [[44Net mailing list]] Community that nodes be firewalled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: On an iptables-based firewall, you must enable connection tracking on the tunl0 interface in order to enable Stateful Packet Inspection (i.e. a stateful firewall). Since the IPENCAP Linux Kernel Module IPIP is in the kernel, &#039;&#039;&#039;you must set the default forwarding policy to DROP or REJECT.&#039;&#039;&#039; If you set your default routing policy to ACCEPT, all packets that have not been explicitly DROPped or REJECTed elsewhere, will route, regardless of firewall policies.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Cisco ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DD-WRT ==&lt;br /&gt;
&lt;br /&gt;
DD-WRT uses an iptables-based firewall (see iptables below). Custom rules can be entered at Administration &amp;gt; Commands &amp;gt; &amp;quot;Save Firewall&amp;quot;&lt;br /&gt;
&lt;br /&gt;
https://www.dd-wrt.com/wiki/index.php/Iptables&lt;br /&gt;
&lt;br /&gt;
https://www.dd-wrt.com/wiki/index.php/Firewall&lt;br /&gt;
&lt;br /&gt;
== D-Link ==&lt;br /&gt;
&lt;br /&gt;
On some D-Link devices, the port forwarding feature allows for the options: TCP, UDP and Other. The &amp;quot;Other&amp;quot; option on these models are capable of Destination NAT of IPENCAP packets.&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4) &#039;&#039;&#039;Note: this rule is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In Port Forwarding&lt;br /&gt;
&lt;br /&gt;
 # Create a new Port Forward&lt;br /&gt;
 # Enter the LAN IP of your AMPR node&lt;br /&gt;
 # Select &amp;quot;Other&amp;quot;&lt;br /&gt;
 # Type the number &#039;&#039;&#039;4&#039;&#039;&#039; into the field&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== iptables ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;General Bogon rules&#039;&#039;&#039; - see: https://en.wikipedia.org/wiki/Bogon_filtering&lt;br /&gt;
&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS IP TRAFFIC THAT&#039;S INVALID ENTERING OR EXITING AMPR&lt;br /&gt;
 # THIS PREVENTS A GENERAL LOOP&lt;br /&gt;
 iptables -I FORWARD -i tunl0 -o tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND IPs NOT FROM YOUR ALLOCATION (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING ! -s 44.xxx.xxx.xxx/xx -i br-amprnet -j DROP&lt;br /&gt;
 # DROPS ROGUE INBOUND ASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 44.xxx.xxx.xxx/xx -i tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND UNASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 # YOU MUST ADD A RULE UNDER THIS LINE TO MAKE EXCEPTIONS (BCP 38)&lt;br /&gt;
 iptables -I FORWARD ! -s 44.xxx.xxx.xxx/xx -o tunl0 -j DROP&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS BOGONS ENTERING AMPRNet&lt;br /&gt;
 # SEE http://www.team-cymru.org/Services/Bogons/bogon-bn-nonagg.txt&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 0.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 10.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 100.64.0.0/10 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 127.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 169.254.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 172.16.0.0/12 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.0.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.2.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.168.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.18.0.0/15 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.51.100.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 203.0.113.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 224.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 240.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 # Block of Test AMPRNet Subnet&lt;br /&gt;
 # iptables -t raw -I PREROUTING -s 44.128.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # THIS PREVENTS NESTED IPENCAP (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING -p 4 -i tunl0 -j DROP&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes (using iptables)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable dynamic filtering of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;NOTE:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;This script needs work, see Thu Jan 10 11:09:27 PST 2019 message in the [[44Net mailing list]] archive. Due to overheard running on many devices, the ipset script is suggested instead.&#039;&#039;&lt;br /&gt;
* This rule (or one of the ipset or static rules below) is required for other AMPR nodes to initiate inbound traffic to your node.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;REQUIRED:&#039;&#039;&lt;br /&gt;
[[ampr-ripd]] (using the -x and -d arguments), the diff command from the [http://www.gnu.org/software/diffutils/manual/diffutils.html diffutils package] and the [https://www.gnu.org/software/sed/manual/sed.html sed command].&lt;br /&gt;
&lt;br /&gt;
 # Place this rule a the last firewall command&lt;br /&gt;
 # Uncomment sleep command below if the rule does not appear&lt;br /&gt;
 # as load_ipipfilter.sh is still executing&lt;br /&gt;
 # sleep 10&lt;br /&gt;
 # load ipipfilter list rule&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF WAN&amp;gt;&#039;&#039;&#039; -j ipipfilter&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 # by Rob, PE1CHL&lt;br /&gt;
 # load_ipipfilter.sh&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 AMPRGW=&amp;quot;&#039;&#039;&#039;&amp;lt;AMPRGW&amp;gt;&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
 gwfile=&amp;quot;/tmp/gw&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 # Parse encap.txt for Node IPs and place in /tmp/gw&lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u &amp;gt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
 # Run command to create CHAIN, IF no system output, CHAIN was created&lt;br /&gt;
 iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 if [ $? -eq 0 ]&lt;br /&gt;
 &#039;&#039;&#039;# DO NOT PLACE EMPTY LINES BETWEEN THE TWO COMMANDS ABOVE. ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# THE EQUATION ASKS IF THE LAST SYSTEM COMMAND ENTERED ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# RETURNS &amp;quot;NOTHING.&amp;quot; ADDING A SPACE WILL CHANGE RESULTS OF THE IF COMMAND. ###&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 ##The two lines above replace the line below, which does not work on OpenWRT&lt;br /&gt;
 # if iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 ## &lt;br /&gt;
 &lt;br /&gt;
 # IF no system output, THEN flush the CHAIN and add AMPRGW,&lt;br /&gt;
 # add nodes in encap.txt and a final DROP rule&lt;br /&gt;
 then&lt;br /&gt;
     iptables -F ipipfilter&lt;br /&gt;
     iptables -A ipipfilter -s $AMPRGW -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
     while read ip&lt;br /&gt;
     do&lt;br /&gt;
         iptables -A ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
     done &amp;lt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
     iptables -A ipipfilter -j DROP&lt;br /&gt;
 &lt;br /&gt;
 # ELSE, the CHAIN already exists, determine changes&lt;br /&gt;
 # and INSERT new nodes and DELETE old nodes (excluding AMPRGW)&lt;br /&gt;
 else&lt;br /&gt;
     iptables -L ipipfilter -n | grep ACCEPT | fgrep -v $AMPRGW | \&lt;br /&gt;
         sed -e &#039;s/.*--  //&#039; -e &#039;s/ .*//&#039; | sort | diff - $gwfile | \&lt;br /&gt;
         while read d ip&lt;br /&gt;
         do&lt;br /&gt;
             case &amp;quot;$d&amp;quot; in&lt;br /&gt;
             &amp;quot;&amp;gt;&amp;quot;)&lt;br /&gt;
                 iptables -I ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             &amp;quot;&amp;lt;&amp;quot;)&lt;br /&gt;
                 iptables -D ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             *)&lt;br /&gt;
                 ;;&lt;br /&gt;
             esac&lt;br /&gt;
         done&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 # Delete /tmp/gw when done&lt;br /&gt;
 rm -f $gwfile&lt;br /&gt;
 &lt;br /&gt;
 # The full pathname of this script /usr/local/sbin/load_ipipfilter is passed with the new -x&lt;br /&gt;
 # option to ampr-ripd.   It will load the entire filter the first time, and later it will only update&lt;br /&gt;
 # the filters that have changed.  It is required that the -s option is passed as well, so the&lt;br /&gt;
 # encap.txt file is created by ampr-ripd.&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Static IPENCAP Filtering of AMPR Nodes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note:&#039;&#039;&lt;br /&gt;
* This rule (the dynamic rule above, or the ipset rules) is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF YOUR WAN&amp;gt;&#039;&#039;&#039; -j ACCEPT &lt;br /&gt;
&lt;br /&gt;
If your AMPR node is downstream, you will create an INPUT &#039;&#039;&#039;and&#039;&#039;&#039; DNAT forward rule to the destination LAN IP of your AMPR node.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;To enable receipt of [[RIP]]44&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p udp -s 44.0.0.1 --sport 520 -d 224.0.0.9 --dport 520 -i tunl0 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Masquerade LAN Subnets to AMPRNet&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* In this instance, eth1 is your 192.168.1.0/24 LAN - (thanks to Brian, N1URO)&lt;br /&gt;
&#039;&#039;See: https://n1uro.ampr.org/linuxconf/44nat.html&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # NAT setup&lt;br /&gt;
 iptables -t nat -A POSTROUTING -s 192.168.0/24 -o tunl0 -j MASQUERADE -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -m state --state RELATED,ESTABLISHED -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
&lt;br /&gt;
== ipset ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes (using ipset)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REQUIRED: [[ampr-ripd]] (using the -x and -d arguments) and the ipset package.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 ipset -N ipipfilter hash:ip 2&amp;gt;/dev/null&lt;br /&gt;
 ipset flush ipipfilter&lt;br /&gt;
 ipset -A ipipfilter &amp;lt;AMPRGW&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u | while read ip&lt;br /&gt;
 do&lt;br /&gt;
     ipset -A ipipfilter $ip&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Adding IPENCAP Filtering of AMPR Nodes to OpenWrt (using ipset)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 config rule&lt;br /&gt;
 	option target &#039;ACCEPT&#039;&lt;br /&gt;
 	option src &#039;wan&#039;&lt;br /&gt;
 	option family &#039;ipv4&#039;&lt;br /&gt;
 	option proto &#039;4&#039;&lt;br /&gt;
 	option name &#039;Allow-AMPR_IPENCAP&#039;&lt;br /&gt;
 	option extra &#039;-m set --match-set ipipfilter src&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Adding ICMP Filtering of AMPR Nodes to OpenWrt (using ipset)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 config rule&lt;br /&gt;
 	option target &#039;ACCEPT&#039;&lt;br /&gt;
 	option family &#039;ipv4&#039;&lt;br /&gt;
 	option proto &#039;icmp&#039;&lt;br /&gt;
 	list icmp_type &#039;echo-request&#039;&lt;br /&gt;
 	option src &#039;*&#039; &lt;br /&gt;
 	option extra &#039;-m set --match-set ipipfilter src&#039;&lt;br /&gt;
 	option name &#039;Ping_fromIPENCAPS&#039;&lt;br /&gt;
&lt;br /&gt;
== Microtik ==&lt;br /&gt;
&lt;br /&gt;
== OpenWRT ==&lt;br /&gt;
&lt;br /&gt;
See: iptables and ipset (above), and the Instructions for [[setting up a gateway on OpenWRT|setting up a gateway on OpenWRT]].&lt;br /&gt;
&lt;br /&gt;
iptables-based rules can be entered in Network &amp;gt; Firewall &amp;gt; Custom Firewall on the LuCI web interface; or via the command prompt via UCI.&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=780</id>
		<title>Firewalls</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=780"/>
		<updated>2019-01-11T15:14:33Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: /* OpenWRT */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the Firewall Wiki.&lt;br /&gt;
&lt;br /&gt;
NOTE: This page is intended to be edited by the community to add use practices, command syntax, etc. regarding firewalling and security on AMPRNet nodes. While each operator is ultimately responsible for the administration of their node, it is highly suggested amongst the [[44Net mailing list]] Community that nodes be firewalled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: On an iptables-based firewall, you must enable connection tracking on the tunl0 interface in order to enable Stateful Packet Inspection (i.e. a stateful firewall). Since the IPENCAP Linux Kernel Module IPIP is in the kernel, &#039;&#039;&#039;you must set the default forwarding policy to DROP or REJECT.&#039;&#039;&#039; If you set your default routing policy to ACCEPT, all packets that have not been explicitly DROPped or REJECTed elsewhere, will route, regardless of firewall policies.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Cisco ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DD-WRT ==&lt;br /&gt;
&lt;br /&gt;
DD-WRT uses an iptables-based firewall (see iptables below). Custom rules can be entered at Administration &amp;gt; Commands &amp;gt; &amp;quot;Save Firewall&amp;quot;&lt;br /&gt;
&lt;br /&gt;
https://www.dd-wrt.com/wiki/index.php/Iptables&lt;br /&gt;
&lt;br /&gt;
https://www.dd-wrt.com/wiki/index.php/Firewall&lt;br /&gt;
&lt;br /&gt;
== D-Link ==&lt;br /&gt;
&lt;br /&gt;
On some D-Link devices, the port forwarding feature allows for the options: TCP, UDP and Other. The &amp;quot;Other&amp;quot; option on these models are capable of Destination NAT of IPENCAP packets.&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4) &#039;&#039;&#039;Note: this rule is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In Port Forwarding&lt;br /&gt;
&lt;br /&gt;
 # Create a new Port Forward&lt;br /&gt;
 # Enter the LAN IP of your AMPR node&lt;br /&gt;
 # Select &amp;quot;Other&amp;quot;&lt;br /&gt;
 # Type the number &#039;&#039;&#039;4&#039;&#039;&#039; into the field&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== iptables ==&lt;br /&gt;
&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS IP TRAFFIC THAT&#039;S INVALID ENTERING OR EXITING AMPR&lt;br /&gt;
 # THIS PREVENTS A GENERAL LOOP&lt;br /&gt;
 iptables -I FORWARD -i tunl0 -o tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND IPs NOT FROM YOUR ALLOCATION (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING ! -s 44.xxx.xxx.xxx/xx -i br-amprnet -j DROP&lt;br /&gt;
 # DROPS ROGUE INBOUND ASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 44.xxx.xxx.xxx/xx -i tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND UNASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 # YOU MUST ADD A RULE UNDER THIS LINE TO MAKE EXCEPTIONS (BCP 38)&lt;br /&gt;
 iptables -I FORWARD ! -s 44.xxx.xxx.xxx/xx -o tunl0 -j DROP&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS BOGONS ENTERING AMPRNet&lt;br /&gt;
 # SEE http://www.team-cymru.org/Services/Bogons/bogon-bn-nonagg.txt&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 0.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 10.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 100.64.0.0/10 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 127.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 169.254.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 172.16.0.0/12 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.0.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.2.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.168.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.18.0.0/15 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.51.100.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 203.0.113.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 224.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 240.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # THIS PREVENTS NESTED IPENCAP (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING -p 4 -i tunl0 -j DROP&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes (using iptables) NOTE: this script needs work, see Thu Jan 10 11:09:27 PST 2019 message in the [[44Net mailing list]] archive. Due to overheard running on many devices, the ipset script is suggested instead.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable dynamic filtering of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: this rule (or the static rule below) is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REQUIRED: [[ampr-ripd]] (using the -x and -d arguments), the diff command from the [http://www.gnu.org/software/diffutils/manual/diffutils.html diffutils package] and the [https://www.gnu.org/software/sed/manual/sed.html sed command].&lt;br /&gt;
&lt;br /&gt;
 # Place this rule a the last firewall command&lt;br /&gt;
 # Uncomment sleep command below if the rule does not appear&lt;br /&gt;
 # as load_ipipfilter.sh is still executing&lt;br /&gt;
 # sleep 10&lt;br /&gt;
 # load ipipfilter list rule&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF WAN&amp;gt;&#039;&#039;&#039; -j ipipfilter&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 # by Rob, PE1CHL&lt;br /&gt;
 # load_ipipfilter.sh&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 AMPRGW=&amp;quot;&#039;&#039;&#039;&amp;lt;AMPRGW&amp;gt;&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
 gwfile=&amp;quot;/tmp/gw&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 # Parse encap.txt for Node IPs and place in /tmp/gw&lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u &amp;gt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
 # Run command to create CHAIN, IF no system output, CHAIN was created&lt;br /&gt;
 iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 if [ $? -eq 0 ]&lt;br /&gt;
 &#039;&#039;&#039;# DO NOT PLACE EMPTY LINES BETWEEN THE TWO COMMANDS ABOVE. ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# THE EQUATION ASKS IF THE LAST SYSTEM COMMAND ENTERED ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# RETURNS &amp;quot;NOTHING.&amp;quot; ADDING A SPACE WILL CHANGE RESULTS OF THE IF COMMAND. ###&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 ##The two lines above replace the line below, which does not work on OpenWRT&lt;br /&gt;
 # if iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 ## &lt;br /&gt;
 &lt;br /&gt;
 # IF no system output, THEN flush the CHAIN and add AMPRGW,&lt;br /&gt;
 # add nodes in encap.txt and a final DROP rule&lt;br /&gt;
 then&lt;br /&gt;
     iptables -F ipipfilter&lt;br /&gt;
     iptables -A ipipfilter -s $AMPRGW -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
     while read ip&lt;br /&gt;
     do&lt;br /&gt;
         iptables -A ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
     done &amp;lt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
     iptables -A ipipfilter -j DROP&lt;br /&gt;
 &lt;br /&gt;
 # ELSE, the CHAIN already exists, determine changes&lt;br /&gt;
 # and INSERT new nodes and DELETE old nodes (excluding AMPRGW)&lt;br /&gt;
 else&lt;br /&gt;
     iptables -L ipipfilter -n | grep ACCEPT | fgrep -v $AMPRGW | \&lt;br /&gt;
         sed -e &#039;s/.*--  //&#039; -e &#039;s/ .*//&#039; | sort | diff - $gwfile | \&lt;br /&gt;
         while read d ip&lt;br /&gt;
         do&lt;br /&gt;
             case &amp;quot;$d&amp;quot; in&lt;br /&gt;
             &amp;quot;&amp;gt;&amp;quot;)&lt;br /&gt;
                 iptables -I ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             &amp;quot;&amp;lt;&amp;quot;)&lt;br /&gt;
                 iptables -D ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             *)&lt;br /&gt;
                 ;;&lt;br /&gt;
             esac&lt;br /&gt;
         done&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 # Delete /tmp/gw when done&lt;br /&gt;
 rm -f $gwfile&lt;br /&gt;
 &lt;br /&gt;
 # The full pathname of this script /usr/local/sbin/load_ipipfilter is passed with the new -x&lt;br /&gt;
 # option to ampr-ripd.   It will load the entire filter the first time, and later it will only update&lt;br /&gt;
 # the filters that have changed.  It is required that the -s option is passed as well, so the&lt;br /&gt;
 # encap.txt file is created by ampr-ripd.&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Static IPENCAP Filtering of AMPR Nodes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: this rule (or the dynamic rule above) is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF YOUR WAN&amp;gt;&#039;&#039;&#039; -j ACCEPT &lt;br /&gt;
&lt;br /&gt;
If your AMPR node is downstream, you will create an INPUT &#039;&#039;&#039;and&#039;&#039;&#039; DNAT forward rule to the destination LAN IP of your AMPR node.&lt;br /&gt;
&lt;br /&gt;
To enable receipt of [[RIP]]44&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p udp -s 44.0.0.1 --sport 520 -d 224.0.0.9 --dport 520 -i tunl0 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Masquerade LAN Subnets to AMPRNet&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this instance, eth1 is your 192.168.1.0/24 LAN&lt;br /&gt;
(thanks to Brian, N1URO)&lt;br /&gt;
&lt;br /&gt;
see: https://n1uro.ampr.org/linuxconf/44nat.html&lt;br /&gt;
&lt;br /&gt;
 # NAT setup&lt;br /&gt;
 iptables -t nat -A POSTROUTING -s 192.168.0/24 -o tunl0 -j MASQUERADE -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -m state --state RELATED,ESTABLISHED -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
&lt;br /&gt;
== ipset ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes (using ipset)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REQUIRED: [[ampr-ripd]] (using the -x and -d arguments) and the ipset package.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 ipset -N ipipfilter hash:ip 2&amp;gt;/dev/null&lt;br /&gt;
 ipset flush ipipfilter&lt;br /&gt;
 ipset -A ipipfilter &amp;lt;AMPRGW&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u | while read ip&lt;br /&gt;
 do&lt;br /&gt;
     ipset -A ipipfilter $ip&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Adding IPENCAP Filtering of AMPR Nodes to OpenWrt (using ipset)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 config rule&lt;br /&gt;
 	option target &#039;ACCEPT&#039;&lt;br /&gt;
 	option src &#039;wan&#039;&lt;br /&gt;
 	option family &#039;ipv4&#039;&lt;br /&gt;
 	option proto &#039;4&#039;&lt;br /&gt;
 	option name &#039;Allow-AMPR_IPENCAP&#039;&lt;br /&gt;
 	option extra &#039;-m set --match-set ipipfilter src&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Adding ICMP Filtering of AMPR Nodes to OpenWrt (using ipset)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 config rule&lt;br /&gt;
 	option target &#039;ACCEPT&#039;&lt;br /&gt;
 	option family &#039;ipv4&#039;&lt;br /&gt;
 	option proto &#039;icmp&#039;&lt;br /&gt;
 	list icmp_type &#039;echo-request&#039;&lt;br /&gt;
 	option src &#039;*&#039; &lt;br /&gt;
 	option extra &#039;-m set --match-set ipipfilter src&#039;&lt;br /&gt;
 	option name &#039;Ping_fromIPENCAPS&#039;&lt;br /&gt;
&lt;br /&gt;
== Microtik ==&lt;br /&gt;
&lt;br /&gt;
== OpenWRT ==&lt;br /&gt;
&lt;br /&gt;
See: iptables and ipset (above), and the Instructions for [[setting up a gateway on OpenWRT|setting up a gateway on OpenWRT]].&lt;br /&gt;
&lt;br /&gt;
iptables-based rules can be entered in Network &amp;gt; Firewall &amp;gt; Custom Firewall on the LuCI web interface; or via the command prompt via UCI.&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=779</id>
		<title>Firewalls</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=779"/>
		<updated>2019-01-11T13:39:03Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: /* ipset */ directly use AMPGW IP in script&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the Firewall Wiki.&lt;br /&gt;
&lt;br /&gt;
NOTE: This page is intended to be edited by the community to add use practices, command syntax, etc. regarding firewalling and security on AMPRNet nodes. While each operator is ultimately responsible for the administration of their node, it is highly suggested amongst the [[44Net mailing list]] Community that nodes be firewalled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: On an iptables-based firewall, you must enable connection tracking on the tunl0 interface in order to enable Stateful Packet Inspection (i.e. a stateful firewall). Since the IPENCAP Linux Kernel Module IPIP is in the kernel, &#039;&#039;&#039;you must set the default forwarding policy to DROP or REJECT.&#039;&#039;&#039; If you set your default routing policy to ACCEPT, all packets that have not been explicitly DROPped or REJECTed elsewhere, will route, regardless of firewall policies.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Cisco ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DD-WRT ==&lt;br /&gt;
&lt;br /&gt;
DD-WRT uses an iptables-based firewall (see iptables below). Custom rules can be entered at Administration &amp;gt; Commands &amp;gt; &amp;quot;Save Firewall&amp;quot;&lt;br /&gt;
&lt;br /&gt;
https://www.dd-wrt.com/wiki/index.php/Iptables&lt;br /&gt;
&lt;br /&gt;
https://www.dd-wrt.com/wiki/index.php/Firewall&lt;br /&gt;
&lt;br /&gt;
== D-Link ==&lt;br /&gt;
&lt;br /&gt;
On some D-Link devices, the port forwarding feature allows for the options: TCP, UDP and Other. The &amp;quot;Other&amp;quot; option on these models are capable of Destination NAT of IPENCAP packets.&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4) &#039;&#039;&#039;Note: this rule is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In Port Forwarding&lt;br /&gt;
&lt;br /&gt;
 # Create a new Port Forward&lt;br /&gt;
 # Enter the LAN IP of your AMPR node&lt;br /&gt;
 # Select &amp;quot;Other&amp;quot;&lt;br /&gt;
 # Type the number &#039;&#039;&#039;4&#039;&#039;&#039; into the field&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== iptables ==&lt;br /&gt;
&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS IP TRAFFIC THAT&#039;S INVALID ENTERING OR EXITING AMPR&lt;br /&gt;
 # THIS PREVENTS A GENERAL LOOP&lt;br /&gt;
 iptables -I FORWARD -i tunl0 -o tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND IPs NOT FROM YOUR ALLOCATION (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING ! -s 44.xxx.xxx.xxx/xx -i br-amprnet -j DROP&lt;br /&gt;
 # DROPS ROGUE INBOUND ASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 44.xxx.xxx.xxx/xx -i tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND UNASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 # YOU MUST ADD A RULE UNDER THIS LINE TO MAKE EXCEPTIONS (BCP 38)&lt;br /&gt;
 iptables -I FORWARD ! -s 44.xxx.xxx.xxx/xx -o tunl0 -j DROP&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS BOGONS ENTERING AMPRNet&lt;br /&gt;
 # SEE http://www.team-cymru.org/Services/Bogons/bogon-bn-nonagg.txt&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 0.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 10.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 100.64.0.0/10 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 127.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 169.254.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 172.16.0.0/12 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.0.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.2.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.168.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.18.0.0/15 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.51.100.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 203.0.113.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 224.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 240.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # THIS PREVENTS NESTED IPENCAP (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING -p 4 -i tunl0 -j DROP&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes (using iptables) NOTE: this script needs work, see Thu Jan 10 11:09:27 PST 2019 message in the [[44Net mailing list]] archive. Due to overheard running on many devices, the ipset script is suggested instead.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable dynamic filtering of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: this rule (or the static rule below) is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REQUIRED: [[ampr-ripd]] (using the -x and -d arguments), the diff command from the [http://www.gnu.org/software/diffutils/manual/diffutils.html diffutils package] and the [https://www.gnu.org/software/sed/manual/sed.html sed command].&lt;br /&gt;
&lt;br /&gt;
 # Place this rule a the last firewall command&lt;br /&gt;
 # Uncomment sleep command below if the rule does not appear&lt;br /&gt;
 # as load_ipipfilter.sh is still executing&lt;br /&gt;
 # sleep 10&lt;br /&gt;
 # load ipipfilter list rule&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF WAN&amp;gt;&#039;&#039;&#039; -j ipipfilter&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 # by Rob, PE1CHL&lt;br /&gt;
 # load_ipipfilter.sh&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 AMPRGW=&amp;quot;&#039;&#039;&#039;&amp;lt;AMPRGW&amp;gt;&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
 gwfile=&amp;quot;/tmp/gw&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 # Parse encap.txt for Node IPs and place in /tmp/gw&lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u &amp;gt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
 # Run command to create CHAIN, IF no system output, CHAIN was created&lt;br /&gt;
 iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 if [ $? -eq 0 ]&lt;br /&gt;
 &#039;&#039;&#039;# DO NOT PLACE EMPTY LINES BETWEEN THE TWO COMMANDS ABOVE. ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# THE EQUATION ASKS IF THE LAST SYSTEM COMMAND ENTERED ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# RETURNS &amp;quot;NOTHING.&amp;quot; ADDING A SPACE WILL CHANGE RESULTS OF THE IF COMMAND. ###&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 ##The two lines above replace the line below, which does not work on OpenWRT&lt;br /&gt;
 # if iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 ## &lt;br /&gt;
 &lt;br /&gt;
 # IF no system output, THEN flush the CHAIN and add AMPRGW,&lt;br /&gt;
 # add nodes in encap.txt and a final DROP rule&lt;br /&gt;
 then&lt;br /&gt;
     iptables -F ipipfilter&lt;br /&gt;
     iptables -A ipipfilter -s $AMPRGW -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
     while read ip&lt;br /&gt;
     do&lt;br /&gt;
         iptables -A ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
     done &amp;lt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
     iptables -A ipipfilter -j DROP&lt;br /&gt;
 &lt;br /&gt;
 # ELSE, the CHAIN already exists, determine changes&lt;br /&gt;
 # and INSERT new nodes and DELETE old nodes (excluding AMPRGW)&lt;br /&gt;
 else&lt;br /&gt;
     iptables -L ipipfilter -n | grep ACCEPT | fgrep -v $AMPRGW | \&lt;br /&gt;
         sed -e &#039;s/.*--  //&#039; -e &#039;s/ .*//&#039; | sort | diff - $gwfile | \&lt;br /&gt;
         while read d ip&lt;br /&gt;
         do&lt;br /&gt;
             case &amp;quot;$d&amp;quot; in&lt;br /&gt;
             &amp;quot;&amp;gt;&amp;quot;)&lt;br /&gt;
                 iptables -I ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             &amp;quot;&amp;lt;&amp;quot;)&lt;br /&gt;
                 iptables -D ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             *)&lt;br /&gt;
                 ;;&lt;br /&gt;
             esac&lt;br /&gt;
         done&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 # Delete /tmp/gw when done&lt;br /&gt;
 rm -f $gwfile&lt;br /&gt;
 &lt;br /&gt;
 # The full pathname of this script /usr/local/sbin/load_ipipfilter is passed with the new -x&lt;br /&gt;
 # option to ampr-ripd.   It will load the entire filter the first time, and later it will only update&lt;br /&gt;
 # the filters that have changed.  It is required that the -s option is passed as well, so the&lt;br /&gt;
 # encap.txt file is created by ampr-ripd.&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Static IPENCAP Filtering of AMPR Nodes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: this rule (or the dynamic rule above) is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF YOUR WAN&amp;gt;&#039;&#039;&#039; -j ACCEPT &lt;br /&gt;
&lt;br /&gt;
If your AMPR node is downstream, you will create an INPUT &#039;&#039;&#039;and&#039;&#039;&#039; DNAT forward rule to the destination LAN IP of your AMPR node.&lt;br /&gt;
&lt;br /&gt;
To enable receipt of [[RIP]]44&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p udp -s 44.0.0.1 --sport 520 -d 224.0.0.9 --dport 520 -i tunl0 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Masquerade LAN Subnets to AMPRNet&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this instance, eth1 is your 192.168.1.0/24 LAN&lt;br /&gt;
(thanks to Brian, N1URO)&lt;br /&gt;
&lt;br /&gt;
see: https://n1uro.ampr.org/linuxconf/44nat.html&lt;br /&gt;
&lt;br /&gt;
 # NAT setup&lt;br /&gt;
 iptables -t nat -A POSTROUTING -s 192.168.0/24 -o tunl0 -j MASQUERADE -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -m state --state RELATED,ESTABLISHED -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
&lt;br /&gt;
== ipset ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes (using ipset)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REQUIRED: [[ampr-ripd]] (using the -x and -d arguments) and the ipset package.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 ipset -N ipipfilter hash:ip 2&amp;gt;/dev/null&lt;br /&gt;
 ipset flush ipipfilter&lt;br /&gt;
 ipset -A ipipfilter &amp;lt;AMPRGW&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u | while read ip&lt;br /&gt;
 do&lt;br /&gt;
     ipset -A ipipfilter $ip&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Adding IPENCAP Filtering of AMPR Nodes to OpenWrt (using ipset)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 config rule&lt;br /&gt;
 	option target &#039;ACCEPT&#039;&lt;br /&gt;
 	option src &#039;wan&#039;&lt;br /&gt;
 	option family &#039;ipv4&#039;&lt;br /&gt;
 	option proto &#039;4&#039;&lt;br /&gt;
 	option name &#039;Allow-AMPR_IPENCAP&#039;&lt;br /&gt;
 	option extra &#039;-m set --match-set ipipfilter src&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Adding ICMP Filtering of AMPR Nodes to OpenWrt (using ipset)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 config rule&lt;br /&gt;
 	option target &#039;ACCEPT&#039;&lt;br /&gt;
 	option family &#039;ipv4&#039;&lt;br /&gt;
 	option proto &#039;icmp&#039;&lt;br /&gt;
 	list icmp_type &#039;echo-request&#039;&lt;br /&gt;
 	option src &#039;*&#039; &lt;br /&gt;
 	option extra &#039;-m set --match-set ipipfilter src&#039;&lt;br /&gt;
 	option name &#039;Ping_fromIPENCAPS&#039;&lt;br /&gt;
&lt;br /&gt;
== Microtik ==&lt;br /&gt;
&lt;br /&gt;
== OpenWRT ==&lt;br /&gt;
&lt;br /&gt;
See: iptables (above) and the Instructions for [[setting up a gateway on OpenWRT|setting up a gateway on OpenWRT]].&lt;br /&gt;
&lt;br /&gt;
iptables-based rules can be entered in Network &amp;gt; Firewall &amp;gt; Custom Firewall on the LuCI web interface; or via the command prompt via UCI.&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=778</id>
		<title>Firewalls</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=778"/>
		<updated>2019-01-11T01:49:14Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: add notes about ipset script and edit some requirement sections&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the Firewall Wiki.&lt;br /&gt;
&lt;br /&gt;
NOTE: This page is intended to be edited by the community to add use practices, command syntax, etc. regarding firewalling and security on AMPRNet nodes. While each operator is ultimately responsible for the administration of their node, it is highly suggested amongst the [[44Net mailing list]] Community that nodes be firewalled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: On an iptables-based firewall, you must enable connection tracking on the tunl0 interface in order to enable Stateful Packet Inspection (i.e. a stateful firewall). Since the IPENCAP Linux Kernel Module IPIP is in the kernel, &#039;&#039;&#039;you must set the default forwarding policy to DROP or REJECT.&#039;&#039;&#039; If you set your default routing policy to ACCEPT, all packets that have not been explicitly DROPped or REJECTed elsewhere, will route, regardless of firewall policies.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Cisco ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DD-WRT ==&lt;br /&gt;
&lt;br /&gt;
DD-WRT uses an iptables-based firewall (see iptables below). Custom rules can be entered at Administration &amp;gt; Commands &amp;gt; &amp;quot;Save Firewall&amp;quot;&lt;br /&gt;
&lt;br /&gt;
https://www.dd-wrt.com/wiki/index.php/Iptables&lt;br /&gt;
&lt;br /&gt;
https://www.dd-wrt.com/wiki/index.php/Firewall&lt;br /&gt;
&lt;br /&gt;
== D-Link ==&lt;br /&gt;
&lt;br /&gt;
On some D-Link devices, the port forwarding feature allows for the options: TCP, UDP and Other. The &amp;quot;Other&amp;quot; option on these models are capable of Destination NAT of IPENCAP packets.&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4) &#039;&#039;&#039;Note: this rule is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In Port Forwarding&lt;br /&gt;
&lt;br /&gt;
 # Create a new Port Forward&lt;br /&gt;
 # Enter the LAN IP of your AMPR node&lt;br /&gt;
 # Select &amp;quot;Other&amp;quot;&lt;br /&gt;
 # Type the number &#039;&#039;&#039;4&#039;&#039;&#039; into the field&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== iptables ==&lt;br /&gt;
&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS IP TRAFFIC THAT&#039;S INVALID ENTERING OR EXITING AMPR&lt;br /&gt;
 # THIS PREVENTS A GENERAL LOOP&lt;br /&gt;
 iptables -I FORWARD -i tunl0 -o tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND IPs NOT FROM YOUR ALLOCATION (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING ! -s 44.xxx.xxx.xxx/xx -i br-amprnet -j DROP&lt;br /&gt;
 # DROPS ROGUE INBOUND ASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 44.xxx.xxx.xxx/xx -i tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND UNASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 # YOU MUST ADD A RULE UNDER THIS LINE TO MAKE EXCEPTIONS (BCP 38)&lt;br /&gt;
 iptables -I FORWARD ! -s 44.xxx.xxx.xxx/xx -o tunl0 -j DROP&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS BOGONS ENTERING AMPRNet&lt;br /&gt;
 # SEE http://www.team-cymru.org/Services/Bogons/bogon-bn-nonagg.txt&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 0.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 10.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 100.64.0.0/10 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 127.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 169.254.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 172.16.0.0/12 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.0.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.2.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.168.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.18.0.0/15 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.51.100.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 203.0.113.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 224.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 240.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # THIS PREVENTS NESTED IPENCAP (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING -p 4 -i tunl0 -j DROP&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes (using iptables) NOTE: this script needs work, see Thu Jan 10 11:09:27 PST 2019 message in the [[44Net mailing list]] archive. Due to overheard running on many devices, the ipset script is suggested instead.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable dynamic filtering of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: this rule (or the static rule below) is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REQUIRED: [[ampr-ripd]] (using the -x and -d arguments), the diff command from the [http://www.gnu.org/software/diffutils/manual/diffutils.html diffutils package] and the [https://www.gnu.org/software/sed/manual/sed.html sed command].&lt;br /&gt;
&lt;br /&gt;
 # Place this rule a the last firewall command&lt;br /&gt;
 # Uncomment sleep command below if the rule does not appear&lt;br /&gt;
 # as load_ipipfilter.sh is still executing&lt;br /&gt;
 # sleep 10&lt;br /&gt;
 # load ipipfilter list rule&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF WAN&amp;gt;&#039;&#039;&#039; -j ipipfilter&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 # by Rob, PE1CHL&lt;br /&gt;
 # load_ipipfilter.sh&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 AMPRGW=&amp;quot;&#039;&#039;&#039;&amp;lt;AMPRGW&amp;gt;&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
 gwfile=&amp;quot;/tmp/gw&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 # Parse encap.txt for Node IPs and place in /tmp/gw&lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u &amp;gt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
 # Run command to create CHAIN, IF no system output, CHAIN was created&lt;br /&gt;
 iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 if [ $? -eq 0 ]&lt;br /&gt;
 &#039;&#039;&#039;# DO NOT PLACE EMPTY LINES BETWEEN THE TWO COMMANDS ABOVE. ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# THE EQUATION ASKS IF THE LAST SYSTEM COMMAND ENTERED ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# RETURNS &amp;quot;NOTHING.&amp;quot; ADDING A SPACE WILL CHANGE RESULTS OF THE IF COMMAND. ###&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 ##The two lines above replace the line below, which does not work on OpenWRT&lt;br /&gt;
 # if iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 ## &lt;br /&gt;
 &lt;br /&gt;
 # IF no system output, THEN flush the CHAIN and add AMPRGW,&lt;br /&gt;
 # add nodes in encap.txt and a final DROP rule&lt;br /&gt;
 then&lt;br /&gt;
     iptables -F ipipfilter&lt;br /&gt;
     iptables -A ipipfilter -s $AMPRGW -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
     while read ip&lt;br /&gt;
     do&lt;br /&gt;
         iptables -A ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
     done &amp;lt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
     iptables -A ipipfilter -j DROP&lt;br /&gt;
 &lt;br /&gt;
 # ELSE, the CHAIN already exists, determine changes&lt;br /&gt;
 # and INSERT new nodes and DELETE old nodes (excluding AMPRGW)&lt;br /&gt;
 else&lt;br /&gt;
     iptables -L ipipfilter -n | grep ACCEPT | fgrep -v $AMPRGW | \&lt;br /&gt;
         sed -e &#039;s/.*--  //&#039; -e &#039;s/ .*//&#039; | sort | diff - $gwfile | \&lt;br /&gt;
         while read d ip&lt;br /&gt;
         do&lt;br /&gt;
             case &amp;quot;$d&amp;quot; in&lt;br /&gt;
             &amp;quot;&amp;gt;&amp;quot;)&lt;br /&gt;
                 iptables -I ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             &amp;quot;&amp;lt;&amp;quot;)&lt;br /&gt;
                 iptables -D ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             *)&lt;br /&gt;
                 ;;&lt;br /&gt;
             esac&lt;br /&gt;
         done&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 # Delete /tmp/gw when done&lt;br /&gt;
 rm -f $gwfile&lt;br /&gt;
 &lt;br /&gt;
 # The full pathname of this script /usr/local/sbin/load_ipipfilter is passed with the new -x&lt;br /&gt;
 # option to ampr-ripd.   It will load the entire filter the first time, and later it will only update&lt;br /&gt;
 # the filters that have changed.  It is required that the -s option is passed as well, so the&lt;br /&gt;
 # encap.txt file is created by ampr-ripd.&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Static IPENCAP Filtering of AMPR Nodes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: this rule (or the dynamic rule above) is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF YOUR WAN&amp;gt;&#039;&#039;&#039; -j ACCEPT &lt;br /&gt;
&lt;br /&gt;
If your AMPR node is downstream, you will create an INPUT &#039;&#039;&#039;and&#039;&#039;&#039; DNAT forward rule to the destination LAN IP of your AMPR node.&lt;br /&gt;
&lt;br /&gt;
To enable receipt of [[RIP]]44&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p udp -s 44.0.0.1 --sport 520 -d 224.0.0.9 --dport 520 -i tunl0 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Masquerade LAN Subnets to AMPRNet&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this instance, eth1 is your 192.168.1.0/24 LAN&lt;br /&gt;
(thanks to Brian, N1URO)&lt;br /&gt;
&lt;br /&gt;
see: https://n1uro.ampr.org/linuxconf/44nat.html&lt;br /&gt;
&lt;br /&gt;
 # NAT setup&lt;br /&gt;
 iptables -t nat -A POSTROUTING -s 192.168.0/24 -o tunl0 -j MASQUERADE -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -m state --state RELATED,ESTABLISHED -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
&lt;br /&gt;
== ipset ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes (using ipset)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REQUIRED: [[ampr-ripd]] (using the -x and -d arguments) and the ipset package.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 AMPRGW=&amp;quot;&amp;lt;AMPRGW&amp;gt;&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 ipset -N ipipfilter hash:ip 2&amp;gt;/dev/null&lt;br /&gt;
 ipset flush ipipfilter&lt;br /&gt;
 ipset -A ipipfilter $AMPRGW&lt;br /&gt;
 &lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u | while read ip&lt;br /&gt;
 do&lt;br /&gt;
     ipset -A ipipfilter $ip&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Adding IPENCAP Filtering of AMPR Nodes to OpenWrt (using ipset)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 config rule&lt;br /&gt;
 	option target &#039;ACCEPT&#039;&lt;br /&gt;
 	option src &#039;wan&#039;&lt;br /&gt;
 	option family &#039;ipv4&#039;&lt;br /&gt;
 	option proto &#039;4&#039;&lt;br /&gt;
 	option name &#039;Allow-AMPR_IPENCAP&#039;&lt;br /&gt;
 	option extra &#039;-m set --match-set ipipfilter src&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Adding ICMP Filtering of AMPR Nodes to OpenWrt (using ipset)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 config rule&lt;br /&gt;
 	option target &#039;ACCEPT&#039;&lt;br /&gt;
 	option family &#039;ipv4&#039;&lt;br /&gt;
 	option proto &#039;icmp&#039;&lt;br /&gt;
 	list icmp_type &#039;echo-request&#039;&lt;br /&gt;
 	option src &#039;*&#039; &lt;br /&gt;
 	option extra &#039;-m set --match-set ipipfilter src&#039;&lt;br /&gt;
 	option name &#039;Ping_fromIPENCAPS&#039;&lt;br /&gt;
&lt;br /&gt;
== Microtik ==&lt;br /&gt;
&lt;br /&gt;
== OpenWRT ==&lt;br /&gt;
&lt;br /&gt;
See: iptables (above) and the Instructions for [[setting up a gateway on OpenWRT|setting up a gateway on OpenWRT]].&lt;br /&gt;
&lt;br /&gt;
iptables-based rules can be entered in Network &amp;gt; Firewall &amp;gt; Custom Firewall on the LuCI web interface; or via the command prompt via UCI.&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Setting_up_a_gateway_on_OpenWRT&amp;diff=777</id>
		<title>Setting up a gateway on OpenWRT</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Setting_up_a_gateway_on_OpenWRT&amp;diff=777"/>
		<updated>2019-01-11T01:37:38Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: removed diffutils prequsite - unneeded&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[ampr-ripd]] has been compiled for the AppliedMicro APM82181 and Atheros 71xx router CPUs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: To operate a [[Gateway]] on [[AMPRNet]], you must have a method of obtaining up-to-date route information. On AMPRNet, a variant of [https://en.wikipedia.org/wiki/Routing_Information_Protocol RIP version 2] protocol, named [[RIP]]44 is used. [https://en.wikipedia.org/wiki/Routing_Information_Protocol RIP version 2] is not the same as [[RIP]]44.&#039;&#039;&#039; [[rip44d]] is written in the Perl programming language by Heikki Hannikainen, OH7LZB. [[ampr-ripd]] is written in C by YO2LOJ. The routing table is relatively small, so the performance or memory consumption of this daemon isn&#039;t very critical. [[ampr-ripd]] is used in this instance, so no other prerequisite software is required to run the [[RIP]]44 daemon.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;You must have access to a binary [https://en.wikipedia.org/wiki/Executable executable] of [[ampr-ripd]] that is compatible with the [https://en.wikipedia.org/wiki/Central_processing_unit CPU] in your OpenWRT device (e.g. i386, i586, x86_64, MIPS, PPC, etc.). If you do not, you must [https://en.wikipedia.org/wiki/Compiler compile] ampr-ripd yourself, or install the packages necessary to run [[rip44d]].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There is also an experimental LUA daemon at [[RIP44.lua]] which should run with standard packages.&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;See&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
* [https://openwrt.org/docs/guide-developer/crosscompile Cross Compile - OpenWRT]&lt;br /&gt;
* [https://openwrt.org/docs/start OpenWRT Manual]&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: These instructions assume first that you have been assigned AMPRNet IP address allocations that are properly assigned and configured to your account in the [[Portal]]. Next, that you intend to configure your OpenWRT-based (version 14.07 or greater) AMPRNet [[Gateway]] to be a [https://en.wikipedia.org/wiki/Stateful_firewall stateful firewall] for your AMPRNet allocations (i.e. enabling connection tracking). If you prefer to forward all traffic to your allocated AMPRNet IP addresses, you may follow these instructions; but configure your Firewall Zones to forward all traffic to/from AMPRLAN to AMPRWAN. These instructions configure your AMPRNet Tunnel and AMPRNet Local Interfaces in their own [https://en.wikipedia.org/wiki/Policy-based_routing policy-based routing] sernario; and places all local AMPRNet allocations in the main routing instance (you must provide routing rules for your local AMPR subnets to reach local subnets, if you desire). Since the OpenWRT Kernel is aware that your AMPRNet allocations exist locally (and are populated on the MAIN ROUTING TABLE), you must provide routing rules for AMPRLAN to reach these local subnets, or omit those rules (not permitting your AMPRLAN to route to your local subnets). Lastly, it assumes that the user can navigate the default OpenWRT LuCI web-based graphical user interface locally (and that they are using a device capable of having the package installed), are familiar with the [https://en.wikipedia.org/wiki/Chmod chmod] command, and/or familiar with entering OpenWRT UCI (Unified Configuration Interface) commands by serial console or SSH.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Install:&lt;br /&gt;
&lt;br /&gt;
* kmod-ipip&lt;br /&gt;
* ip-full&lt;br /&gt;
* libstdcpp&lt;br /&gt;
* [[ampr-ripd]] to &#039;&#039;&#039;/etc/config/&#039;&#039;&#039; (always run [[RIP]]44 software in console mode FIRST after installation to verify execution and obtain the password, the execution of the file is commented-out below)&lt;br /&gt;
* (optional) dynamic firewall script to /etc/config/load_ipipfilter.sh (see the iptables section of the [[Firewalls]] wiki)&lt;br /&gt;
* the following to &#039;&#039;&#039;System &amp;gt; Startup &amp;gt; Local Startup:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ip tunnel add tunl0&lt;br /&gt;
 ip tunnel change tunl0 mode ipip ttl 64 tos inherit pmtudisc&lt;br /&gt;
 ip link set tunl0 mtu 1480 up&lt;br /&gt;
 &#039;&#039;&#039;# This directory is not persistent on OpenWRT, it must be made on boot for dynamic filtering&lt;br /&gt;
 mkdir /var/lib/ampr-ripd&lt;br /&gt;
 # A blank bootstrap file must be created at /etc/config/encap.txt for this to work&lt;br /&gt;
 # Running &#039;&#039;&#039;touch /etc/config/encap.txt&#039;&#039;&#039; once can create it&lt;br /&gt;
 # after which, you may run ampr-ripd to populate it&lt;br /&gt;
 ln -s /etc/config/encap.txt /tmp/lib/ampr-ripd/encap.txt&lt;br /&gt;
 # Dynamic filter, script executed by -x argument&lt;br /&gt;
 # Dynamic filter, -s argument creates encap.txt&lt;br /&gt;
 &#039;&#039;&#039;# ./etc/config/ampr-ripd -p &amp;lt;PASSWORD&amp;gt; -s -t 44 -a &amp;lt;44.xxx.xxx.xxx/xx&amp;gt; -x ./etc/config/load_ipipfilter.sh &amp;amp;&#039;&#039;&#039;&lt;br /&gt;
 ## Allows traceroute to respond using 44net IP of tunl0 or br-amprlan ##&lt;br /&gt;
 echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_errors_use_inbound_ifaddr&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;UPDATE 2018 (routes and rules have been added to the UCI):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # add IP Route to /etc/config/network&lt;br /&gt;
 &lt;br /&gt;
 config route&lt;br /&gt;
 	option interface &#039;amprwan&#039;&lt;br /&gt;
 	option target &#039;0.0.0.0&#039;&lt;br /&gt;
 	option netmask &#039;0.0.0.0&#039;&lt;br /&gt;
 	option gateway &#039;&#039;&#039;&#039;&amp;lt;AMPRGW&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
 	option onlink &#039;1&#039;&lt;br /&gt;
 	option table &#039;44&#039;&lt;br /&gt;
&lt;br /&gt;
 # add IP Rules to /etc/config/network&lt;br /&gt;
 &lt;br /&gt;
 #OPTIONAL AMPR TO LAN RULES (NUMBER 22-2X ACCORDINGLY)&lt;br /&gt;
 config rule&lt;br /&gt;
 	option src &#039;44.xxx.xxx.0/24&#039;&lt;br /&gt;
 	option dest &#039;192.168.xxx.0/24&#039;&lt;br /&gt;
 	option priority &#039;22&#039;&lt;br /&gt;
 	option lookup &#039;main&#039;&lt;br /&gt;
 &lt;br /&gt;
 #ADD A MAIN RULE FOR EVERY LOCAL AMPR SUBNET, RENUMBER 44-4X ACCORDINGLY)&lt;br /&gt;
 config rule&lt;br /&gt;
 	option dest &#039;44.xxx.xxx.0/24&#039;&lt;br /&gt;
 	option priority &#039;44&#039;&lt;br /&gt;
 	option lookup &#039;main&#039;&lt;br /&gt;
 &lt;br /&gt;
 ### This ensures all traffic received on tunl0 uses table 44&lt;br /&gt;
 config rule&lt;br /&gt;
 	option in &#039;amprwan&#039;&lt;br /&gt;
 	option dest &#039;0.0.0.0/0&#039;&lt;br /&gt;
 	option priority &#039;45&#039;&lt;br /&gt;
 	option lookup &#039;44&#039;&lt;br /&gt;
 &lt;br /&gt;
 ###Add this after you create the AMPRLAN bridge, this ensures all traffic from AMPRLAN uses table 44&lt;br /&gt;
 config rule&lt;br /&gt;
 	option in &#039;amprnet&#039;&lt;br /&gt;
 	option dest &#039;0.0.0.0/0&#039;&lt;br /&gt;
 	option priority &#039;46&#039;&lt;br /&gt;
 	option lookup &#039;44&#039;&lt;br /&gt;
 &lt;br /&gt;
 ### You must add an IP rule for all 44net IPs residing on the device&lt;br /&gt;
 config rule&lt;br /&gt;
 	option src &#039;44.xxx.xxx.0/24&lt;br /&gt;
 	option priority &#039;47&#039;&lt;br /&gt;
 	option lookup &#039;44&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;reboot&#039;&#039;&#039;&lt;br /&gt;
* create an unmanaged Interface instance for tunl0 (&#039;&#039;&#039;AMPRWAN&#039;&#039;&#039;) &#039;&#039;&#039;(set to not bring up on boot)&#039;&#039;&#039;, adding it to its own firewall zone &#039;&#039;&#039;amprwan&#039;&#039;&#039; using Input: Drop (or Reject), Output: Drop (or Reject) and Forward: Drop (or Reject). &#039;&#039;&#039;(OpenWRT 14.07 or lower - Be sure to enable connection tracking if you will not masquerade)&#039;&#039;&#039;&lt;br /&gt;
* an interface instance for a new VLAN and bridge (the example above uses AMPRNET), add it to its own firewall zone using Input: Accept (if you wish for you AMPRLAN devices to reach the router), Output: Accept and Forward: Drop (or Reject). &#039;&#039;&#039;Assign an IP from your allocation to this interface, you will configure this IP on your devices as the Default Route/Gateway address.&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;reboot&#039;&#039;&#039;&lt;br /&gt;
* Permit forwarding from AMPRLAN to AMPRWAN and WAN (you must masquerade this traffic when using WAN)&lt;br /&gt;
* Permit forwarding from LAN to AMPRLAN (as desired, NOTE: you must make an IP Rule for the AMPRLAN to use the LAN&#039;s route on the Main Routing Table)&lt;br /&gt;
* Create Traffic Input rule to allow IPv4 IPENCAP (IP protocol type 4) from Any IP on WAN to any IP on Router (or specify WAN IP if statically assigned)&lt;br /&gt;
* Create Traffic Input rule to allow IPv4 udp/520 from 44.0.0.1 in AMPRWAN to 224.0.0.9 at port udp/520 IP on Router&lt;br /&gt;
* Create Traffic Forward rules for any inbound services (as desired)&lt;br /&gt;
* the VLAN to any switch/trunk ports (as desired)&lt;br /&gt;
* make ampr-ripd and load_ipipfilter.sh executable using &#039;&#039;&#039;chmod +x&#039;&#039;&#039;&lt;br /&gt;
* test ampr-ripd in console using the &#039;&#039;&#039;-d&#039;&#039;&#039; argument&lt;br /&gt;
* add password to the &#039;&#039;&#039;Local Startup&#039;&#039;&#039; entry and uncomment ampr-ripd line&lt;br /&gt;
* &#039;&#039;&#039;reboot&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=776</id>
		<title>Firewalls</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=776"/>
		<updated>2019-01-11T01:33:01Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: edit to ipset section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the Firewall Wiki.&lt;br /&gt;
&lt;br /&gt;
NOTE: This page is intended to be edited by the community to add use practices, command syntax, etc. regarding firewalling and security on AMPRNet nodes. While each operator is ultimately responsible for the administration of their node, it is highly suggested amongst the [[44Net mailing list]] Community that nodes be firewalled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: On an iptables-based firewall, you must enable connection tracking on the tunl0 interface in order to enable Stateful Packet Inspection (i.e. a stateful firewall). Since the IPENCAP Linux Kernel Module IPIP is in the kernel, &#039;&#039;&#039;you must set the default forwarding policy to DROP or REJECT.&#039;&#039;&#039; If you set your default routing policy to ACCEPT, all packets that have not been explicitly DROPped or REJECTed elsewhere, will route, regardless of firewall policies.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Cisco ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DD-WRT ==&lt;br /&gt;
&lt;br /&gt;
DD-WRT uses an iptables-based firewall (see iptables below). Custom rules can be entered at Administration &amp;gt; Commands &amp;gt; &amp;quot;Save Firewall&amp;quot;&lt;br /&gt;
&lt;br /&gt;
https://www.dd-wrt.com/wiki/index.php/Iptables&lt;br /&gt;
&lt;br /&gt;
https://www.dd-wrt.com/wiki/index.php/Firewall&lt;br /&gt;
&lt;br /&gt;
== D-Link ==&lt;br /&gt;
&lt;br /&gt;
On some D-Link devices, the port forwarding feature allows for the options: TCP, UDP and Other. The &amp;quot;Other&amp;quot; option on these models are capable of Destination NAT of IPENCAP packets.&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4) &#039;&#039;&#039;Note: this rule is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In Port Forwarding&lt;br /&gt;
&lt;br /&gt;
 # Create a new Port Forward&lt;br /&gt;
 # Enter the LAN IP of your AMPR node&lt;br /&gt;
 # Select &amp;quot;Other&amp;quot;&lt;br /&gt;
 # Type the number &#039;&#039;&#039;4&#039;&#039;&#039; into the field&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== iptables ==&lt;br /&gt;
&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS IP TRAFFIC THAT&#039;S INVALID ENTERING OR EXITING AMPR&lt;br /&gt;
 # THIS PREVENTS A GENERAL LOOP&lt;br /&gt;
 iptables -I FORWARD -i tunl0 -o tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND IPs NOT FROM YOUR ALLOCATION (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING ! -s 44.xxx.xxx.xxx/xx -i br-amprnet -j DROP&lt;br /&gt;
 # DROPS ROGUE INBOUND ASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 44.xxx.xxx.xxx/xx -i tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND UNASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 # YOU MUST ADD A RULE UNDER THIS LINE TO MAKE EXCEPTIONS (BCP 38)&lt;br /&gt;
 iptables -I FORWARD ! -s 44.xxx.xxx.xxx/xx -o tunl0 -j DROP&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS BOGONS ENTERING AMPRNet&lt;br /&gt;
 # SEE http://www.team-cymru.org/Services/Bogons/bogon-bn-nonagg.txt&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 0.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 10.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 100.64.0.0/10 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 127.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 169.254.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 172.16.0.0/12 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.0.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.2.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.168.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.18.0.0/15 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.51.100.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 203.0.113.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 224.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 240.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # THIS PREVENTS NESTED IPENCAP (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING -p 4 -i tunl0 -j DROP&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes (using iptables)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable dynamic filtering of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: this rule (or the static rule below) is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REQUIRED: [[ampr-ripd]] (using the -x and -d arguments), the diff command from the [http://www.gnu.org/software/diffutils/manual/diffutils.html diffutils package] and the [https://www.gnu.org/software/sed/manual/sed.html sed command].&lt;br /&gt;
&lt;br /&gt;
 # Place this rule a the last firewall command&lt;br /&gt;
 # Uncomment sleep command below if the rule does not appear&lt;br /&gt;
 # as load_ipipfilter.sh is still executing&lt;br /&gt;
 # sleep 10&lt;br /&gt;
 # load ipipfilter list rule&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF WAN&amp;gt;&#039;&#039;&#039; -j ipipfilter&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 # by Rob, PE1CHL&lt;br /&gt;
 # load_ipipfilter.sh&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 AMPRGW=&amp;quot;&#039;&#039;&#039;&amp;lt;AMPRGW&amp;gt;&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
 gwfile=&amp;quot;/tmp/gw&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 # Parse encap.txt for Node IPs and place in /tmp/gw&lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u &amp;gt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
 # Run command to create CHAIN, IF no system output, CHAIN was created&lt;br /&gt;
 iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 if [ $? -eq 0 ]&lt;br /&gt;
 &#039;&#039;&#039;# DO NOT PLACE EMPTY LINES BETWEEN THE TWO COMMANDS ABOVE. ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# THE EQUATION ASKS IF THE LAST SYSTEM COMMAND ENTERED ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# RETURNS &amp;quot;NOTHING.&amp;quot; ADDING A SPACE WILL CHANGE RESULTS OF THE IF COMMAND. ###&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 ##The two lines above replace the line below, which does not work on OpenWRT&lt;br /&gt;
 # if iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 ## &lt;br /&gt;
 &lt;br /&gt;
 # IF no system output, THEN flush the CHAIN and add AMPRGW,&lt;br /&gt;
 # add nodes in encap.txt and a final DROP rule&lt;br /&gt;
 then&lt;br /&gt;
     iptables -F ipipfilter&lt;br /&gt;
     iptables -A ipipfilter -s $AMPRGW -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
     while read ip&lt;br /&gt;
     do&lt;br /&gt;
         iptables -A ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
     done &amp;lt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
     iptables -A ipipfilter -j DROP&lt;br /&gt;
 &lt;br /&gt;
 # ELSE, the CHAIN already exists, determine changes&lt;br /&gt;
 # and INSERT new nodes and DELETE old nodes (excluding AMPRGW)&lt;br /&gt;
 else&lt;br /&gt;
     iptables -L ipipfilter -n | grep ACCEPT | fgrep -v $AMPRGW | \&lt;br /&gt;
         sed -e &#039;s/.*--  //&#039; -e &#039;s/ .*//&#039; | sort | diff - $gwfile | \&lt;br /&gt;
         while read d ip&lt;br /&gt;
         do&lt;br /&gt;
             case &amp;quot;$d&amp;quot; in&lt;br /&gt;
             &amp;quot;&amp;gt;&amp;quot;)&lt;br /&gt;
                 iptables -I ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             &amp;quot;&amp;lt;&amp;quot;)&lt;br /&gt;
                 iptables -D ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             *)&lt;br /&gt;
                 ;;&lt;br /&gt;
             esac&lt;br /&gt;
         done&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 # Delete /tmp/gw when done&lt;br /&gt;
 rm -f $gwfile&lt;br /&gt;
 &lt;br /&gt;
 # The full pathname of this script /usr/local/sbin/load_ipipfilter is passed with the new -x&lt;br /&gt;
 # option to ampr-ripd.   It will load the entire filter the first time, and later it will only update&lt;br /&gt;
 # the filters that have changed.  It is required that the -s option is passed as well, so the&lt;br /&gt;
 # encap.txt file is created by ampr-ripd.&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Static IPENCAP Filtering of AMPR Nodes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: this rule (or the dynamic rule above) is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF YOUR WAN&amp;gt;&#039;&#039;&#039; -j ACCEPT &lt;br /&gt;
&lt;br /&gt;
If your AMPR node is downstream, you will create an INPUT &#039;&#039;&#039;and&#039;&#039;&#039; DNAT forward rule to the destination LAN IP of your AMPR node.&lt;br /&gt;
&lt;br /&gt;
To enable receipt of [[RIP]]44&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p udp -s 44.0.0.1 --sport 520 -d 224.0.0.9 --dport 520 -i tunl0 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Masquerade LAN Subnets to AMPRNet&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this instance, eth1 is your 192.168.1.0/24 LAN&lt;br /&gt;
(thanks to Brian, N1URO)&lt;br /&gt;
&lt;br /&gt;
see: https://n1uro.ampr.org/linuxconf/44nat.html&lt;br /&gt;
&lt;br /&gt;
 # NAT setup&lt;br /&gt;
 iptables -t nat -A POSTROUTING -s 192.168.0/24 -o tunl0 -j MASQUERADE -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -m state --state RELATED,ESTABLISHED -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
&lt;br /&gt;
== ipset ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes (using ipset)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
On OpenWrt, install ipset.&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 AMPRGW=&amp;quot;&amp;lt;AMPRGW&amp;gt;&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 ipset -N ipipfilter hash:ip 2&amp;gt;/dev/null&lt;br /&gt;
 ipset flush ipipfilter&lt;br /&gt;
 ipset -A ipipfilter $AMPRGW&lt;br /&gt;
 &lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u | while read ip&lt;br /&gt;
 do&lt;br /&gt;
     ipset -A ipipfilter $ip&lt;br /&gt;
 done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Adding IPENCAP Filtering of AMPR Nodes to OpenWrt (using ipset)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 config rule&lt;br /&gt;
 	option target &#039;ACCEPT&#039;&lt;br /&gt;
 	option src &#039;wan&#039;&lt;br /&gt;
 	option family &#039;ipv4&#039;&lt;br /&gt;
 	option proto &#039;4&#039;&lt;br /&gt;
 	option name &#039;Allow-AMPR_IPENCAP&#039;&lt;br /&gt;
 	option extra &#039;-m set --match-set ipipfilter src&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Adding ICMP Filtering of AMPR Nodes to OpenWrt (using ipset)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 config rule&lt;br /&gt;
 	option target &#039;ACCEPT&#039;&lt;br /&gt;
 	option family &#039;ipv4&#039;&lt;br /&gt;
 	option proto &#039;icmp&#039;&lt;br /&gt;
 	list icmp_type &#039;echo-request&#039;&lt;br /&gt;
 	option src &#039;*&#039; &lt;br /&gt;
 	option extra &#039;-m set --match-set ipipfilter src&#039;&lt;br /&gt;
 	option name &#039;Ping_fromIPENCAPS&#039;&lt;br /&gt;
&lt;br /&gt;
== Microtik ==&lt;br /&gt;
&lt;br /&gt;
== OpenWRT ==&lt;br /&gt;
&lt;br /&gt;
See: iptables (above) and the Instructions for [[setting up a gateway on OpenWRT|setting up a gateway on OpenWRT]].&lt;br /&gt;
&lt;br /&gt;
iptables-based rules can be entered in Network &amp;gt; Firewall &amp;gt; Custom Firewall on the LuCI web interface; or via the command prompt via UCI.&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=775</id>
		<title>Firewalls</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=775"/>
		<updated>2019-01-10T18:18:46Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: removed  &amp;quot;if [ $? -eq 0 ]&amp;quot; from ipset-based dynamic filter&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the Firewall Wiki.&lt;br /&gt;
&lt;br /&gt;
NOTE: This page is intended to be edited by the community to add use practices, command syntax, etc. regarding firewalling and security on AMPRNet nodes. While each operator is ultimately responsible for the administration of their node, it is highly suggested amongst the [[44Net mailing list]] Community that nodes be firewalled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: On an iptables-based firewall, you must enable connection tracking on the tunl0 interface in order to enable Stateful Packet Inspection (i.e. a stateful firewall). Since the IPENCAP Linux Kernel Module IPIP is in the kernel, &#039;&#039;&#039;you must set the default forwarding policy to DROP or REJECT.&#039;&#039;&#039; If you set your default routing policy to ACCEPT, all packets that have not been explicitly DROPped or REJECTed elsewhere, will route, regardless of firewall policies.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Cisco ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DD-WRT ==&lt;br /&gt;
&lt;br /&gt;
DD-WRT uses an iptables-based firewall (see iptables below). Custom rules can be entered at Administration &amp;gt; Commands &amp;gt; &amp;quot;Save Firewall&amp;quot;&lt;br /&gt;
&lt;br /&gt;
https://www.dd-wrt.com/wiki/index.php/Iptables&lt;br /&gt;
&lt;br /&gt;
https://www.dd-wrt.com/wiki/index.php/Firewall&lt;br /&gt;
&lt;br /&gt;
== D-Link ==&lt;br /&gt;
&lt;br /&gt;
On some D-Link devices, the port forwarding feature allows for the options: TCP, UDP and Other. The &amp;quot;Other&amp;quot; option on these models are capable of Destination NAT of IPENCAP packets.&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4) &#039;&#039;&#039;Note: this rule is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In Port Forwarding&lt;br /&gt;
&lt;br /&gt;
 # Create a new Port Forward&lt;br /&gt;
 # Enter the LAN IP of your AMPR node&lt;br /&gt;
 # Select &amp;quot;Other&amp;quot;&lt;br /&gt;
 # Type the number &#039;&#039;&#039;4&#039;&#039;&#039; into the field&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== iptables ==&lt;br /&gt;
&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS IP TRAFFIC THAT&#039;S INVALID ENTERING OR EXITING AMPR&lt;br /&gt;
 # THIS PREVENTS A GENERAL LOOP&lt;br /&gt;
 iptables -I FORWARD -i tunl0 -o tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND IPs NOT FROM YOUR ALLOCATION (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING ! -s 44.xxx.xxx.xxx/xx -i br-amprnet -j DROP&lt;br /&gt;
 # DROPS ROGUE INBOUND ASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 44.xxx.xxx.xxx/xx -i tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND UNASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 # YOU MUST ADD A RULE UNDER THIS LINE TO MAKE EXCEPTIONS (BCP 38)&lt;br /&gt;
 iptables -I FORWARD ! -s 44.xxx.xxx.xxx/xx -o tunl0 -j DROP&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS BOGONS ENTERING AMPRNet&lt;br /&gt;
 # SEE http://www.team-cymru.org/Services/Bogons/bogon-bn-nonagg.txt&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 0.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 10.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 100.64.0.0/10 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 127.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 169.254.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 172.16.0.0/12 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.0.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.2.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.168.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.18.0.0/15 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.51.100.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 203.0.113.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 224.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 240.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # THIS PREVENTS NESTED IPENCAP (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING -p 4 -i tunl0 -j DROP&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes (using iptables)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable dynamic filtering of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: this rule (or the static rule below) is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REQUIRED: [[ampr-ripd]] (using the -x and -d arguments), the diff command from the [http://www.gnu.org/software/diffutils/manual/diffutils.html diffutils package] and the [https://www.gnu.org/software/sed/manual/sed.html sed command].&lt;br /&gt;
&lt;br /&gt;
 # Place this rule a the last firewall command&lt;br /&gt;
 # Uncomment sleep command below if the rule does not appear&lt;br /&gt;
 # as load_ipipfilter.sh is still executing&lt;br /&gt;
 # sleep 10&lt;br /&gt;
 # load ipipfilter list rule&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF WAN&amp;gt;&#039;&#039;&#039; -j ipipfilter&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 # by Rob, PE1CHL&lt;br /&gt;
 # load_ipipfilter.sh&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 AMPRGW=&amp;quot;&#039;&#039;&#039;&amp;lt;AMPRGW&amp;gt;&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
 gwfile=&amp;quot;/tmp/gw&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 # Parse encap.txt for Node IPs and place in /tmp/gw&lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u &amp;gt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
 # Run command to create CHAIN, IF no system output, CHAIN was created&lt;br /&gt;
 iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 if [ $? -eq 0 ]&lt;br /&gt;
 &#039;&#039;&#039;# DO NOT PLACE EMPTY LINES BETWEEN THE TWO COMMANDS ABOVE. ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# THE EQUATION ASKS IF THE LAST SYSTEM COMMAND ENTERED ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# RETURNS &amp;quot;NOTHING.&amp;quot; ADDING A SPACE WILL CHANGE RESULTS OF THE IF COMMAND. ###&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 ##The two lines above replace the line below, which does not work on OpenWRT&lt;br /&gt;
 # if iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 ## &lt;br /&gt;
 &lt;br /&gt;
 # IF no system output, THEN flush the CHAIN and add AMPRGW,&lt;br /&gt;
 # add nodes in encap.txt and a final DROP rule&lt;br /&gt;
 then&lt;br /&gt;
     iptables -F ipipfilter&lt;br /&gt;
     iptables -A ipipfilter -s $AMPRGW -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
     while read ip&lt;br /&gt;
     do&lt;br /&gt;
         iptables -A ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
     done &amp;lt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
     iptables -A ipipfilter -j DROP&lt;br /&gt;
 &lt;br /&gt;
 # ELSE, the CHAIN already exists, determine changes&lt;br /&gt;
 # and INSERT new nodes and DELETE old nodes (excluding AMPRGW)&lt;br /&gt;
 else&lt;br /&gt;
     iptables -L ipipfilter -n | grep ACCEPT | fgrep -v $AMPRGW | \&lt;br /&gt;
         sed -e &#039;s/.*--  //&#039; -e &#039;s/ .*//&#039; | sort | diff - $gwfile | \&lt;br /&gt;
         while read d ip&lt;br /&gt;
         do&lt;br /&gt;
             case &amp;quot;$d&amp;quot; in&lt;br /&gt;
             &amp;quot;&amp;gt;&amp;quot;)&lt;br /&gt;
                 iptables -I ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             &amp;quot;&amp;lt;&amp;quot;)&lt;br /&gt;
                 iptables -D ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             *)&lt;br /&gt;
                 ;;&lt;br /&gt;
             esac&lt;br /&gt;
         done&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 # Delete /tmp/gw when done&lt;br /&gt;
 rm -f $gwfile&lt;br /&gt;
 &lt;br /&gt;
 # The full pathname of this script /usr/local/sbin/load_ipipfilter is passed with the new -x&lt;br /&gt;
 # option to ampr-ripd.   It will load the entire filter the first time, and later it will only update&lt;br /&gt;
 # the filters that have changed.  It is required that the -s option is passed as well, so the&lt;br /&gt;
 # encap.txt file is created by ampr-ripd.&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Static IPENCAP Filtering of AMPR Nodes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: this rule (or the dynamic rule above) is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF YOUR WAN&amp;gt;&#039;&#039;&#039; -j ACCEPT &lt;br /&gt;
&lt;br /&gt;
If your AMPR node is downstream, you will create an INPUT &#039;&#039;&#039;and&#039;&#039;&#039; DNAT forward rule to the destination LAN IP of your AMPR node.&lt;br /&gt;
&lt;br /&gt;
To enable receipt of [[RIP]]44&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p udp -s 44.0.0.1 --sport 520 -d 224.0.0.9 --dport 520 -i tunl0 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Masquerade LAN Subnets to AMPRNet&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this instance, eth1 is your 192.168.1.0/24 LAN&lt;br /&gt;
(thanks to Brian, N1URO)&lt;br /&gt;
&lt;br /&gt;
see: https://n1uro.ampr.org/linuxconf/44nat.html&lt;br /&gt;
&lt;br /&gt;
 # NAT setup&lt;br /&gt;
 iptables -t nat -A POSTROUTING -s 192.168.0/24 -o tunl0 -j MASQUERADE -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -m state --state RELATED,ESTABLISHED -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
&lt;br /&gt;
== ipset ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes (using ipset)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
On OpenWrt, install diffutils and ipset.&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 #on the incoming interface:&lt;br /&gt;
 # iptables -t filter -I INPUT -p 4 -i eth0.2 -m set --set ipipfilter src -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 AMPRGW=&amp;quot;&#039;&#039;&#039;&amp;lt;AMPRGW&amp;gt;&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
 gwfile=&amp;quot;/tmp/gw&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u &amp;gt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
 if ipset -N ipipfilter hash:ip 2&amp;gt;/dev/null&lt;br /&gt;
 then&lt;br /&gt;
     ipset flush ipipfilter&lt;br /&gt;
     ipset -A ipipfilter $AMPRGW&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
     while read ip&lt;br /&gt;
     do&lt;br /&gt;
         ipset -A ipipfilter $ip&lt;br /&gt;
     done &amp;lt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 else&lt;br /&gt;
  ipset flush ipipfilter&lt;br /&gt;
     ipset -A ipipfilter $AMPRGW&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
     while read ip&lt;br /&gt;
     do&lt;br /&gt;
         ipset -A ipipfilter $ip&lt;br /&gt;
     done &amp;lt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 rm -f $gwfile&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Adding IPENCAP Filtering of AMPR Nodes to OpenWrt (using ipset)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 config rule&lt;br /&gt;
 	option target &#039;ACCEPT&#039;&lt;br /&gt;
 	option src &#039;wan&#039;&lt;br /&gt;
 	option family &#039;ipv4&#039;&lt;br /&gt;
 	option proto &#039;4&#039;&lt;br /&gt;
 	option name &#039;Allow-AMPR_IPENCAP&#039;&lt;br /&gt;
 	option extra &#039;-m set --match-set ipipfilter src&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Adding ICMP Filtering of AMPR Nodes to OpenWrt (using ipset)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 config rule&lt;br /&gt;
 	option target &#039;ACCEPT&#039;&lt;br /&gt;
 	option family &#039;ipv4&#039;&lt;br /&gt;
 	option proto &#039;icmp&#039;&lt;br /&gt;
 	list icmp_type &#039;echo-request&#039;&lt;br /&gt;
 	option src &#039;*&#039; &lt;br /&gt;
 	option extra &#039;-m set --match-set ipipfilter src&#039;&lt;br /&gt;
 	option name &#039;Ping_fromIPENCAPS&#039;&lt;br /&gt;
&lt;br /&gt;
== Microtik ==&lt;br /&gt;
&lt;br /&gt;
== OpenWRT ==&lt;br /&gt;
&lt;br /&gt;
See: iptables (above) and the Instructions for [[setting up a gateway on OpenWRT|setting up a gateway on OpenWRT]].&lt;br /&gt;
&lt;br /&gt;
iptables-based rules can be entered in Network &amp;gt; Firewall &amp;gt; Custom Firewall on the LuCI web interface; or via the command prompt via UCI.&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=RIP&amp;diff=774</id>
		<title>RIP</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=RIP&amp;diff=774"/>
		<updated>2018-10-02T19:34:05Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: added detailed differences and explanations of the protocol from Marius, YO2LOJ&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Information about other AMPRNet [[gateway| gateways]] can now be received dynamically via modified [http://en.wikipedia.org/wiki/Routing_Information_Protocol RIPv2] advertisements. Previously, routes were obtained by creating a [[munge script]] that parsed [[Encap.txt]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= What&#039;s the difference? =&lt;br /&gt;
&lt;br /&gt;
There is a big difference in how the packets are processed.&lt;br /&gt;
&lt;br /&gt;
The regular RIPv2 sets a route to a specific subnet via the sender and &lt;br /&gt;
interface where the RIP broadcast was received on. The gateway &lt;br /&gt;
information is used only as an optimization element, in case a route &lt;br /&gt;
with to that gateway already exists so that the one with the lower &lt;br /&gt;
metric gets chosen.&lt;br /&gt;
&lt;br /&gt;
In our case, we use the RIP announcements to transport the subnet AND &lt;br /&gt;
gateway information.&lt;br /&gt;
&lt;br /&gt;
= Detailed description =&lt;br /&gt;
&lt;br /&gt;
So, assuming a point to multipoint interface, if there is let&#039;s say an &lt;br /&gt;
announcement 44.128.0.0/24 via 1.2.3.4 coming from 44.0.0.1 on the ipip0 &lt;br /&gt;
interface, regular RIPv2 would translate this to:&lt;br /&gt;
&lt;br /&gt;
44.128.0.0/24 via 44.0.0.1 if ipip0&lt;br /&gt;
&lt;br /&gt;
while ampr rip would translate this to:&lt;br /&gt;
&lt;br /&gt;
44.128.0.0/24 via 1.2.3.4 if ipip0&lt;br /&gt;
&lt;br /&gt;
In the first case, traffic to 44.128.0.0/24 is sent directly to the &lt;br /&gt;
gateway (the RIP sender), while in the second case it is encapsulated to &lt;br /&gt;
1.2.3.4.&lt;br /&gt;
&lt;br /&gt;
On a mikrotik router it even goes a step further:&lt;br /&gt;
it creates a ipip tunnel interface, ampr-1.2.3.4 to 1.2.3.4 and creates &lt;br /&gt;
a route&lt;br /&gt;
&lt;br /&gt;
44.128.0.0/24 via ampr-1.2.3.4&lt;br /&gt;
&lt;br /&gt;
This is the processing in the usual case, for 44 subnets having a 44net &lt;br /&gt;
gateway we assume that the gateway is published by BGP and is directly &lt;br /&gt;
reachable, so for a announcement like 44.128.0.0/24 via 44.128.0.1 there &lt;br /&gt;
are 2 route set:&lt;br /&gt;
&lt;br /&gt;
44.128.0.1 via default-gw  (which is autodetected), and&lt;br /&gt;
44.128.0.0/24 via 44.128.0.1 if ipip0 to do the encapsulation&lt;br /&gt;
&lt;br /&gt;
So, while the information structure in both cases conforms to the RIPv2 &lt;br /&gt;
specifications, its usage is completely different.&lt;br /&gt;
&lt;br /&gt;
= RIP44 Daemons =&lt;br /&gt;
&lt;br /&gt;
Two programs are available for GNU/Linux to utilize these updates:&lt;br /&gt;
&lt;br /&gt;
* [[ampr-ripd]], a C based routing daemon&lt;br /&gt;
* [[rip44d]], a PERL based routing daemon&lt;br /&gt;
&lt;br /&gt;
= Availability/Compatibility =&lt;br /&gt;
&lt;br /&gt;
The RIP44 daemons have been tested and known to work on the following operating systems:&lt;br /&gt;
&lt;br /&gt;
* BSD&lt;br /&gt;
* OpenWRT/LEDE&lt;br /&gt;
* Raspbian&lt;br /&gt;
* Slackware Linux&lt;br /&gt;
* Ubuntu/Debian Linux&lt;br /&gt;
* Vyatta/VyOS&lt;br /&gt;
&lt;br /&gt;
= Non-RIP44 Workarounds =&lt;br /&gt;
&lt;br /&gt;
The devices below do not possess a known, end-user method to install additional software (i.e. ampr-ripd). Operators have developed scripts to parse inbound routing packets to make them compatible for usage on AMPRNet:&lt;br /&gt;
&lt;br /&gt;
* Cisco IOS (a separate machine must run the script) : look here http://wiki.ampr.org/wiki/Setting_up_a_gateway_on_Cisco_Routers  at the &amp;quot;Making the route commands automatically&amp;quot; section&lt;br /&gt;
* JunOS&lt;br /&gt;
* MikroTik : look here  http://www.yo2loj.ro/hamprojects/ at the &amp;quot;Mikrotik RIPv2 AMPR Gateway Setup Script 3.0&amp;quot;&lt;br /&gt;
* Ubiquiti OS&lt;br /&gt;
&lt;br /&gt;
= See Also =&lt;br /&gt;
&lt;br /&gt;
* [[startampr]] - a script that loads the routing daemon on boot on Linux server-type devices&lt;br /&gt;
* Instructions for [[setting up a gateway on Linux|setting up a tunnel gateway on Linux]]&lt;br /&gt;
* Instructions for [[setting up a gateway on OpenWRT|setting up a gateway on OpenWRT]]&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=773</id>
		<title>Firewalls</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=773"/>
		<updated>2018-09-22T00:55:45Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: moved comment in ipset meant for iptables, as ipset is fully flushed in the script&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the Firewall Wiki.&lt;br /&gt;
&lt;br /&gt;
NOTE: This page is intended to be edited by the community to add use practices, command syntax, etc. regarding firewalling and security on AMPRNet nodes. While each operator is ultimately responsible for the administration of their node, it is highly suggested amongst the [[44Net mailing list]] Community that nodes be firewalled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: On an iptables-based firewall, you must enable connection tracking on the tunl0 interface in order to enable Stateful Packet Inspection (i.e. a stateful firewall). Since the IPENCAP Linux Kernel Module IPIP is in the kernel, &#039;&#039;&#039;you must set the default forwarding policy to DROP or REJECT.&#039;&#039;&#039; If you set your default routing policy to ACCEPT, all packets that have not been explicitly DROPped or REJECTed elsewhere, will route, regardless of firewall policies.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Cisco ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DD-WRT ==&lt;br /&gt;
&lt;br /&gt;
DD-WRT uses an iptables-based firewall (see iptables below). Custom rules can be entered at Administration &amp;gt; Commands &amp;gt; &amp;quot;Save Firewall&amp;quot;&lt;br /&gt;
&lt;br /&gt;
https://www.dd-wrt.com/wiki/index.php/Iptables&lt;br /&gt;
&lt;br /&gt;
https://www.dd-wrt.com/wiki/index.php/Firewall&lt;br /&gt;
&lt;br /&gt;
== D-Link ==&lt;br /&gt;
&lt;br /&gt;
On some D-Link devices, the port forwarding feature allows for the options: TCP, UDP and Other. The &amp;quot;Other&amp;quot; option on these models are capable of Destination NAT of IPENCAP packets.&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4) &#039;&#039;&#039;Note: this rule is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In Port Forwarding&lt;br /&gt;
&lt;br /&gt;
 # Create a new Port Forward&lt;br /&gt;
 # Enter the LAN IP of your AMPR node&lt;br /&gt;
 # Select &amp;quot;Other&amp;quot;&lt;br /&gt;
 # Type the number &#039;&#039;&#039;4&#039;&#039;&#039; into the field&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== iptables ==&lt;br /&gt;
&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS IP TRAFFIC THAT&#039;S INVALID ENTERING OR EXITING AMPR&lt;br /&gt;
 # THIS PREVENTS A GENERAL LOOP&lt;br /&gt;
 iptables -I FORWARD -i tunl0 -o tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND IPs NOT FROM YOUR ALLOCATION (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING ! -s 44.xxx.xxx.xxx/xx -i br-amprnet -j DROP&lt;br /&gt;
 # DROPS ROGUE INBOUND ASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 44.xxx.xxx.xxx/xx -i tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND UNASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 # YOU MUST ADD A RULE UNDER THIS LINE TO MAKE EXCEPTIONS (BCP 38)&lt;br /&gt;
 iptables -I FORWARD ! -s 44.xxx.xxx.xxx/xx -o tunl0 -j DROP&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS BOGONS ENTERING AMPRNet&lt;br /&gt;
 # SEE http://www.team-cymru.org/Services/Bogons/bogon-bn-nonagg.txt&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 0.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 10.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 100.64.0.0/10 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 127.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 169.254.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 172.16.0.0/12 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.0.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.2.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.168.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.18.0.0/15 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.51.100.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 203.0.113.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 224.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 240.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # THIS PREVENTS NESTED IPENCAP (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING -p 4 -i tunl0 -j DROP&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes (using iptables)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable dynamic filtering of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: this rule (or the static rule below) is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REQUIRED: [[ampr-ripd]] (using the -x and -d arguments), the diff command from the [http://www.gnu.org/software/diffutils/manual/diffutils.html diffutils package] and the [https://www.gnu.org/software/sed/manual/sed.html sed command].&lt;br /&gt;
&lt;br /&gt;
 # Place this rule a the last firewall command&lt;br /&gt;
 # Uncomment sleep command below if the rule does not appear&lt;br /&gt;
 # as load_ipipfilter.sh is still executing&lt;br /&gt;
 # sleep 10&lt;br /&gt;
 # load ipipfilter list rule&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF WAN&amp;gt;&#039;&#039;&#039; -j ipipfilter&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 # by Rob, PE1CHL&lt;br /&gt;
 # load_ipipfilter.sh&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 AMPRGW=&amp;quot;&#039;&#039;&#039;&amp;lt;AMPRGW&amp;gt;&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
 gwfile=&amp;quot;/tmp/gw&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 # Parse encap.txt for Node IPs and place in /tmp/gw&lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u &amp;gt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
 # Run command to create CHAIN, IF no system output, CHAIN was created&lt;br /&gt;
 iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 if [ $? -eq 0 ]&lt;br /&gt;
 &#039;&#039;&#039;# DO NOT PLACE EMPTY LINES BETWEEN THE TWO COMMANDS ABOVE. ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# THE EQUATION ASKS IF THE LAST SYSTEM COMMAND ENTERED ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# RETURNS &amp;quot;NOTHING.&amp;quot; ADDING A SPACE WILL CHANGE RESULTS OF THE IF COMMAND. ###&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 ##The two lines above replace the line below, which does not work on OpenWRT&lt;br /&gt;
 # if iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 ## &lt;br /&gt;
 &lt;br /&gt;
 # IF no system output, THEN flush the CHAIN and add AMPRGW,&lt;br /&gt;
 # add nodes in encap.txt and a final DROP rule&lt;br /&gt;
 then&lt;br /&gt;
     iptables -F ipipfilter&lt;br /&gt;
     iptables -A ipipfilter -s $AMPRGW -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
     while read ip&lt;br /&gt;
     do&lt;br /&gt;
         iptables -A ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
     done &amp;lt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
     iptables -A ipipfilter -j DROP&lt;br /&gt;
 &lt;br /&gt;
 # ELSE, the CHAIN already exists, determine changes&lt;br /&gt;
 # and INSERT new nodes and DELETE old nodes (excluding AMPRGW)&lt;br /&gt;
 else&lt;br /&gt;
     iptables -L ipipfilter -n | grep ACCEPT | fgrep -v $AMPRGW | \&lt;br /&gt;
         sed -e &#039;s/.*--  //&#039; -e &#039;s/ .*//&#039; | sort | diff - $gwfile | \&lt;br /&gt;
         while read d ip&lt;br /&gt;
         do&lt;br /&gt;
             case &amp;quot;$d&amp;quot; in&lt;br /&gt;
             &amp;quot;&amp;gt;&amp;quot;)&lt;br /&gt;
                 iptables -I ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             &amp;quot;&amp;lt;&amp;quot;)&lt;br /&gt;
                 iptables -D ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             *)&lt;br /&gt;
                 ;;&lt;br /&gt;
             esac&lt;br /&gt;
         done&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 # Delete /tmp/gw when done&lt;br /&gt;
 rm -f $gwfile&lt;br /&gt;
 &lt;br /&gt;
 # The full pathname of this script /usr/local/sbin/load_ipipfilter is passed with the new -x&lt;br /&gt;
 # option to ampr-ripd.   It will load the entire filter the first time, and later it will only update&lt;br /&gt;
 # the filters that have changed.  It is required that the -s option is passed as well, so the&lt;br /&gt;
 # encap.txt file is created by ampr-ripd.&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Static IPENCAP Filtering of AMPR Nodes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: this rule (or the dynamic rule above) is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF YOUR WAN&amp;gt;&#039;&#039;&#039; -j ACCEPT &lt;br /&gt;
&lt;br /&gt;
If your AMPR node is downstream, you will create an INPUT &#039;&#039;&#039;and&#039;&#039;&#039; DNAT forward rule to the destination LAN IP of your AMPR node.&lt;br /&gt;
&lt;br /&gt;
To enable receipt of [[RIP]]44&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p udp -s 44.0.0.1 --sport 520 -d 224.0.0.9 --dport 520 -i tunl0 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Masquerade LAN Subnets to AMPRNet&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this instance, eth1 is your 192.168.1.0/24 LAN&lt;br /&gt;
(thanks to Brian, N1URO)&lt;br /&gt;
&lt;br /&gt;
see: https://n1uro.ampr.org/linuxconf/44nat.html&lt;br /&gt;
&lt;br /&gt;
 # NAT setup&lt;br /&gt;
 iptables -t nat -A POSTROUTING -s 192.168.0/24 -o tunl0 -j MASQUERADE -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -m state --state RELATED,ESTABLISHED -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
&lt;br /&gt;
== ipset ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes (using ipset)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
On OpenWrt, install diffutils and ipset.&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 #on the incoming interface:&lt;br /&gt;
 # iptables -t filter -I INPUT -p 4 -i eth0.2 -m set --set ipipfilter src -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 AMPRGW=&amp;quot;&#039;&#039;&#039;&amp;lt;AMPRGW&amp;gt;&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
 gwfile=&amp;quot;/tmp/gw&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u &amp;gt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
 ipset -N ipipfilter hash:ip 2&amp;gt;/dev/null&lt;br /&gt;
 if [ $? -eq 0 ]&lt;br /&gt;
 then&lt;br /&gt;
     ipset flush ipipfilter&lt;br /&gt;
     ipset -A ipipfilter $AMPRGW&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
     while read ip&lt;br /&gt;
     do&lt;br /&gt;
         ipset -A ipipfilter $ip&lt;br /&gt;
     done &amp;lt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 else&lt;br /&gt;
  ipset flush ipipfilter&lt;br /&gt;
     ipset -A ipipfilter $AMPRGW&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
     while read ip&lt;br /&gt;
     do&lt;br /&gt;
         ipset -A ipipfilter $ip&lt;br /&gt;
     done &amp;lt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 rm -f $gwfile&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Adding IPENCAP Filtering of AMPR Nodes to OpenWrt (using ipset)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 config rule&lt;br /&gt;
 	option target &#039;ACCEPT&#039;&lt;br /&gt;
 	option src &#039;wan&#039;&lt;br /&gt;
 	option family &#039;ipv4&#039;&lt;br /&gt;
 	option proto &#039;4&#039;&lt;br /&gt;
 	option name &#039;Allow-AMPR_IPENCAP&#039;&lt;br /&gt;
 	option extra &#039;-m set --match-set ipipfilter src&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Adding ICMP Filtering of AMPR Nodes to OpenWrt (using ipset)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 config rule&lt;br /&gt;
 	option target &#039;ACCEPT&#039;&lt;br /&gt;
 	option family &#039;ipv4&#039;&lt;br /&gt;
 	option proto &#039;icmp&#039;&lt;br /&gt;
 	list icmp_type &#039;echo-request&#039;&lt;br /&gt;
 	option src &#039;*&#039; &lt;br /&gt;
 	option extra &#039;-m set --match-set ipipfilter src&#039;&lt;br /&gt;
 	option name &#039;Ping_fromIPENCAPS&#039;&lt;br /&gt;
&lt;br /&gt;
== Microtik ==&lt;br /&gt;
&lt;br /&gt;
== OpenWRT ==&lt;br /&gt;
&lt;br /&gt;
See: iptables (above) and the Instructions for [[setting up a gateway on OpenWRT|setting up a gateway on OpenWRT]].&lt;br /&gt;
&lt;br /&gt;
iptables-based rules can be entered in Network &amp;gt; Firewall &amp;gt; Custom Firewall on the LuCI web interface; or via the command prompt via UCI.&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=772</id>
		<title>Firewalls</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=772"/>
		<updated>2018-09-22T00:51:35Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: /* ipset */ add sample OpenWrt rules&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the Firewall Wiki.&lt;br /&gt;
&lt;br /&gt;
NOTE: This page is intended to be edited by the community to add use practices, command syntax, etc. regarding firewalling and security on AMPRNet nodes. While each operator is ultimately responsible for the administration of their node, it is highly suggested amongst the [[44Net mailing list]] Community that nodes be firewalled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: On an iptables-based firewall, you must enable connection tracking on the tunl0 interface in order to enable Stateful Packet Inspection (i.e. a stateful firewall). Since the IPENCAP Linux Kernel Module IPIP is in the kernel, &#039;&#039;&#039;you must set the default forwarding policy to DROP or REJECT.&#039;&#039;&#039; If you set your default routing policy to ACCEPT, all packets that have not been explicitly DROPped or REJECTed elsewhere, will route, regardless of firewall policies.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Cisco ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DD-WRT ==&lt;br /&gt;
&lt;br /&gt;
DD-WRT uses an iptables-based firewall (see iptables below). Custom rules can be entered at Administration &amp;gt; Commands &amp;gt; &amp;quot;Save Firewall&amp;quot;&lt;br /&gt;
&lt;br /&gt;
https://www.dd-wrt.com/wiki/index.php/Iptables&lt;br /&gt;
&lt;br /&gt;
https://www.dd-wrt.com/wiki/index.php/Firewall&lt;br /&gt;
&lt;br /&gt;
== D-Link ==&lt;br /&gt;
&lt;br /&gt;
On some D-Link devices, the port forwarding feature allows for the options: TCP, UDP and Other. The &amp;quot;Other&amp;quot; option on these models are capable of Destination NAT of IPENCAP packets.&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4) &#039;&#039;&#039;Note: this rule is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In Port Forwarding&lt;br /&gt;
&lt;br /&gt;
 # Create a new Port Forward&lt;br /&gt;
 # Enter the LAN IP of your AMPR node&lt;br /&gt;
 # Select &amp;quot;Other&amp;quot;&lt;br /&gt;
 # Type the number &#039;&#039;&#039;4&#039;&#039;&#039; into the field&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== iptables ==&lt;br /&gt;
&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS IP TRAFFIC THAT&#039;S INVALID ENTERING OR EXITING AMPR&lt;br /&gt;
 # THIS PREVENTS A GENERAL LOOP&lt;br /&gt;
 iptables -I FORWARD -i tunl0 -o tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND IPs NOT FROM YOUR ALLOCATION (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING ! -s 44.xxx.xxx.xxx/xx -i br-amprnet -j DROP&lt;br /&gt;
 # DROPS ROGUE INBOUND ASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 44.xxx.xxx.xxx/xx -i tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND UNASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 # YOU MUST ADD A RULE UNDER THIS LINE TO MAKE EXCEPTIONS (BCP 38)&lt;br /&gt;
 iptables -I FORWARD ! -s 44.xxx.xxx.xxx/xx -o tunl0 -j DROP&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS BOGONS ENTERING AMPRNet&lt;br /&gt;
 # SEE http://www.team-cymru.org/Services/Bogons/bogon-bn-nonagg.txt&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 0.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 10.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 100.64.0.0/10 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 127.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 169.254.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 172.16.0.0/12 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.0.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.2.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.168.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.18.0.0/15 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.51.100.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 203.0.113.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 224.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 240.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # THIS PREVENTS NESTED IPENCAP (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING -p 4 -i tunl0 -j DROP&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes (using iptables)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable dynamic filtering of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: this rule (or the static rule below) is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REQUIRED: [[ampr-ripd]] (using the -x and -d arguments), the diff command from the [http://www.gnu.org/software/diffutils/manual/diffutils.html diffutils package] and the [https://www.gnu.org/software/sed/manual/sed.html sed command].&lt;br /&gt;
&lt;br /&gt;
 # Place this rule a the last firewall command&lt;br /&gt;
 # Uncomment sleep command below if the rule does not appear&lt;br /&gt;
 # as load_ipipfilter.sh is still executing&lt;br /&gt;
 # sleep 10&lt;br /&gt;
 # load ipipfilter list rule&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF WAN&amp;gt;&#039;&#039;&#039; -j ipipfilter&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 # by Rob, PE1CHL&lt;br /&gt;
 # load_ipipfilter.sh&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 AMPRGW=&amp;quot;&#039;&#039;&#039;&amp;lt;AMPRGW&amp;gt;&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
 gwfile=&amp;quot;/tmp/gw&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 # Parse encap.txt for Node IPs and place in /tmp/gw&lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u &amp;gt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
 # Run command to create CHAIN, IF no system output, CHAIN was created&lt;br /&gt;
 iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 if [ $? -eq 0 ]&lt;br /&gt;
 &#039;&#039;&#039;# DO NOT PLACE EMPTY LINES BETWEEN THE TWO COMMANDS ABOVE. ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# THE EQUATION ASKS IF THE LAST SYSTEM COMMAND ENTERED ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# RETURNS &amp;quot;NOTHING.&amp;quot; ADDING A SPACE WILL CHANGE RESULTS OF THE IF COMMAND. ###&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 ##The two lines above replace the line below, which does not work on OpenWRT&lt;br /&gt;
 # if iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 ## &lt;br /&gt;
 &lt;br /&gt;
 # IF no system output, THEN flush the CHAIN and add AMPRGW,&lt;br /&gt;
 # add nodes in encap.txt and a final DROP rule&lt;br /&gt;
 then&lt;br /&gt;
     iptables -F ipipfilter&lt;br /&gt;
     iptables -A ipipfilter -s $AMPRGW -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
     while read ip&lt;br /&gt;
     do&lt;br /&gt;
         iptables -A ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
     done &amp;lt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
     iptables -A ipipfilter -j DROP&lt;br /&gt;
 &lt;br /&gt;
 # ELSE, the CHAIN already exists, determine changes&lt;br /&gt;
 # and INSERT new nodes and DELETE old nodes (excluding AMPRGW)&lt;br /&gt;
 else&lt;br /&gt;
     iptables -L ipipfilter -n | grep ACCEPT | fgrep -v $AMPRGW | \&lt;br /&gt;
         sed -e &#039;s/.*--  //&#039; -e &#039;s/ .*//&#039; | sort | diff - $gwfile | \&lt;br /&gt;
         while read d ip&lt;br /&gt;
         do&lt;br /&gt;
             case &amp;quot;$d&amp;quot; in&lt;br /&gt;
             &amp;quot;&amp;gt;&amp;quot;)&lt;br /&gt;
                 iptables -I ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             &amp;quot;&amp;lt;&amp;quot;)&lt;br /&gt;
                 iptables -D ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             *)&lt;br /&gt;
                 ;;&lt;br /&gt;
             esac&lt;br /&gt;
         done&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 # Delete /tmp/gw when done&lt;br /&gt;
 rm -f $gwfile&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Static IPENCAP Filtering of AMPR Nodes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: this rule (or the dynamic rule above) is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF YOUR WAN&amp;gt;&#039;&#039;&#039; -j ACCEPT &lt;br /&gt;
&lt;br /&gt;
If your AMPR node is downstream, you will create an INPUT &#039;&#039;&#039;and&#039;&#039;&#039; DNAT forward rule to the destination LAN IP of your AMPR node.&lt;br /&gt;
&lt;br /&gt;
To enable receipt of [[RIP]]44&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p udp -s 44.0.0.1 --sport 520 -d 224.0.0.9 --dport 520 -i tunl0 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Masquerade LAN Subnets to AMPRNet&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this instance, eth1 is your 192.168.1.0/24 LAN&lt;br /&gt;
(thanks to Brian, N1URO)&lt;br /&gt;
&lt;br /&gt;
see: https://n1uro.ampr.org/linuxconf/44nat.html&lt;br /&gt;
&lt;br /&gt;
 # NAT setup&lt;br /&gt;
 iptables -t nat -A POSTROUTING -s 192.168.0/24 -o tunl0 -j MASQUERADE -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -m state --state RELATED,ESTABLISHED -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
&lt;br /&gt;
== ipset ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes (using ipset)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
On OpenWrt, install diffutils and ipset.&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 #on the incoming interface:&lt;br /&gt;
 # iptables -t filter -I INPUT -p 4 -i eth0.2 -m set --set ipipfilter src -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 AMPRGW=&amp;quot;&#039;&#039;&#039;&amp;lt;AMPRGW&amp;gt;&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
 gwfile=&amp;quot;/tmp/gw&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u &amp;gt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
 ipset -N ipipfilter hash:ip 2&amp;gt;/dev/null&lt;br /&gt;
 if [ $? -eq 0 ]&lt;br /&gt;
 then&lt;br /&gt;
     ipset flush ipipfilter&lt;br /&gt;
     ipset -A ipipfilter $AMPRGW&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
     while read ip&lt;br /&gt;
     do&lt;br /&gt;
         ipset -A ipipfilter $ip&lt;br /&gt;
     done &amp;lt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 else&lt;br /&gt;
  ipset flush ipipfilter&lt;br /&gt;
     ipset -A ipipfilter $AMPRGW&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
     while read ip&lt;br /&gt;
     do&lt;br /&gt;
         ipset -A ipipfilter $ip&lt;br /&gt;
     done &amp;lt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 rm -f $gwfile&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # The full pathname of this script /usr/local/sbin/load_ipipfilter is passed with the new -x&lt;br /&gt;
 # option to ampr-ripd.   It will load the entire filter the first time, and later it will only update&lt;br /&gt;
 # the filters that have changed.  It is required that the -s option is passed as well, so the&lt;br /&gt;
 # encap.txt file is created by ampr-ripd.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Adding IPENCAP Filtering of AMPR Nodes to OpenWrt (using ipset)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 config rule&lt;br /&gt;
 	option target &#039;ACCEPT&#039;&lt;br /&gt;
 	option src &#039;wan&#039;&lt;br /&gt;
 	option family &#039;ipv4&#039;&lt;br /&gt;
 	option proto &#039;4&#039;&lt;br /&gt;
 	option name &#039;Allow-AMPR_IPENCAP&#039;&lt;br /&gt;
 	option extra &#039;-m set --match-set ipipfilter src&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Adding ICMP Filtering of AMPR Nodes to OpenWrt (using ipset)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 config rule&lt;br /&gt;
 	option target &#039;ACCEPT&#039;&lt;br /&gt;
 	option family &#039;ipv4&#039;&lt;br /&gt;
 	option proto &#039;icmp&#039;&lt;br /&gt;
 	list icmp_type &#039;echo-request&#039;&lt;br /&gt;
 	option src &#039;*&#039; &lt;br /&gt;
 	option extra &#039;-m set --match-set ipipfilter src&#039;&lt;br /&gt;
 	option name &#039;Ping_fromIPENCAPS&#039;&lt;br /&gt;
&lt;br /&gt;
== Microtik ==&lt;br /&gt;
&lt;br /&gt;
== OpenWRT ==&lt;br /&gt;
&lt;br /&gt;
See: iptables (above) and the Instructions for [[setting up a gateway on OpenWRT|setting up a gateway on OpenWRT]].&lt;br /&gt;
&lt;br /&gt;
iptables-based rules can be entered in Network &amp;gt; Firewall &amp;gt; Custom Firewall on the LuCI web interface; or via the command prompt via UCI.&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=771</id>
		<title>Firewalls</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=771"/>
		<updated>2018-09-22T00:38:29Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: add ipset script&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the Firewall Wiki.&lt;br /&gt;
&lt;br /&gt;
NOTE: This page is intended to be edited by the community to add use practices, command syntax, etc. regarding firewalling and security on AMPRNet nodes. While each operator is ultimately responsible for the administration of their node, it is highly suggested amongst the [[44Net mailing list]] Community that nodes be firewalled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: On an iptables-based firewall, you must enable connection tracking on the tunl0 interface in order to enable Stateful Packet Inspection (i.e. a stateful firewall). Since the IPENCAP Linux Kernel Module IPIP is in the kernel, &#039;&#039;&#039;you must set the default forwarding policy to DROP or REJECT.&#039;&#039;&#039; If you set your default routing policy to ACCEPT, all packets that have not been explicitly DROPped or REJECTed elsewhere, will route, regardless of firewall policies.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Cisco ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DD-WRT ==&lt;br /&gt;
&lt;br /&gt;
DD-WRT uses an iptables-based firewall (see iptables below). Custom rules can be entered at Administration &amp;gt; Commands &amp;gt; &amp;quot;Save Firewall&amp;quot;&lt;br /&gt;
&lt;br /&gt;
https://www.dd-wrt.com/wiki/index.php/Iptables&lt;br /&gt;
&lt;br /&gt;
https://www.dd-wrt.com/wiki/index.php/Firewall&lt;br /&gt;
&lt;br /&gt;
== D-Link ==&lt;br /&gt;
&lt;br /&gt;
On some D-Link devices, the port forwarding feature allows for the options: TCP, UDP and Other. The &amp;quot;Other&amp;quot; option on these models are capable of Destination NAT of IPENCAP packets.&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4) &#039;&#039;&#039;Note: this rule is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In Port Forwarding&lt;br /&gt;
&lt;br /&gt;
 # Create a new Port Forward&lt;br /&gt;
 # Enter the LAN IP of your AMPR node&lt;br /&gt;
 # Select &amp;quot;Other&amp;quot;&lt;br /&gt;
 # Type the number &#039;&#039;&#039;4&#039;&#039;&#039; into the field&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== iptables ==&lt;br /&gt;
&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS IP TRAFFIC THAT&#039;S INVALID ENTERING OR EXITING AMPR&lt;br /&gt;
 # THIS PREVENTS A GENERAL LOOP&lt;br /&gt;
 iptables -I FORWARD -i tunl0 -o tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND IPs NOT FROM YOUR ALLOCATION (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING ! -s 44.xxx.xxx.xxx/xx -i br-amprnet -j DROP&lt;br /&gt;
 # DROPS ROGUE INBOUND ASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 44.xxx.xxx.xxx/xx -i tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND UNASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 # YOU MUST ADD A RULE UNDER THIS LINE TO MAKE EXCEPTIONS (BCP 38)&lt;br /&gt;
 iptables -I FORWARD ! -s 44.xxx.xxx.xxx/xx -o tunl0 -j DROP&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS BOGONS ENTERING AMPRNet&lt;br /&gt;
 # SEE http://www.team-cymru.org/Services/Bogons/bogon-bn-nonagg.txt&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 0.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 10.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 100.64.0.0/10 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 127.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 169.254.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 172.16.0.0/12 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.0.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.2.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.168.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.18.0.0/15 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.51.100.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 203.0.113.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 224.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 240.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # THIS PREVENTS NESTED IPENCAP (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING -p 4 -i tunl0 -j DROP&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes (using iptables)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable dynamic filtering of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: this rule (or the static rule below) is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REQUIRED: [[ampr-ripd]] (using the -x and -d arguments), the diff command from the [http://www.gnu.org/software/diffutils/manual/diffutils.html diffutils package] and the [https://www.gnu.org/software/sed/manual/sed.html sed command].&lt;br /&gt;
&lt;br /&gt;
 # Place this rule a the last firewall command&lt;br /&gt;
 # Uncomment sleep command below if the rule does not appear&lt;br /&gt;
 # as load_ipipfilter.sh is still executing&lt;br /&gt;
 # sleep 10&lt;br /&gt;
 # load ipipfilter list rule&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF WAN&amp;gt;&#039;&#039;&#039; -j ipipfilter&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 # by Rob, PE1CHL&lt;br /&gt;
 # load_ipipfilter.sh&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 AMPRGW=&amp;quot;&#039;&#039;&#039;&amp;lt;AMPRGW&amp;gt;&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
 gwfile=&amp;quot;/tmp/gw&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 # Parse encap.txt for Node IPs and place in /tmp/gw&lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u &amp;gt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
 # Run command to create CHAIN, IF no system output, CHAIN was created&lt;br /&gt;
 iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 if [ $? -eq 0 ]&lt;br /&gt;
 &#039;&#039;&#039;# DO NOT PLACE EMPTY LINES BETWEEN THE TWO COMMANDS ABOVE. ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# THE EQUATION ASKS IF THE LAST SYSTEM COMMAND ENTERED ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# RETURNS &amp;quot;NOTHING.&amp;quot; ADDING A SPACE WILL CHANGE RESULTS OF THE IF COMMAND. ###&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 ##The two lines above replace the line below, which does not work on OpenWRT&lt;br /&gt;
 # if iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 ## &lt;br /&gt;
 &lt;br /&gt;
 # IF no system output, THEN flush the CHAIN and add AMPRGW,&lt;br /&gt;
 # add nodes in encap.txt and a final DROP rule&lt;br /&gt;
 then&lt;br /&gt;
     iptables -F ipipfilter&lt;br /&gt;
     iptables -A ipipfilter -s $AMPRGW -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
     while read ip&lt;br /&gt;
     do&lt;br /&gt;
         iptables -A ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
     done &amp;lt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
     iptables -A ipipfilter -j DROP&lt;br /&gt;
 &lt;br /&gt;
 # ELSE, the CHAIN already exists, determine changes&lt;br /&gt;
 # and INSERT new nodes and DELETE old nodes (excluding AMPRGW)&lt;br /&gt;
 else&lt;br /&gt;
     iptables -L ipipfilter -n | grep ACCEPT | fgrep -v $AMPRGW | \&lt;br /&gt;
         sed -e &#039;s/.*--  //&#039; -e &#039;s/ .*//&#039; | sort | diff - $gwfile | \&lt;br /&gt;
         while read d ip&lt;br /&gt;
         do&lt;br /&gt;
             case &amp;quot;$d&amp;quot; in&lt;br /&gt;
             &amp;quot;&amp;gt;&amp;quot;)&lt;br /&gt;
                 iptables -I ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             &amp;quot;&amp;lt;&amp;quot;)&lt;br /&gt;
                 iptables -D ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             *)&lt;br /&gt;
                 ;;&lt;br /&gt;
             esac&lt;br /&gt;
         done&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 # Delete /tmp/gw when done&lt;br /&gt;
 rm -f $gwfile&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Static IPENCAP Filtering of AMPR Nodes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: this rule (or the dynamic rule above) is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF YOUR WAN&amp;gt;&#039;&#039;&#039; -j ACCEPT &lt;br /&gt;
&lt;br /&gt;
If your AMPR node is downstream, you will create an INPUT &#039;&#039;&#039;and&#039;&#039;&#039; DNAT forward rule to the destination LAN IP of your AMPR node.&lt;br /&gt;
&lt;br /&gt;
To enable receipt of [[RIP]]44&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p udp -s 44.0.0.1 --sport 520 -d 224.0.0.9 --dport 520 -i tunl0 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Masquerade LAN Subnets to AMPRNet&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this instance, eth1 is your 192.168.1.0/24 LAN&lt;br /&gt;
(thanks to Brian, N1URO)&lt;br /&gt;
&lt;br /&gt;
see: https://n1uro.ampr.org/linuxconf/44nat.html&lt;br /&gt;
&lt;br /&gt;
 # NAT setup&lt;br /&gt;
 iptables -t nat -A POSTROUTING -s 192.168.0/24 -o tunl0 -j MASQUERADE -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -m state --state RELATED,ESTABLISHED -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
&lt;br /&gt;
== ipset ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes (using ipset)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
On OpenWrt, install diffutils and ipset.&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 #on the incoming interface:&lt;br /&gt;
 # iptables -t filter -I INPUT -p 4 -i eth0.2 -m set --set ipipfilter src -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 AMPRGW=&amp;quot;&#039;&#039;&#039;&amp;lt;AMPRGW&amp;gt;&#039;&#039;&#039;&amp;quot;&lt;br /&gt;
 gwfile=&amp;quot;/tmp/gw&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u &amp;gt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
 ipset -N ipipfilter hash:ip 2&amp;gt;/dev/null&lt;br /&gt;
 if [ $? -eq 0 ]&lt;br /&gt;
 then&lt;br /&gt;
     ipset flush ipipfilter&lt;br /&gt;
     ipset -A ipipfilter $AMPRGW&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
     while read ip&lt;br /&gt;
     do&lt;br /&gt;
         ipset -A ipipfilter $ip&lt;br /&gt;
     done &amp;lt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 else&lt;br /&gt;
  ipset flush ipipfilter&lt;br /&gt;
     ipset -A ipipfilter $AMPRGW&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
     while read ip&lt;br /&gt;
     do&lt;br /&gt;
         ipset -A ipipfilter $ip&lt;br /&gt;
     done &amp;lt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 rm -f $gwfile&lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 &lt;br /&gt;
 # The full pathname of this script /usr/local/sbin/load_ipipfilter is passed with the new -x&lt;br /&gt;
 # option to ampr-ripd.   It will load the entire filter the first time, and later it will only update&lt;br /&gt;
 # the filters that have changed.  It is required that the -s option is passed as well, so the&lt;br /&gt;
 # encap.txt file is created by ampr-ripd.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Microtik ==&lt;br /&gt;
&lt;br /&gt;
== OpenWRT ==&lt;br /&gt;
&lt;br /&gt;
See: iptables (above) and the Instructions for [[setting up a gateway on OpenWRT|setting up a gateway on OpenWRT]].&lt;br /&gt;
&lt;br /&gt;
iptables-based rules can be entered in Network &amp;gt; Firewall &amp;gt; Custom Firewall on the LuCI web interface; or via the command prompt via UCI.&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Setting_up_a_gateway_on_OpenWRT&amp;diff=762</id>
		<title>Setting up a gateway on OpenWRT</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Setting_up_a_gateway_on_OpenWRT&amp;diff=762"/>
		<updated>2018-05-03T02:11:33Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: /* Summary */ added inherit tos tags on packets leaving tunnel&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[ampr-ripd]] has been compiled for the AppliedMicro APM82181 and Atheros 71xx router CPUs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: To operate a [[Gateway]] on [[AMPRNet]], you must have a method of obtaining up-to-date route information. On AMPRNet, a variant of [https://en.wikipedia.org/wiki/Routing_Information_Protocol RIP version 2] protocol, named [[RIP]]44 is used. [https://en.wikipedia.org/wiki/Routing_Information_Protocol RIP version 2] is not the same as [[RIP]]44.&#039;&#039;&#039; [[rip44d]] is written in the Perl programming language by Heikki Hannikainen, OH7LZB. [[ampr-ripd]] is written in C by YO2LOJ. The routing table is relatively small, so the performance or memory consumption of this daemon isn&#039;t very critical. [[ampr-ripd]] is used in this instance, so no other prerequisite software is required to run the [[RIP]]44 daemon.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;You must have access to a binary [https://en.wikipedia.org/wiki/Executable executable] of [[ampr-ripd]] that is compatible with the [https://en.wikipedia.org/wiki/Central_processing_unit CPU] in your OpenWRT device (e.g. i386, i586, x86_64, MIPS, PPC, etc.). If you do not, you must [https://en.wikipedia.org/wiki/Compiler compile] ampr-ripd yourself, or install the packages necessary to run [[rip44d]].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;See&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
* [https://openwrt.org/docs/guide-developer/crosscompile Cross Compile - OpenWRT]&lt;br /&gt;
* [https://openwrt.org/docs/start OpenWRT Manual]&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: These instructions assume first that you have been assigned AMPRNet IP address allocations that are properly assigned and configured to your account in the [[Portal]]. Next, that you intend to configure your OpenWRT-based (version 14.07 or greater) AMPRNet [[Gateway]] to be a [https://en.wikipedia.org/wiki/Stateful_firewall stateful firewall] for your AMPRNet allocations (i.e. enabling connection tracking). If you prefer to forward all traffic to your allocated AMPRNet IP addresses, you may follow these instructions; but configure your Firewall Zones to forward all traffic to/from AMPRLAN to AMPRWAN. These instructions configure your AMPRNet Tunnel and AMPRNet Local Interfaces in their own [https://en.wikipedia.org/wiki/Policy-based_routing policy-based routing] sernario; and places all local AMPRNet allocations in the main routing instance (you must provide routing rules for your local AMPR subnets to reach local subnets, if you desire). Since the OpenWRT Kernel is aware that your AMPRNet allocations exist locally (and are populated on the MAIN ROUTING TABLE), you must provide routing rules for AMPRLAN to reach these local subnets, or omit those rules (not permitting your AMPRLAN to route to your local subnets). Lastly, it assumes that the user can navigate the default OpenWRT LuCI web-based graphical user interface locally (and that they are using a device capable of having the package installed), are familiar with the [https://en.wikipedia.org/wiki/Chmod chmod] command, and/or familiar with entering OpenWRT UCI (Unified Configuration Interface) commands by serial console or SSH.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Install:&lt;br /&gt;
&lt;br /&gt;
* kmod-ipip&lt;br /&gt;
* ip-full&lt;br /&gt;
* libstdcpp&lt;br /&gt;
* [[ampr-ripd]] to &#039;&#039;&#039;/etc/config/&#039;&#039;&#039; (always run [[RIP]]44 software in console mode FIRST after installation to verify execution and obtain the password, the execution of the file is commented-out below)&lt;br /&gt;
* diffutils (optional for dynamic IP filtering)&lt;br /&gt;
* (optional) dynamic firewall script to /etc/config/load_ipipfilter.sh (see the iptables section of the [[Firewalls]] wiki)&lt;br /&gt;
* the following to &#039;&#039;&#039;System &amp;gt; Startup &amp;gt; Local Startup:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ip tunnel add tunl0&lt;br /&gt;
 ip tunnel change tunl0 mode ipip ttl 64 tos inherit pmtudisc&lt;br /&gt;
 ip link set tunl0 mtu 1480 up&lt;br /&gt;
 &#039;&#039;&#039;# This directory is not persistent on OpenWRT, it must be made on boot for dynamic filtering&lt;br /&gt;
 mkdir /var/lib/ampr-ripd&lt;br /&gt;
 # A blank bootstrap file must be created at /etc/config/encap.txt for this to work&lt;br /&gt;
 # Running &#039;&#039;&#039;touch /etc/config/encap.txt&#039;&#039;&#039; once can create it&lt;br /&gt;
 # after which, you may run ampr-ripd to populate it&lt;br /&gt;
 ln -s /etc/config/encap.txt /tmp/lib/ampr-ripd/encap.txt&lt;br /&gt;
 # Dynamic filter, script executed by -x argument&lt;br /&gt;
 # Dynamic filter, -s argument creates encap.txt&lt;br /&gt;
 &#039;&#039;&#039;# ./etc/config/ampr-ripd -p &amp;lt;PASSWORD&amp;gt; -s -t 44 -a &amp;lt;44.xxx.xxx.xxx/xx&amp;gt; -x ./etc/config/load_ipipfilter.sh &amp;amp;&#039;&#039;&#039;&lt;br /&gt;
 ## Allows traceroute to respond using 44net IP of tunl0 or br-amprlan ##&lt;br /&gt;
 echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_errors_use_inbound_ifaddr&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;UPDATE 2018 (routes and rules have been added to the UCI):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # add IP Route to /etc/config/network&lt;br /&gt;
 &lt;br /&gt;
 config route&lt;br /&gt;
 	option interface &#039;amprwan&#039;&lt;br /&gt;
 	option target &#039;0.0.0.0&#039;&lt;br /&gt;
 	option netmask &#039;0.0.0.0&#039;&lt;br /&gt;
 	option gateway &#039;&#039;&#039;&#039;&amp;lt;AMPRGW&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
 	option onlink &#039;1&#039;&lt;br /&gt;
 	option table &#039;44&#039;&lt;br /&gt;
&lt;br /&gt;
 # add IP Rules to /etc/config/network&lt;br /&gt;
 &lt;br /&gt;
 #OPTIONAL AMPR TO LAN RULES (NUMBER 22-2X ACCORDINGLY)&lt;br /&gt;
 config rule&lt;br /&gt;
 	option src &#039;44.xxx.xxx.0/24&#039;&lt;br /&gt;
 	option dest &#039;192.168.xxx.0/24&#039;&lt;br /&gt;
 	option priority &#039;22&#039;&lt;br /&gt;
 	option lookup &#039;main&#039;&lt;br /&gt;
 &lt;br /&gt;
 #ADD A MAIN RULE FOR EVERY LOCAL AMPR SUBNET, RENUMBER 44-4X ACCORDINGLY)&lt;br /&gt;
 config rule&lt;br /&gt;
 	option dest &#039;44.xxx.xxx.0/24&#039;&lt;br /&gt;
 	option priority &#039;44&#039;&lt;br /&gt;
 	option lookup &#039;main&#039;&lt;br /&gt;
 &lt;br /&gt;
 ### This ensures all traffic received on tunl0 uses table 44&lt;br /&gt;
 config rule&lt;br /&gt;
 	option in &#039;amprwan&#039;&lt;br /&gt;
 	option dest &#039;0.0.0.0/0&#039;&lt;br /&gt;
 	option priority &#039;45&#039;&lt;br /&gt;
 	option lookup &#039;44&#039;&lt;br /&gt;
 &lt;br /&gt;
 ###Add this after you create the AMPRLAN bridge, this ensures all traffic from AMPRLAN uses table 44&lt;br /&gt;
 config rule&lt;br /&gt;
 	option in &#039;amprnet&#039;&lt;br /&gt;
 	option dest &#039;0.0.0.0/0&#039;&lt;br /&gt;
 	option priority &#039;46&#039;&lt;br /&gt;
 	option lookup &#039;44&#039;&lt;br /&gt;
 &lt;br /&gt;
 ### You must add an IP rule for all 44net IPs residing on the device&lt;br /&gt;
 config rule&lt;br /&gt;
 	option src &#039;44.xxx.xxx.0/24&lt;br /&gt;
 	option priority &#039;47&#039;&lt;br /&gt;
 	option lookup &#039;44&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;reboot&#039;&#039;&#039;&lt;br /&gt;
* create an unmanaged Interface instance for tunl0 (&#039;&#039;&#039;AMPRWAN&#039;&#039;&#039;) &#039;&#039;&#039;(set to not bring up on boot)&#039;&#039;&#039;, adding it to its own firewall zone &#039;&#039;&#039;amprwan&#039;&#039;&#039; using Input: Drop (or Reject), Output: Drop (or Reject) and Forward: Drop (or Reject). &#039;&#039;&#039;(OpenWRT 14.07 or lower - Be sure to enable connection tracking if you will not masquerade)&#039;&#039;&#039;&lt;br /&gt;
* an interface instance for a new VLAN and bridge (the example above uses AMPRNET), add it to its own firewall zone using Input: Accept (if you wish for you AMPRLAN devices to reach the router), Output: Accept and Forward: Drop (or Reject). &#039;&#039;&#039;Assign an IP from your allocation to this interface, you will configure this IP on your devices as the Default Route/Gateway address.&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;reboot&#039;&#039;&#039;&lt;br /&gt;
* Permit forwarding from AMPRLAN to AMPRWAN and WAN (you must masquerade this traffic when using WAN)&lt;br /&gt;
* Permit forwarding from LAN to AMPRLAN (as desired, NOTE: you must make an IP Rule for the AMPRLAN to use the LAN&#039;s route on the Main Routing Table)&lt;br /&gt;
* Create Traffic Input rule to allow IPv4 IPENCAP (IP protocol type 4) from Any IP on WAN to any IP on Router (or specify WAN IP if statically assigned)&lt;br /&gt;
* Create Traffic Input rule to allow IPv4 udp/520 from 44.0.0.1 in AMPRWAN to 224.0.0.9 at port udp/520 IP on Router&lt;br /&gt;
* Create Traffic Forward rules for any inbound services (as desired)&lt;br /&gt;
* the VLAN to any switch/trunk ports (as desired)&lt;br /&gt;
* make ampr-ripd and load_ipipfilter.sh executable using &#039;&#039;&#039;chmod +x&#039;&#039;&#039;&lt;br /&gt;
* test ampr-ripd in console using the &#039;&#039;&#039;-d&#039;&#039;&#039; argument&lt;br /&gt;
* add password to the &#039;&#039;&#039;Local Startup&#039;&#039;&#039; entry and uncomment ampr-ripd line&lt;br /&gt;
* &#039;&#039;&#039;reboot&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Setting_up_a_gateway_on_OpenWRT&amp;diff=761</id>
		<title>Setting up a gateway on OpenWRT</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Setting_up_a_gateway_on_OpenWRT&amp;diff=761"/>
		<updated>2018-05-01T21:18:04Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: /* See */ updated OpenWRT crosscompile link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[ampr-ripd]] has been compiled for the AppliedMicro APM82181 and Atheros 71xx router CPUs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: To operate a [[Gateway]] on [[AMPRNet]], you must have a method of obtaining up-to-date route information. On AMPRNet, a variant of [https://en.wikipedia.org/wiki/Routing_Information_Protocol RIP version 2] protocol, named [[RIP]]44 is used. [https://en.wikipedia.org/wiki/Routing_Information_Protocol RIP version 2] is not the same as [[RIP]]44.&#039;&#039;&#039; [[rip44d]] is written in the Perl programming language by Heikki Hannikainen, OH7LZB. [[ampr-ripd]] is written in C by YO2LOJ. The routing table is relatively small, so the performance or memory consumption of this daemon isn&#039;t very critical. [[ampr-ripd]] is used in this instance, so no other prerequisite software is required to run the [[RIP]]44 daemon.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;You must have access to a binary [https://en.wikipedia.org/wiki/Executable executable] of [[ampr-ripd]] that is compatible with the [https://en.wikipedia.org/wiki/Central_processing_unit CPU] in your OpenWRT device (e.g. i386, i586, x86_64, MIPS, PPC, etc.). If you do not, you must [https://en.wikipedia.org/wiki/Compiler compile] ampr-ripd yourself, or install the packages necessary to run [[rip44d]].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;See&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
* [https://openwrt.org/docs/guide-developer/crosscompile Cross Compile - OpenWRT]&lt;br /&gt;
* [https://openwrt.org/docs/start OpenWRT Manual]&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: These instructions assume first that you have been assigned AMPRNet IP address allocations that are properly assigned and configured to your account in the [[Portal]]. Next, that you intend to configure your OpenWRT-based (version 14.07 or greater) AMPRNet [[Gateway]] to be a [https://en.wikipedia.org/wiki/Stateful_firewall stateful firewall] for your AMPRNet allocations (i.e. enabling connection tracking). If you prefer to forward all traffic to your allocated AMPRNet IP addresses, you may follow these instructions; but configure your Firewall Zones to forward all traffic to/from AMPRLAN to AMPRWAN. These instructions configure your AMPRNet Tunnel and AMPRNet Local Interfaces in their own [https://en.wikipedia.org/wiki/Policy-based_routing policy-based routing] sernario; and places all local AMPRNet allocations in the main routing instance (you must provide routing rules for your local AMPR subnets to reach local subnets, if you desire). Since the OpenWRT Kernel is aware that your AMPRNet allocations exist locally (and are populated on the MAIN ROUTING TABLE), you must provide routing rules for AMPRLAN to reach these local subnets, or omit those rules (not permitting your AMPRLAN to route to your local subnets). Lastly, it assumes that the user can navigate the default OpenWRT LuCI web-based graphical user interface locally (and that they are using a device capable of having the package installed), are familiar with the [https://en.wikipedia.org/wiki/Chmod chmod] command, and/or familiar with entering OpenWRT UCI (Unified Configuration Interface) commands by serial console or SSH.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Install:&lt;br /&gt;
&lt;br /&gt;
* kmod-ipip&lt;br /&gt;
* ip-full&lt;br /&gt;
* libstdcpp&lt;br /&gt;
* [[ampr-ripd]] to &#039;&#039;&#039;/etc/config/&#039;&#039;&#039; (always run [[RIP]]44 software in console mode FIRST after installation to verify execution and obtain the password, the execution of the file is commented-out below)&lt;br /&gt;
* diffutils (optional for dynamic IP filtering)&lt;br /&gt;
* (optional) dynamic firewall script to /etc/config/load_ipipfilter.sh (see the iptables section of the [[Firewalls]] wiki)&lt;br /&gt;
* the following to &#039;&#039;&#039;System &amp;gt; Startup &amp;gt; Local Startup:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ip tunnel add tunl0&lt;br /&gt;
 ip tunnel change tunl0 mode ipip ttl 64 pmtudisc&lt;br /&gt;
 ip link set tunl0 mtu 1480 up&lt;br /&gt;
 &#039;&#039;&#039;# This directory is not persistent on OpenWRT, it must be made on boot for dynamic filtering&lt;br /&gt;
 mkdir /var/lib/ampr-ripd&lt;br /&gt;
 # A blank bootstrap file must be created at /etc/config/encap.txt for this to work&lt;br /&gt;
 # Running &#039;&#039;&#039;touch /etc/config/encap.txt&#039;&#039;&#039; once can create it&lt;br /&gt;
 # after which, you may run ampr-ripd to populate it&lt;br /&gt;
 ln -s /etc/config/encap.txt /tmp/lib/ampr-ripd/encap.txt&lt;br /&gt;
 # Dynamic filter, script executed by -x argument&lt;br /&gt;
 # Dynamic filter, -s argument creates encap.txt&lt;br /&gt;
 &#039;&#039;&#039;# ./etc/config/ampr-ripd -p &amp;lt;PASSWORD&amp;gt; -s -t 44 -a &amp;lt;44.xxx.xxx.xxx/xx&amp;gt; -x ./etc/config/load_ipipfilter.sh &amp;amp;&#039;&#039;&#039;&lt;br /&gt;
 ## Allows traceroute to respond using 44net IP of tunl0 or br-amprlan ##&lt;br /&gt;
 echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_errors_use_inbound_ifaddr&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;UPDATE 2018 (routes and rules have been added to the UCI):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # add IP Route to /etc/config/network&lt;br /&gt;
 &lt;br /&gt;
 config route&lt;br /&gt;
 	option interface &#039;amprwan&#039;&lt;br /&gt;
 	option target &#039;0.0.0.0&#039;&lt;br /&gt;
 	option netmask &#039;0.0.0.0&#039;&lt;br /&gt;
 	option gateway &#039;&#039;&#039;&#039;&amp;lt;AMPRGW&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
 	option onlink &#039;1&#039;&lt;br /&gt;
 	option table &#039;44&#039;&lt;br /&gt;
&lt;br /&gt;
 # add IP Rules to /etc/config/network&lt;br /&gt;
 &lt;br /&gt;
 #OPTIONAL AMPR TO LAN RULES (NUMBER 22-2X ACCORDINGLY)&lt;br /&gt;
 config rule&lt;br /&gt;
 	option src &#039;44.xxx.xxx.0/24&#039;&lt;br /&gt;
 	option dest &#039;192.168.xxx.0/24&#039;&lt;br /&gt;
 	option priority &#039;22&#039;&lt;br /&gt;
 	option lookup &#039;main&#039;&lt;br /&gt;
 &lt;br /&gt;
 #ADD A MAIN RULE FOR EVERY LOCAL AMPR SUBNET, RENUMBER 44-4X ACCORDINGLY)&lt;br /&gt;
 config rule&lt;br /&gt;
 	option dest &#039;44.xxx.xxx.0/24&#039;&lt;br /&gt;
 	option priority &#039;44&#039;&lt;br /&gt;
 	option lookup &#039;main&#039;&lt;br /&gt;
 &lt;br /&gt;
 ### This ensures all traffic received on tunl0 uses table 44&lt;br /&gt;
 config rule&lt;br /&gt;
 	option in &#039;amprwan&#039;&lt;br /&gt;
 	option dest &#039;0.0.0.0/0&#039;&lt;br /&gt;
 	option priority &#039;45&#039;&lt;br /&gt;
 	option lookup &#039;44&#039;&lt;br /&gt;
 &lt;br /&gt;
 ###Add this after you create the AMPRLAN bridge, this ensures all traffic from AMPRLAN uses table 44&lt;br /&gt;
 config rule&lt;br /&gt;
 	option in &#039;amprnet&#039;&lt;br /&gt;
 	option dest &#039;0.0.0.0/0&#039;&lt;br /&gt;
 	option priority &#039;46&#039;&lt;br /&gt;
 	option lookup &#039;44&#039;&lt;br /&gt;
 &lt;br /&gt;
 ### You must add an IP rule for all 44net IPs residing on the device&lt;br /&gt;
 config rule&lt;br /&gt;
 	option src &#039;44.xxx.xxx.0/24&lt;br /&gt;
 	option priority &#039;47&#039;&lt;br /&gt;
 	option lookup &#039;44&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;reboot&#039;&#039;&#039;&lt;br /&gt;
* create an unmanaged Interface instance for tunl0 (&#039;&#039;&#039;AMPRWAN&#039;&#039;&#039;) &#039;&#039;&#039;(set to not bring up on boot)&#039;&#039;&#039;, adding it to its own firewall zone &#039;&#039;&#039;amprwan&#039;&#039;&#039; using Input: Drop (or Reject), Output: Drop (or Reject) and Forward: Drop (or Reject). &#039;&#039;&#039;(OpenWRT 14.07 or lower - Be sure to enable connection tracking if you will not masquerade)&#039;&#039;&#039;&lt;br /&gt;
* an interface instance for a new VLAN and bridge (the example above uses AMPRNET), add it to its own firewall zone using Input: Accept (if you wish for you AMPRLAN devices to reach the router), Output: Accept and Forward: Drop (or Reject). &#039;&#039;&#039;Assign an IP from your allocation to this interface, you will configure this IP on your devices as the Default Route/Gateway address.&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;reboot&#039;&#039;&#039;&lt;br /&gt;
* Permit forwarding from AMPRLAN to AMPRWAN and WAN (you must masquerade this traffic when using WAN)&lt;br /&gt;
* Permit forwarding from LAN to AMPRLAN (as desired, NOTE: you must make an IP Rule for the AMPRLAN to use the LAN&#039;s route on the Main Routing Table)&lt;br /&gt;
* Create Traffic Input rule to allow IPv4 IPENCAP (IP protocol type 4) from Any IP on WAN to any IP on Router (or specify WAN IP if statically assigned)&lt;br /&gt;
* Create Traffic Input rule to allow IPv4 udp/520 from 44.0.0.1 in AMPRWAN to 224.0.0.9 at port udp/520 IP on Router&lt;br /&gt;
* Create Traffic Forward rules for any inbound services (as desired)&lt;br /&gt;
* the VLAN to any switch/trunk ports (as desired)&lt;br /&gt;
* make ampr-ripd and load_ipipfilter.sh executable using &#039;&#039;&#039;chmod +x&#039;&#039;&#039;&lt;br /&gt;
* test ampr-ripd in console using the &#039;&#039;&#039;-d&#039;&#039;&#039; argument&lt;br /&gt;
* add password to the &#039;&#039;&#039;Local Startup&#039;&#039;&#039; entry and uncomment ampr-ripd line&lt;br /&gt;
* &#039;&#039;&#039;reboot&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Setting_up_a_gateway_on_OpenWRT&amp;diff=760</id>
		<title>Setting up a gateway on OpenWRT</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Setting_up_a_gateway_on_OpenWRT&amp;diff=760"/>
		<updated>2018-05-01T15:35:25Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: Updated link to OpenWRT manual. Moved IP rules and IP routes to the OpenWRT Unified Configuration Interface (UCI) system. Also changed Virtual Routing and Forwarding terminology to policy-based routing to be more accurate.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[ampr-ripd]] has been compiled for the AppliedMicro APM82181 and Atheros 71xx router CPUs&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: To operate a [[Gateway]] on [[AMPRNet]], you must have a method of obtaining up-to-date route information. On AMPRNet, a variant of [https://en.wikipedia.org/wiki/Routing_Information_Protocol RIP version 2] protocol, named [[RIP]]44 is used. [https://en.wikipedia.org/wiki/Routing_Information_Protocol RIP version 2] is not the same as [[RIP]]44.&#039;&#039;&#039; [[rip44d]] is written in the Perl programming language by Heikki Hannikainen, OH7LZB. [[ampr-ripd]] is written in C by YO2LOJ. The routing table is relatively small, so the performance or memory consumption of this daemon isn&#039;t very critical. [[ampr-ripd]] is used in this instance, so no other prerequisite software is required to run the [[RIP]]44 daemon.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;You must have access to a binary [https://en.wikipedia.org/wiki/Executable executable] of [[ampr-ripd]] that is compatible with the [https://en.wikipedia.org/wiki/Central_processing_unit CPU] in your OpenWRT device (e.g. i386, i586, x86_64, MIPS, PPC, etc.). If you do not, you must [https://en.wikipedia.org/wiki/Compiler compile] ampr-ripd yourself, or install the packages necessary to run [[rip44d]].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;See&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
* [http://wiki.openwrt.org/doc/devel/crosscompile Cross Compile - OpenWRT]&lt;br /&gt;
* [https://openwrt.org/docs/start OpenWRT Manual]&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: These instructions assume first that you have been assigned AMPRNet IP address allocations that are properly assigned and configured to your account in the [[Portal]]. Next, that you intend to configure your OpenWRT-based (version 14.07 or greater) AMPRNet [[Gateway]] to be a [https://en.wikipedia.org/wiki/Stateful_firewall stateful firewall] for your AMPRNet allocations (i.e. enabling connection tracking). If you prefer to forward all traffic to your allocated AMPRNet IP addresses, you may follow these instructions; but configure your Firewall Zones to forward all traffic to/from AMPRLAN to AMPRWAN. These instructions configure your AMPRNet Tunnel and AMPRNet Local Interfaces in their own [https://en.wikipedia.org/wiki/Policy-based_routing policy-based routing] sernario; and places all local AMPRNet allocations in the main routing instance (you must provide routing rules for your local AMPR subnets to reach local subnets, if you desire). Since the OpenWRT Kernel is aware that your AMPRNet allocations exist locally (and are populated on the MAIN ROUTING TABLE), you must provide routing rules for AMPRLAN to reach these local subnets, or omit those rules (not permitting your AMPRLAN to route to your local subnets). Lastly, it assumes that the user can navigate the default OpenWRT LuCI web-based graphical user interface locally (and that they are using a device capable of having the package installed), are familiar with the [https://en.wikipedia.org/wiki/Chmod chmod] command, and/or familiar with entering OpenWRT UCI (Unified Configuration Interface) commands by serial console or SSH.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Install:&lt;br /&gt;
&lt;br /&gt;
* kmod-ipip&lt;br /&gt;
* ip-full&lt;br /&gt;
* libstdcpp&lt;br /&gt;
* [[ampr-ripd]] to &#039;&#039;&#039;/etc/config/&#039;&#039;&#039; (always run [[RIP]]44 software in console mode FIRST after installation to verify execution and obtain the password, the execution of the file is commented-out below)&lt;br /&gt;
* diffutils (optional for dynamic IP filtering)&lt;br /&gt;
* (optional) dynamic firewall script to /etc/config/load_ipipfilter.sh (see the iptables section of the [[Firewalls]] wiki)&lt;br /&gt;
* the following to &#039;&#039;&#039;System &amp;gt; Startup &amp;gt; Local Startup:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ip tunnel add tunl0&lt;br /&gt;
 ip tunnel change tunl0 mode ipip ttl 64 pmtudisc&lt;br /&gt;
 ip link set tunl0 mtu 1480 up&lt;br /&gt;
 &#039;&#039;&#039;# This directory is not persistent on OpenWRT, it must be made on boot for dynamic filtering&lt;br /&gt;
 mkdir /var/lib/ampr-ripd&lt;br /&gt;
 # A blank bootstrap file must be created at /etc/config/encap.txt for this to work&lt;br /&gt;
 # Running &#039;&#039;&#039;touch /etc/config/encap.txt&#039;&#039;&#039; once can create it&lt;br /&gt;
 # after which, you may run ampr-ripd to populate it&lt;br /&gt;
 ln -s /etc/config/encap.txt /tmp/lib/ampr-ripd/encap.txt&lt;br /&gt;
 # Dynamic filter, script executed by -x argument&lt;br /&gt;
 # Dynamic filter, -s argument creates encap.txt&lt;br /&gt;
 &#039;&#039;&#039;# ./etc/config/ampr-ripd -p &amp;lt;PASSWORD&amp;gt; -s -t 44 -a &amp;lt;44.xxx.xxx.xxx/xx&amp;gt; -x ./etc/config/load_ipipfilter.sh &amp;amp;&#039;&#039;&#039;&lt;br /&gt;
 ## Allows traceroute to respond using 44net IP of tunl0 or br-amprlan ##&lt;br /&gt;
 echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_errors_use_inbound_ifaddr&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;UPDATE 2018 (routes and rules have been added to the UCI):&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 # add IP Route to /etc/config/network&lt;br /&gt;
 &lt;br /&gt;
 config route&lt;br /&gt;
 	option interface &#039;amprwan&#039;&lt;br /&gt;
 	option target &#039;0.0.0.0&#039;&lt;br /&gt;
 	option netmask &#039;0.0.0.0&#039;&lt;br /&gt;
 	option gateway &#039;&#039;&#039;&#039;&amp;lt;AMPRGW&amp;gt;&#039;&#039;&#039;&#039;&lt;br /&gt;
 	option onlink &#039;1&#039;&lt;br /&gt;
 	option table &#039;44&#039;&lt;br /&gt;
&lt;br /&gt;
 # add IP Rules to /etc/config/network&lt;br /&gt;
 &lt;br /&gt;
 #OPTIONAL AMPR TO LAN RULES (NUMBER 22-2X ACCORDINGLY)&lt;br /&gt;
 config rule&lt;br /&gt;
 	option src &#039;44.xxx.xxx.0/24&#039;&lt;br /&gt;
 	option dest &#039;192.168.xxx.0/24&#039;&lt;br /&gt;
 	option priority &#039;22&#039;&lt;br /&gt;
 	option lookup &#039;main&#039;&lt;br /&gt;
 &lt;br /&gt;
 #ADD A MAIN RULE FOR EVERY LOCAL AMPR SUBNET, RENUMBER 44-4X ACCORDINGLY)&lt;br /&gt;
 config rule&lt;br /&gt;
 	option dest &#039;44.xxx.xxx.0/24&#039;&lt;br /&gt;
 	option priority &#039;44&#039;&lt;br /&gt;
 	option lookup &#039;main&#039;&lt;br /&gt;
 &lt;br /&gt;
 ### This ensures all traffic received on tunl0 uses table 44&lt;br /&gt;
 config rule&lt;br /&gt;
 	option in &#039;amprwan&#039;&lt;br /&gt;
 	option dest &#039;0.0.0.0/0&#039;&lt;br /&gt;
 	option priority &#039;45&#039;&lt;br /&gt;
 	option lookup &#039;44&#039;&lt;br /&gt;
 &lt;br /&gt;
 ###Add this after you create the AMPRLAN bridge, this ensures all traffic from AMPRLAN uses table 44&lt;br /&gt;
 config rule&lt;br /&gt;
 	option in &#039;amprnet&#039;&lt;br /&gt;
 	option dest &#039;0.0.0.0/0&#039;&lt;br /&gt;
 	option priority &#039;46&#039;&lt;br /&gt;
 	option lookup &#039;44&#039;&lt;br /&gt;
 &lt;br /&gt;
 ### You must add an IP rule for all 44net IPs residing on the device&lt;br /&gt;
 config rule&lt;br /&gt;
 	option src &#039;44.xxx.xxx.0/24&lt;br /&gt;
 	option priority &#039;47&#039;&lt;br /&gt;
 	option lookup &#039;44&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;reboot&#039;&#039;&#039;&lt;br /&gt;
* create an unmanaged Interface instance for tunl0 (&#039;&#039;&#039;AMPRWAN&#039;&#039;&#039;) &#039;&#039;&#039;(set to not bring up on boot)&#039;&#039;&#039;, adding it to its own firewall zone &#039;&#039;&#039;amprwan&#039;&#039;&#039; using Input: Drop (or Reject), Output: Drop (or Reject) and Forward: Drop (or Reject). &#039;&#039;&#039;(OpenWRT 14.07 or lower - Be sure to enable connection tracking if you will not masquerade)&#039;&#039;&#039;&lt;br /&gt;
* an interface instance for a new VLAN and bridge (the example above uses AMPRNET), add it to its own firewall zone using Input: Accept (if you wish for you AMPRLAN devices to reach the router), Output: Accept and Forward: Drop (or Reject). &#039;&#039;&#039;Assign an IP from your allocation to this interface, you will configure this IP on your devices as the Default Route/Gateway address.&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;reboot&#039;&#039;&#039;&lt;br /&gt;
* Permit forwarding from AMPRLAN to AMPRWAN and WAN (you must masquerade this traffic when using WAN)&lt;br /&gt;
* Permit forwarding from LAN to AMPRLAN (as desired, NOTE: you must make an IP Rule for the AMPRLAN to use the LAN&#039;s route on the Main Routing Table)&lt;br /&gt;
* Create Traffic Input rule to allow IPv4 IPENCAP (IP protocol type 4) from Any IP on WAN to any IP on Router (or specify WAN IP if statically assigned)&lt;br /&gt;
* Create Traffic Input rule to allow IPv4 udp/520 from 44.0.0.1 in AMPRWAN to 224.0.0.9 at port udp/520 IP on Router&lt;br /&gt;
* Create Traffic Forward rules for any inbound services (as desired)&lt;br /&gt;
* the VLAN to any switch/trunk ports (as desired)&lt;br /&gt;
* make ampr-ripd and load_ipipfilter.sh executable using &#039;&#039;&#039;chmod +x&#039;&#039;&#039;&lt;br /&gt;
* test ampr-ripd in console using the &#039;&#039;&#039;-d&#039;&#039;&#039; argument&lt;br /&gt;
* add password to the &#039;&#039;&#039;Local Startup&#039;&#039;&#039; entry and uncomment ampr-ripd line&lt;br /&gt;
* &#039;&#039;&#039;reboot&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Setting_up_a_gateway_on_OpenWRT&amp;diff=757</id>
		<title>Setting up a gateway on OpenWRT</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Setting_up_a_gateway_on_OpenWRT&amp;diff=757"/>
		<updated>2018-01-31T00:58:43Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: /* Summary */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[ampr-ripd]] has been compiled for Atheros 71xx&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: To operate a [[Gateway]] on [[AMPRNet]], you must have a method of obtaining up-to-date route information. On AMPRNet, a variant of [https://en.wikipedia.org/wiki/Routing_Information_Protocol RIP version 2] protocol, named [[RIP]]44 is used. [https://en.wikipedia.org/wiki/Routing_Information_Protocol RIP version 2] is not the same as [[RIP]]44.&#039;&#039;&#039; [[rip44d]] is written in the Perl programming language by Heikki Hannikainen, OH7LZB. [[ampr-ripd]] is written in C by YO2LOJ. The routing table is relatively small, so the performance or memory consumption of this daemon isn&#039;t very critical. [[ampr-ripd]] is used in this instance, so no other prerequisite software is required to run the [[RIP]]44 daemon.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;You must have access to a binary [https://en.wikipedia.org/wiki/Executable executable] of [[ampr-ripd]] that is compatible with the [https://en.wikipedia.org/wiki/Central_processing_unit CPU] in your OpenWRT device (e.g. i386, i586, x86_64, MIPS, PPC, etc.). If you do not, you must [https://en.wikipedia.org/wiki/Compiler compile] ampr-ripd yourself, or install the packages necessary to run [[rip44d]].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== &#039;&#039;&#039;See&#039;&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
* [http://wiki.openwrt.org/doc/devel/crosscompile Cross Compile - OpenWRT]&lt;br /&gt;
* [http://wiki.openwrt.org/start OpenWRT Manual]&lt;br /&gt;
&lt;br /&gt;
== Summary ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: These instructions assume first that you have been assigned AMPRNet IP address allocations that are properly assigned and configured to your account in the [[Portal]]. Next, that you intend to configure your OpenWRT-based (version 14.07 or greater) AMPRNet [[Gateway]] to be a [https://en.wikipedia.org/wiki/Stateful_firewall stateful firewall] for your AMPRNet allocations (i.e. enabling connection tracking). If you prefer to forward all traffic to your allocated AMPRNet IP addresses, you may follow these instructions; but configure your Firewall Zones to forward all traffic to/from AMPRLAN to AMPRWAN. These instructions configure your AMPRNet Tunnel and AMPRNet Local Interfaces in their own [https://en.wikipedia.org/wiki/Virtual_routing_and_forwarding virtual routing and forwarding] instance; and places all local AMPRNet allocations in the main routing instance (you must provide routing rules for your local AMPR subnets to reach local subnets, if you desire). Since the OpenWRT Kernel is aware that your AMPRNet allocations exist locally (and are populated on the MAIN ROUTING TABLE), you must provide routing rules for AMPRLAN to reach these local subnets, or omit those rules (not permitting your AMPRLAN to route to your local subnets). Lastly, it assumes that the user can navigate the default OpenWRT LuCI web-based graphical user interface locally (and that they are using a device capable of having the package installed), are familiar with the [https://en.wikipedia.org/wiki/Chmod chmod] command, and/or familiar with entering OpenWRT UCI (Unified Configuration Interface) commands by serial console or SSH.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Install:&lt;br /&gt;
&lt;br /&gt;
* kmod-ipip&lt;br /&gt;
* ip-full&lt;br /&gt;
* libstdcpp&lt;br /&gt;
* [[ampr-ripd]] to &#039;&#039;&#039;/etc/config/&#039;&#039;&#039; (always run [[RIP]]44 software in console mode FIRST after installation to verify execution and obtain the password, the execution of the file is commented-out below)&lt;br /&gt;
* diffutils (optional for dynamic IP filtering)&lt;br /&gt;
* (optional) dynamic firewall script to /etc/config/load_ipipfilter.sh (see the iptables section of the [[Firewalls]] wiki)&lt;br /&gt;
* the following to &#039;&#039;&#039;System &amp;gt; Startup &amp;gt; Local Startup:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 ip tunnel add tunl0&lt;br /&gt;
 ip tunnel change tunl0 mode ipip ttl 64 pmtudisc&lt;br /&gt;
 ip link set tunl0 mtu 1480 up&lt;br /&gt;
 ip route add default dev tunl0 via &#039;&#039;&#039;&amp;lt;AMPRGW&amp;gt;&#039;&#039;&#039; onlink proto 44 table 44&lt;br /&gt;
 &#039;&#039;&#039;# This directory is not persistent on OpenWRT, it must be made on boot for dynamic filtering&lt;br /&gt;
 mkdir /var/lib/ampr-ripd&lt;br /&gt;
 # A blank bootstrap file must be created at /etc/config/encap.txt for this to work&lt;br /&gt;
 # after which, you may run ampr-ripd to populate it&lt;br /&gt;
 ln -s /etc/config/encap.txt /tmp/lib/ampr-ripd/encap.txt&lt;br /&gt;
 # Dynamic filter, script executed by -x argument&lt;br /&gt;
 # Dynamic filter, -s argument creates encap.txt&lt;br /&gt;
 &#039;&#039;&#039;# ./etc/config/ampr-ripd -p &amp;lt;PASSWORD&amp;gt; -s -t 44 -a &amp;lt;44.xxx.xxx.xxx/xx&amp;gt; -x ./etc/config/load_ipipfilter.sh &amp;amp;&#039;&#039;&#039;&lt;br /&gt;
 #OPTIONAL LAN ### ip rule add from &#039;&#039;&#039;&amp;lt;44.xxx.xxx.xxx/xx&amp;gt;&#039;&#039;&#039; to &#039;&#039;&#039;&amp;lt;192.168.xxx.xxx/16&amp;gt;&#039;&#039;&#039; table main priority 22&lt;br /&gt;
 #ADD A RULE FOR EVERY LOCAL AMPR SUBNET, RENUMBER 44-4X ACCORDINGLY) &lt;br /&gt;
 ip rule add to &#039;&#039;&#039;&amp;lt;44.xxx.xxx.xxx/xx&amp;gt;&#039;&#039;&#039; table main priority 44&lt;br /&gt;
 ###Add this after you create the AMPRLAN bridge, this ensures all traffic from AMPRLAN uses table 44&lt;br /&gt;
 ip rule add dev br-amprlan table 44 priority 45&lt;br /&gt;
 ### This ensures all traffic received on tunl0 uses table 44&lt;br /&gt;
 ip rule add dev tunl0 table 44 priority 46&lt;br /&gt;
 ### You must add an IP rule for all 44net IPs residing on the device&lt;br /&gt;
 ip rule add from &#039;&#039;&#039;&amp;lt;44.xxx.xxx.xxx/xx&amp;gt;&#039;&#039;&#039; table 44 priority 47&lt;br /&gt;
 ## Allows traceroute to respond using 44net IP of tunl0 or br-amprlan ##&lt;br /&gt;
 echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_errors_use_inbound_ifaddr&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;reboot&#039;&#039;&#039;&lt;br /&gt;
* an unmanaged interface instance for tunl0 (AMPRWAN) &#039;&#039;&#039;(set to not bring up on boot)&#039;&#039;&#039;, adding it to its own firewall zone using Input: Drop (or Reject), Output: Drop (or Reject) and Forward: Drop (or Reject). &#039;&#039;&#039;Be sure to enable connection tracking if you will not masquerade&#039;&#039;&#039;&lt;br /&gt;
* an interface instance for a new VLAN and bridge (AMPRLAN), add it to its own firewall zone using Input: Accept (if you wish for you AMPRLAN devices to reach the router), Output: Accept and Forward: Drop (or Reject). &#039;&#039;&#039;Assign an IP from your allocation to this interface, you will configure this IP on your devices as the Default Route/Gateway address.&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;reboot&#039;&#039;&#039;&lt;br /&gt;
* Permit forwarding from AMPRLAN to AMPRWAN and WAN (you must masquerade this traffic when using WAN)&lt;br /&gt;
* Permit forwarding from LAN to AMPRLAN (as desired, NOTE: you must make an IP Rule for the AMPRLAN to use the LAN&#039;s route on the Main Routing Table)&lt;br /&gt;
* Create Traffic Input rule to allow IPv4 IPENCAP (IP protocol type 4) from Any IP on WAN to any IP on Router (or specify WAN IP if statically assigned)&lt;br /&gt;
* Create Traffic Input rule to allow IPv4 udp/520 from 44.0.0.1 in AMPRWAN to 224.0.0.9 at port udp/520 IP on Router&lt;br /&gt;
* Create Traffic Forward rules for any inbound services (as desired)&lt;br /&gt;
* the VLAN to any switch/trunk ports (as desired)&lt;br /&gt;
* make ampr-ripd and load_ipipfilter.sh executable using &#039;&#039;&#039;chmod +x&#039;&#039;&#039;&lt;br /&gt;
* test ampr-ripd in console using the &#039;&#039;&#039;-d&#039;&#039;&#039; argument&lt;br /&gt;
* add password to the &#039;&#039;&#039;Local Startup&#039;&#039;&#039; entry and uncomment ampr-ripd line&lt;br /&gt;
* &#039;&#039;&#039;reboot&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Services&amp;diff=755</id>
		<title>Services</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Services&amp;diff=755"/>
		<updated>2017-10-10T21:34:40Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: change country of NTP servers&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maintainer !! Service Name!! URL/IP !! Service Type !! Description !! Other Information&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[Portal]] ||  https://portal.ampr.org || HTTPS || manage [[Gateway]], [[Encap.txt]] preferences and ampr.org domain entries (domain entry functionality still under development)|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||Website ||  http://www.ampr.org || HTTP || AMPRNet Main Page|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||Wiki ||  http://wiki.ampr.org || HTTP || This Wiki|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[44Net mailing list]] ||  http://hamradio.ucsd.edu/mailman/listinfo/44net || HTTP || mailing list discussion|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||AMPRNet [[Gateway]] (AMPRGW) || 169.228.34.84 || IP and IPENCAP [[Tunnel]]|| main AMPRNet Router|| Gateways use IP Protocol 4 (IPENCAP) to receive traffic via AMPRGW. Allocation must be registered in the [[Portal]] and gateways must run an AMPRNet routing protocol (i.e. [[RIP]]44 or [[munge script]]).&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[RIP]]44 || provided via [https://en.wikipedia.org/wiki/Broadcasting_%28networking%29 broadcast] from 44.0.0.1 to all [[gateway]]s registered in the [[portal]] || Routing Information (modified RIPv2 protocol) || distributed by main AMPRNet Router to multicast address 224.0.0.9|| 1.) an enabled IPENCAP tunnel, and 2.) [[ampr-ripd]] or [[rip44d]] must be running and properly configured on your registered gateway&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[Encap.txt]] || N/A || Routing Information (EMAIL/FTP/HTTP)|| routing information for download|| file must be must be parsed by a self-developed [[munge script]]&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators||[[Ampr.org]] DNS and Reverse DNS (44.in-addr.arpa) ||&lt;br /&gt;
(These hosts maintain a copy of AMPR.ORG and the 44.IN-ADDR.ARPA DNS Zones:)&lt;br /&gt;
&amp;lt;br /&amp;gt;ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
ns2.threshinc.com&amp;lt;br /&amp;gt;&lt;br /&gt;
munnari.OZ.AU&amp;lt;br /&amp;gt;&lt;br /&gt;
a.coreservers.uk&amp;lt;br /&amp;gt;&lt;br /&gt;
ampr-dns.in-berlin.de&amp;lt;br /&amp;gt;&lt;br /&gt;
(These hosts maintain a copy of AMPR.ORG and the 44.in-addr.arpa DNS Zones. 44/8 hosts may use as recursive/Client DNS servers:)&amp;lt;br /&amp;gt;&lt;br /&gt;
gw.ct.ampr.org (44.88.0.1)&amp;lt;br /&amp;gt;&lt;br /&gt;
dns-mdc.ampr.org (44.60.44.3)&amp;lt;br /&amp;gt;&lt;br /&gt;
n1uro.ampr.org (44.88.0.9)&lt;br /&gt;
|| DNS || name resolution services|| zone files can be downloaded from ftp://gw.ampr.org/pub/&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators||Network Tools||&lt;br /&gt;
http://whatismyip.ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
http://yo2tm.ampr.org/nettools.php&amp;lt;br /&amp;gt;&lt;br /&gt;
http://kb3vwg-010.ampr.org/tools&amp;lt;br /&amp;gt;&lt;br /&gt;
http://speedtest.ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
http://n1uro.ampr.org/do.shtml&amp;lt;br /&amp;gt;&lt;br /&gt;
 || HTTP|| source IP checker, speed test, Ping, Traceroute, etc.|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators ||Network Time Protocol Server || gw.ampr.org (Stratum 1, US)&amp;lt;br /&amp;gt;ntp.vk2hff.ampr.org (Stratum 1, AU)&amp;lt;br /&amp;gt;ntp.g1fef.ampr.org (Stratum 1, UK)&amp;lt;br /&amp;gt;kb3vwg-001.ampr.org (Stratum 2, US)&amp;lt;br /&amp;gt;gw-44-137.pi9noz.ampr.org (Stratum 2)&amp;lt;br /&amp;gt;yo2tm.ampr.org (Stratum 2)&amp;lt;br /&amp;gt;f4gve.ampr.org (Stratum 3)&amp;lt;br /&amp;gt;ntp1.on3rvh.ampr.org&amp;lt;br /&amp;gt; || NTP|| Stratum 2 Network Time Server - References US, Canadian and Mexican|| AMPRNet hosts have OPEN ACCESS to these time servers &lt;br /&gt;
|-&lt;br /&gt;
| OH7LZB ||[[AMPRNet_VPN]] || http://wiki.ampr.org/index.php/AMPRNet_VPN || VPN|| [http://en.wikipedia.org/wiki/OpenVPN OpenVPN]-based || You must have a X.509 certificate issued by [http://www.arrl.org/logbook-of-the-world ARRL Logbook of the World (LoTW)]. ARRL membership is not required.&lt;br /&gt;
|-&lt;br /&gt;
| N1URO  ||AMPRNet/RF faxing || http://wiki.ampr.org/wiki/axMail-FAX || Facsimile || Online IP based Facsimile service. You have the ability to send emergency communications from packet via Fax. || [http://axmail.sourceforge.net axMail-FAX] Sofware is here.&lt;br /&gt;
|-&lt;br /&gt;
| OH1KK  || KiwiSDR Kaustinen || http://44.139.48.2 || SDR-receiver || KiwiSDR receiver located at Kaustinen, Finland · 0-30 MHz · Antenna switch extension · Northern Europe || Experimental. Also available on non-amprnet at address http://sdr.vy.fi&lt;br /&gt;
|-&lt;br /&gt;
|-}&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Services&amp;diff=754</id>
		<title>Services</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Services&amp;diff=754"/>
		<updated>2017-10-10T18:30:38Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maintainer !! Service Name!! URL/IP !! Service Type !! Description !! Other Information&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[Portal]] ||  https://portal.ampr.org || HTTPS || manage [[Gateway]], [[Encap.txt]] preferences and ampr.org domain entries (domain entry functionality still under development)|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||Website ||  http://www.ampr.org || HTTP || AMPRNet Main Page|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||Wiki ||  http://wiki.ampr.org || HTTP || This Wiki|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[44Net mailing list]] ||  http://hamradio.ucsd.edu/mailman/listinfo/44net || HTTP || mailing list discussion|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||AMPRNet [[Gateway]] (AMPRGW) || 169.228.34.84 || IP and IPENCAP [[Tunnel]]|| main AMPRNet Router|| Gateways use IP Protocol 4 (IPENCAP) to receive traffic via AMPRGW. Allocation must be registered in the [[Portal]] and gateways must run an AMPRNet routing protocol (i.e. [[RIP]]44 or [[munge script]]).&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[RIP]]44 || provided via [https://en.wikipedia.org/wiki/Broadcasting_%28networking%29 broadcast] from 44.0.0.1 to all [[gateway]]s registered in the [[portal]] || Routing Information (modified RIPv2 protocol) || distributed by main AMPRNet Router to multicast address 224.0.0.9|| 1.) an enabled IPENCAP tunnel, and 2.) [[ampr-ripd]] or [[rip44d]] must be running and properly configured on your registered gateway&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[Encap.txt]] || N/A || Routing Information (EMAIL/FTP/HTTP)|| routing information for download|| file must be must be parsed by a self-developed [[munge script]]&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators||[[Ampr.org]] DNS and Reverse DNS (44.in-addr.arpa) ||&lt;br /&gt;
(These hosts maintain a copy of AMPR.ORG and the 44.IN-ADDR.ARPA DNS Zones:)&lt;br /&gt;
&amp;lt;br /&amp;gt;ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
ns2.threshinc.com&amp;lt;br /&amp;gt;&lt;br /&gt;
munnari.OZ.AU&amp;lt;br /&amp;gt;&lt;br /&gt;
a.coreservers.uk&amp;lt;br /&amp;gt;&lt;br /&gt;
ampr-dns.in-berlin.de&amp;lt;br /&amp;gt;&lt;br /&gt;
(These hosts maintain a copy of AMPR.ORG and the 44.in-addr.arpa DNS Zones. 44/8 hosts may use as recursive/Client DNS servers:)&amp;lt;br /&amp;gt;&lt;br /&gt;
gw.ct.ampr.org (44.88.0.1)&amp;lt;br /&amp;gt;&lt;br /&gt;
dns-mdc.ampr.org (44.60.44.3)&amp;lt;br /&amp;gt;&lt;br /&gt;
n1uro.ampr.org (44.88.0.9)&lt;br /&gt;
|| DNS || name resolution services|| zone files can be downloaded from ftp://gw.ampr.org/pub/&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators||Network Tools||&lt;br /&gt;
http://whatismyip.ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
http://yo2tm.ampr.org/nettools.php&amp;lt;br /&amp;gt;&lt;br /&gt;
http://kb3vwg-010.ampr.org/tools&amp;lt;br /&amp;gt;&lt;br /&gt;
http://speedtest.ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
http://n1uro.ampr.org/do.shtml&amp;lt;br /&amp;gt;&lt;br /&gt;
 || HTTP|| source IP checker, speed test, Ping, Traceroute, etc.|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators ||Network Time Protocol Server || gw.ampr.org (Stratum 1, US)&amp;lt;br /&amp;gt;ntp.vk2hff.ampr.org (Stratum 1, UK)&amp;lt;br /&amp;gt;ntp.g1fef.ampr.org (Stratum 1, UK)&amp;lt;br /&amp;gt;kb3vwg-001.ampr.org (Stratum 2, US)&amp;lt;br /&amp;gt;gw-44-137.pi9noz.ampr.org (Stratum 2)&amp;lt;br /&amp;gt;yo2tm.ampr.org (Stratum 2)&amp;lt;br /&amp;gt;f4gve.ampr.org (Stratum 3)&amp;lt;br /&amp;gt;ntp1.on3rvh.ampr.org&amp;lt;br /&amp;gt; || NTP|| Stratum 2 Network Time Server - References US, Canadian and Mexican|| AMPRNet hosts have OPEN ACCESS to these time servers &lt;br /&gt;
|-&lt;br /&gt;
| OH7LZB ||[[AMPRNet_VPN]] || http://wiki.ampr.org/index.php/AMPRNet_VPN || VPN|| [http://en.wikipedia.org/wiki/OpenVPN OpenVPN]-based || You must have a X.509 certificate issued by [http://www.arrl.org/logbook-of-the-world ARRL Logbook of the World (LoTW)]. ARRL membership is not required.&lt;br /&gt;
|-&lt;br /&gt;
| N1URO  ||AMPRNet/RF faxing || http://wiki.ampr.org/wiki/axMail-FAX || Facsimile || Online IP based Facsimile service. You have the ability to send emergency communications from packet via Fax. || [http://axmail.sourceforge.net axMail-FAX] Sofware is here.&lt;br /&gt;
|-&lt;br /&gt;
| OH1KK  || KiwiSDR Kaustinen || http://44.139.48.2 || SDR-receiver || KiwiSDR receiver located at Kaustinen, Finland · 0-30 MHz · Antenna switch extension · Northern Europe || Experimental. Also available on non-amprnet at address http://sdr.vy.fi&lt;br /&gt;
|-&lt;br /&gt;
|-}&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Services&amp;diff=753</id>
		<title>Services</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Services&amp;diff=753"/>
		<updated>2017-10-10T15:31:10Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maintainer !! Service Name!! URL/IP !! Service Type !! Description !! Other Information&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[Portal]] ||  https://portal.ampr.org || HTTPS || manage [[Gateway]], [[Encap.txt]] preferences and ampr.org domain entries (domain entry functionality still under development)|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||Website ||  http://www.ampr.org || HTTP || AMPRNet Main Page|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||Wiki ||  http://wiki.ampr.org || HTTP || This Wiki|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[44Net mailing list]] ||  http://hamradio.ucsd.edu/mailman/listinfo/44net || HTTP || mailing list discussion|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||AMPRNet [[Gateway]] (AMPRGW) || 169.228.34.84 || IP and IPENCAP [[Tunnel]]|| main AMPRNet Router|| Gateways use IP Protocol 4 (IPENCAP) to receive traffic via AMPRGW. Allocation must be registered in the [[Portal]] and gateways must run an AMPRNet routing protocol (i.e. [[RIP]]44 or [[munge script]]).&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[RIP]]44 || provided via [https://en.wikipedia.org/wiki/Broadcasting_%28networking%29 broadcast] from 44.0.0.1 to all [[gateway]]s registered in the [[portal]] || Routing Information (modified RIPv2 protocol) || distributed by main AMPRNet Router to multicast address 224.0.0.9|| 1.) an enabled IPENCAP tunnel, and 2.) [[ampr-ripd]] or [[rip44d]] must be running and properly configured on your registered gateway&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[Encap.txt]] || N/A || Routing Information (EMAIL/FTP/HTTP)|| routing information for download|| file must be must be parsed by a self-developed [[munge script]]&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators||[[Ampr.org]] DNS and Reverse DNS (44.in-addr.arpa) ||&lt;br /&gt;
(These hosts maintain a copy of AMPR.ORG and the 44.IN-ADDR.ARPA DNS Zones:)&lt;br /&gt;
&amp;lt;br /&amp;gt;ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
ns2.threshinc.com&amp;lt;br /&amp;gt;&lt;br /&gt;
munnari.OZ.AU&amp;lt;br /&amp;gt;&lt;br /&gt;
a.coreservers.uk&amp;lt;br /&amp;gt;&lt;br /&gt;
ampr-dns.in-berlin.de&amp;lt;br /&amp;gt;&lt;br /&gt;
(These hosts maintain a copy of AMPR.ORG and the 44.in-addr.arpa DNS Zones. 44/8 hosts may use as recursive/Client DNS servers:)&amp;lt;br /&amp;gt;&lt;br /&gt;
gw.ct.ampr.org (44.88.0.1)&amp;lt;br /&amp;gt;&lt;br /&gt;
dns-mdc.ampr.org (44.60.44.3)&amp;lt;br /&amp;gt;&lt;br /&gt;
n1uro.ampr.org (44.88.0.9)&lt;br /&gt;
|| DNS || name resolution services|| zone files can be downloaded from ftp://gw.ampr.org/pub/&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators||Network Tools||&lt;br /&gt;
http://whatismyip.ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
http://yo2tm.ampr.org/nettools.php&amp;lt;br /&amp;gt;&lt;br /&gt;
http://kb3vwg-010.ampr.org/tools&amp;lt;br /&amp;gt;&lt;br /&gt;
http://speedtest.ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
http://n1uro.ampr.org/do.shtml&amp;lt;br /&amp;gt;&lt;br /&gt;
 || HTTP|| source IP checker, speed test, Ping, Traceroute, etc.|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators ||Network Time Protocol Server || gw.ampr.org (Stratum 1, US)&amp;lt;br /&amp;gt;ntp.vk2hff.ampr.org (Stratum 1, UK)&amp;lt;br /&amp;gt;ntp.g1fef.ampr.org (Stratum 1, UK)&amp;lt;br /&amp;gt;kb3vwg-001.ampr.org (Stratum 2, US)&amp;lt;br /&amp;gt;gw-44-137.pi9noz.ampr.org (Stratum 2)&amp;lt;br /&amp;gt;yo2tm.ampr.org (Stratum 2)&amp;lt;br /&amp;gt;f4gve.ampr.org (Stratum 3)&amp;lt;br /&amp;gt; || NTP|| Stratum 2 Network Time Server - References US, Canadian and Mexican|| AMPRNet hosts have OPEN ACCESS to these time servers &lt;br /&gt;
|-&lt;br /&gt;
| OH7LZB ||[[AMPRNet_VPN]] || http://wiki.ampr.org/index.php/AMPRNet_VPN || VPN|| [http://en.wikipedia.org/wiki/OpenVPN OpenVPN]-based || You must have a X.509 certificate issued by [http://www.arrl.org/logbook-of-the-world ARRL Logbook of the World (LoTW)]. ARRL membership is not required.&lt;br /&gt;
|-&lt;br /&gt;
| N1URO  ||AMPRNet/RF faxing || http://wiki.ampr.org/wiki/axMail-FAX || Facsimile || Online IP based Facsimile service. You have the ability to send emergency communications from packet via Fax. || [http://axmail.sourceforge.net axMail-FAX] Sofware is here.&lt;br /&gt;
|-&lt;br /&gt;
| OH1KK  || KiwiSDR Kaustinen || http://44.139.48.2 || SDR-receiver || KiwiSDR receiver located at Kaustinen, Finland · 0-30 MHz · Antenna switch extension · Northern Europe || Experimental. Also available on non-amprnet at address http://sdr.vy.fi&lt;br /&gt;
|-&lt;br /&gt;
|-}&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Services&amp;diff=752</id>
		<title>Services</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Services&amp;diff=752"/>
		<updated>2017-10-10T14:16:06Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: added more NTP servers&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maintainer !! Service Name!! URL/IP !! Service Type !! Description !! Other Information&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[Portal]] ||  https://portal.ampr.org || HTTPS || manage [[Gateway]], [[Encap.txt]] preferences and ampr.org domain entries (domain entry functionality still under development)|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||Website ||  http://www.ampr.org || HTTP || AMPRNet Main Page|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||Wiki ||  http://wiki.ampr.org || HTTP || This Wiki|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[44Net mailing list]] ||  http://hamradio.ucsd.edu/mailman/listinfo/44net || HTTP || mailing list discussion|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||AMPRNet [[Gateway]] (AMPRGW) || 169.228.34.84 || IP and IPENCAP [[Tunnel]]|| main AMPRNet Router|| Gateways use IP Protocol 4 (IPENCAP) to receive traffic via AMPRGW. Allocation must be registered in the [[Portal]] and gateways must run an AMPRNet routing protocol (i.e. [[RIP]]44 or [[munge script]]).&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[RIP]]44 || provided via [https://en.wikipedia.org/wiki/Broadcasting_%28networking%29 broadcast] from 44.0.0.1 to all [[gateway]]s registered in the [[portal]] || Routing Information (modified RIPv2 protocol) || distributed by main AMPRNet Router to multicast address 224.0.0.9|| 1.) an enabled IPENCAP tunnel, and 2.) [[ampr-ripd]] or [[rip44d]] must be running and properly configured on your registered gateway&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[Encap.txt]] || N/A || Routing Information (EMAIL/FTP/HTTP)|| routing information for download|| file must be must be parsed by a self-developed [[munge script]]&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators||[[Ampr.org]] DNS and Reverse DNS (44.in-addr.arpa) ||&lt;br /&gt;
(These hosts maintain a copy of AMPR.ORG and the 44.IN-ADDR.ARPA DNS Zones:)&lt;br /&gt;
&amp;lt;br /&amp;gt;ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
ns2.threshinc.com&amp;lt;br /&amp;gt;&lt;br /&gt;
munnari.OZ.AU&amp;lt;br /&amp;gt;&lt;br /&gt;
a.coreservers.uk&amp;lt;br /&amp;gt;&lt;br /&gt;
ampr-dns.in-berlin.de&amp;lt;br /&amp;gt;&lt;br /&gt;
(These hosts maintain a copy of AMPR.ORG and the 44.in-addr.arpa DNS Zones. 44/8 hosts may use as recursive/Client DNS servers:)&amp;lt;br /&amp;gt;&lt;br /&gt;
gw.ct.ampr.org (44.88.0.1)&amp;lt;br /&amp;gt;&lt;br /&gt;
dns-mdc.ampr.org (44.60.44.3)&amp;lt;br /&amp;gt;&lt;br /&gt;
n1uro.ampr.org (44.88.0.9)&lt;br /&gt;
|| DNS || name resolution services|| zone files can be downloaded from ftp://gw.ampr.org/pub/&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators||Network Tools||&lt;br /&gt;
http://whatismyip.ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
http://yo2tm.ampr.org/nettools.php&amp;lt;br /&amp;gt;&lt;br /&gt;
http://kb3vwg-010.ampr.org/tools&amp;lt;br /&amp;gt;&lt;br /&gt;
http://speedtest.ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
http://n1uro.ampr.org/do.shtml&amp;lt;br /&amp;gt;&lt;br /&gt;
 || HTTP|| source IP checker, speed test, Ping, Traceroute, etc.|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators ||Network Time Protocol Server || gw.ampr.org (Stratum 1, US)&amp;lt;br /&amp;gt;ntp.vk2hff.ampr.org (Stratum 1, UK)&amp;lt;br /&amp;gt;ntp.g1fef.ampr.org (Stratum 1, UK)&amp;lt;br /&amp;gt;kb3vwg-001.ampr.org (Stratum 2, US)&amp;lt;br /&amp;gt;gw-44-137.pi9noz.ampr.org (Stratum 2)&amp;lt;br /&amp;gt;f4gve.ampr.org (Stratum 3)&amp;lt;br /&amp;gt; || NTP|| Stratum 2 Network Time Server - References US, Canadian and Mexican|| AMPRNet hosts have OPEN ACCESS to these time servers &lt;br /&gt;
|-&lt;br /&gt;
| OH7LZB ||[[AMPRNet_VPN]] || http://wiki.ampr.org/index.php/AMPRNet_VPN || VPN|| [http://en.wikipedia.org/wiki/OpenVPN OpenVPN]-based || You must have a X.509 certificate issued by [http://www.arrl.org/logbook-of-the-world ARRL Logbook of the World (LoTW)]. ARRL membership is not required.&lt;br /&gt;
|-&lt;br /&gt;
| N1URO  ||AMPRNet/RF faxing || http://wiki.ampr.org/wiki/axMail-FAX || Facsimile || Online IP based Facsimile service. You have the ability to send emergency communications from packet via Fax. || [http://axmail.sourceforge.net axMail-FAX] Sofware is here.&lt;br /&gt;
|-&lt;br /&gt;
| OH1KK  || KiwiSDR Kaustinen || http://44.139.48.2 || SDR-receiver || KiwiSDR receiver located at Kaustinen, Finland · 0-30 MHz · Antenna switch extension · Northern Europe || Experimental. Also available on non-amprnet at address http://sdr.vy.fi&lt;br /&gt;
|-&lt;br /&gt;
|-}&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Services&amp;diff=744</id>
		<title>Services</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Services&amp;diff=744"/>
		<updated>2017-10-03T01:50:08Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: all Global DNS possess both zones, removed &amp;quot;and/or&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maintainer !! Service Name!! URL/IP !! Service Type !! Description !! Other Information&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[Portal]] ||  https://portal.ampr.org || HTTPS || manage [[Gateway]], [[Encap.txt]] preferences and ampr.org domain entries (domain entry functionality still under development)|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||Website ||  http://www.ampr.org || HTTP || AMPRNet Main Page|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||Wiki ||  http://wiki.ampr.org || HTTP || This Wiki|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[44Net mailing list]] ||  http://hamradio.ucsd.edu/mailman/listinfo/44net || HTTP || mailing list discussion|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||AMPRNet [[Gateway]] (AMPRGW) || 169.228.34.84 || IP and IPENCAP [[Tunnel]]|| main AMPRNet Router|| Gateways use IP Protocol 4 (IPENCAP) to receive traffic via AMPRGW. Allocation must be registered in the [[Portal]] and gateways must run an AMPRNet routing protocol (i.e. [[RIP]]44 or [[munge script]]).&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[RIP]]44 || provided via [https://en.wikipedia.org/wiki/Broadcasting_%28networking%29 broadcast] from 44.0.0.1 to all [[gateway]]s registered in the [[portal]] || Routing Information (modified RIPv2 protocol) || distributed by main AMPRNet Router to multicast address 224.0.0.9|| 1.) an enabled IPENCAP tunnel, and 2.) [[ampr-ripd]] or [[rip44d]] must be running and properly configured on your registered gateway&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[Encap.txt]] || N/A || Routing Information (EMAIL/FTP/HTTP)|| routing information for download|| file must be must be parsed by a self-developed [[munge script]]&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators||[[Ampr.org]] DNS and Reverse DNS (44.in-addr.arpa) ||&lt;br /&gt;
(These hosts maintain a copy of AMPR.ORG and the 44.IN-ADDR.ARPA DNS Zones:)&lt;br /&gt;
&amp;lt;br /&amp;gt;ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
ns2.threshinc.com&amp;lt;br /&amp;gt;&lt;br /&gt;
munnari.OZ.AU&amp;lt;br /&amp;gt;&lt;br /&gt;
a.coreservers.uk&amp;lt;br /&amp;gt;&lt;br /&gt;
ampr-dns.in-berlin.de&amp;lt;br /&amp;gt;&lt;br /&gt;
(These hosts maintain a copy of AMPR.ORG and the 44.in-addr.arpa DNS Zones. 44/8 hosts may use as recursive/Client DNS servers:)&amp;lt;br /&amp;gt;&lt;br /&gt;
gw.ct.ampr.org (44.88.0.1)&amp;lt;br /&amp;gt;&lt;br /&gt;
dns-mdc.ampr.org (44.60.44.3)&amp;lt;br /&amp;gt;&lt;br /&gt;
n1uro.ampr.org (44.88.0.9)&lt;br /&gt;
|| DNS || name resolution services|| zone files can be downloaded from ftp://hamradio.ucsd.edu/pub/&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators||Network Tools||&lt;br /&gt;
http://whatismyip.ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
http://yo2tm.ampr.org/nettools.php&amp;lt;br /&amp;gt;&lt;br /&gt;
http://kb3vwg-010.ampr.org/tools&amp;lt;br /&amp;gt;&lt;br /&gt;
http://speedtest.ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
http://n1uro.ampr.org/do.shtml&amp;lt;br /&amp;gt;&lt;br /&gt;
 || HTTP|| source IP checker, speed test, Ping, Traceroute, etc.|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators ||Network Time Protocol Server || kb3vwg-001.ampr.org (Stratum 2)&amp;lt;br /&amp;gt;gw-44-137.pi9noz.ampr.org (Stratum 2)&amp;lt;br /&amp;gt;f4gve.ampr.org (Stratum 3)&amp;lt;br /&amp;gt; || NTP|| Stratum 2 Network Time Server - References US, Canadian and Mexican Stratum 1 Servers|| AMPRNet hosts have OPEN ACCESS to these time servers &lt;br /&gt;
|-&lt;br /&gt;
| OH7LZB ||[[AMPRNet_VPN]] || http://wiki.ampr.org/index.php/AMPRNet_VPN || VPN|| [http://en.wikipedia.org/wiki/OpenVPN OpenVPN]-based || You must have a X.509 certificate issued by [http://www.arrl.org/logbook-of-the-world ARRL Logbook of the World (LoTW)]. ARRL membership is not required.&lt;br /&gt;
|-&lt;br /&gt;
| N1URO  ||AMPRNet/RF faxing || http://wiki.ampr.org/wiki/axMail-FAX || Facsimile || Online IP based Facsimile service. You have the ability to send emergency communications from packet via Fax. || [http://axmail.sourceforge.net axMail-FAX] Sofware is here.&lt;br /&gt;
|-&lt;br /&gt;
| OH1KK  || KiwiSDR Kaustinen || http://44.139.48.2 || SDR-receiver || KiwiSDR receiver located at Kaustinen, Finland · 0-30 MHz · Antenna switch extension · Northern Europe || Experimental. Also available on non-amprnet at address http://sdr.vy.fi&lt;br /&gt;
|-&lt;br /&gt;
|-}&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Services&amp;diff=743</id>
		<title>Services</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Services&amp;diff=743"/>
		<updated>2017-10-03T01:31:42Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: add IPs of recursive/Client DNS servers&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maintainer !! Service Name!! URL/IP !! Service Type !! Description !! Other Information&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[Portal]] ||  https://portal.ampr.org || HTTPS || manage [[Gateway]], [[Encap.txt]] preferences and ampr.org domain entries (domain entry functionality still under development)|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||Website ||  http://www.ampr.org || HTTP || AMPRNet Main Page|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||Wiki ||  http://wiki.ampr.org || HTTP || This Wiki|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[44Net mailing list]] ||  http://hamradio.ucsd.edu/mailman/listinfo/44net || HTTP || mailing list discussion|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||AMPRNet [[Gateway]] (AMPRGW) || 169.228.34.84 || IP and IPENCAP [[Tunnel]]|| main AMPRNet Router|| Gateways use IP Protocol 4 (IPENCAP) to receive traffic via AMPRGW. Allocation must be registered in the [[Portal]] and gateways must run an AMPRNet routing protocol (i.e. [[RIP]]44 or [[munge script]]).&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[RIP]]44 || provided via [https://en.wikipedia.org/wiki/Broadcasting_%28networking%29 broadcast] from 44.0.0.1 to all [[gateway]]s registered in the [[portal]] || Routing Information (modified RIPv2 protocol) || distributed by main AMPRNet Router to multicast address 224.0.0.9|| 1.) an enabled IPENCAP tunnel, and 2.) [[ampr-ripd]] or [[rip44d]] must be running and properly configured on your registered gateway&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[Encap.txt]] || N/A || Routing Information (EMAIL/FTP/HTTP)|| routing information for download|| file must be must be parsed by a self-developed [[munge script]]&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators||[[Ampr.org]] DNS and Reverse DNS (44.in-addr.arpa) ||&lt;br /&gt;
(These hosts maintain a copy of AMPR.ORG and/or the 44.in-addr.arpa DNS Zones:)&lt;br /&gt;
&amp;lt;br /&amp;gt;ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
ns2.threshinc.com&amp;lt;br /&amp;gt;&lt;br /&gt;
munnari.OZ.AU&amp;lt;br /&amp;gt;&lt;br /&gt;
a.coreservers.uk&amp;lt;br /&amp;gt;&lt;br /&gt;
ampr-dns.in-berlin.de&amp;lt;br /&amp;gt;&lt;br /&gt;
(These hosts maintain a copy of AMPR.ORG and the 44.in-addr.arpa DNS Zones. 44/8 hosts may use as recursive/Client DNS servers:)&amp;lt;br /&amp;gt;&lt;br /&gt;
gw.ct.ampr.org (44.88.0.1)&amp;lt;br /&amp;gt;&lt;br /&gt;
dns-mdc.ampr.org (44.60.44.3)&amp;lt;br /&amp;gt;&lt;br /&gt;
n1uro.ampr.org (44.88.0.9)&lt;br /&gt;
|| DNS || name resolution services|| zone files can be downloaded from ftp://hamradio.ucsd.edu/pub/&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators||Network Tools||&lt;br /&gt;
http://whatismyip.ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
http://yo2tm.ampr.org/nettools.php&amp;lt;br /&amp;gt;&lt;br /&gt;
http://kb3vwg-010.ampr.org/tools&amp;lt;br /&amp;gt;&lt;br /&gt;
http://speedtest.ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
http://n1uro.ampr.org/do.shtml&amp;lt;br /&amp;gt;&lt;br /&gt;
 || HTTP|| source IP checker, speed test, Ping, Traceroute, etc.|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators ||Network Time Protocol Server || kb3vwg-001.ampr.org (Stratum 2)&amp;lt;br /&amp;gt;gw-44-137.pi9noz.ampr.org (Stratum 2)&amp;lt;br /&amp;gt;f4gve.ampr.org (Stratum 3)&amp;lt;br /&amp;gt; || NTP|| Stratum 2 Network Time Server - References US, Canadian and Mexican Stratum 1 Servers|| AMPRNet hosts have OPEN ACCESS to these time servers &lt;br /&gt;
|-&lt;br /&gt;
| OH7LZB ||[[AMPRNet_VPN]] || http://wiki.ampr.org/index.php/AMPRNet_VPN || VPN|| [http://en.wikipedia.org/wiki/OpenVPN OpenVPN]-based || You must have a X.509 certificate issued by [http://www.arrl.org/logbook-of-the-world ARRL Logbook of the World (LoTW)]. ARRL membership is not required.&lt;br /&gt;
|-&lt;br /&gt;
| N1URO  ||AMPRNet/RF faxing || http://wiki.ampr.org/wiki/axMail-FAX || Facsimile || Online IP based Facsimile service. You have the ability to send emergency communications from packet via Fax. || [http://axmail.sourceforge.net axMail-FAX] Sofware is here.&lt;br /&gt;
|-&lt;br /&gt;
| OH1KK  || KiwiSDR Kaustinen || http://44.139.48.2 || SDR-receiver || KiwiSDR receiver located at Kaustinen, Finland · 0-30 MHz · Antenna switch extension · Northern Europe || Experimental. Also available on non-amprnet at address http://sdr.vy.fi&lt;br /&gt;
|-&lt;br /&gt;
|-}&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Services&amp;diff=742</id>
		<title>Services</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Services&amp;diff=742"/>
		<updated>2017-10-03T01:28:10Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: new DNS servers&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{| class=&amp;quot;wikitable sortable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Maintainer !! Service Name!! URL/IP !! Service Type !! Description !! Other Information&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[Portal]] ||  https://portal.ampr.org || HTTPS || manage [[Gateway]], [[Encap.txt]] preferences and ampr.org domain entries (domain entry functionality still under development)|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||Website ||  http://www.ampr.org || HTTP || AMPRNet Main Page|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||Wiki ||  http://wiki.ampr.org || HTTP || This Wiki|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[44Net mailing list]] ||  http://hamradio.ucsd.edu/mailman/listinfo/44net || HTTP || mailing list discussion|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||AMPRNet [[Gateway]] (AMPRGW) || 169.228.34.84 || IP and IPENCAP [[Tunnel]]|| main AMPRNet Router|| Gateways use IP Protocol 4 (IPENCAP) to receive traffic via AMPRGW. Allocation must be registered in the [[Portal]] and gateways must run an AMPRNet routing protocol (i.e. [[RIP]]44 or [[munge script]]).&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[RIP]]44 || provided via [https://en.wikipedia.org/wiki/Broadcasting_%28networking%29 broadcast] from 44.0.0.1 to all [[gateway]]s registered in the [[portal]] || Routing Information (modified RIPv2 protocol) || distributed by main AMPRNet Router to multicast address 224.0.0.9|| 1.) an enabled IPENCAP tunnel, and 2.) [[ampr-ripd]] or [[rip44d]] must be running and properly configured on your registered gateway&lt;br /&gt;
|-&lt;br /&gt;
| AMPR ||[[Encap.txt]] || N/A || Routing Information (EMAIL/FTP/HTTP)|| routing information for download|| file must be must be parsed by a self-developed [[munge script]]&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators||[[Ampr.org]] DNS and Reverse DNS (44.in-addr.arpa) ||&lt;br /&gt;
(These hosts maintain a copy of AMPR.ORG and/or the 44.in-addr.arpa DNS Zones:)&lt;br /&gt;
&amp;lt;br /&amp;gt;ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
ns2.threshinc.com&amp;lt;br /&amp;gt;&lt;br /&gt;
munnari.OZ.AU&amp;lt;br /&amp;gt;&lt;br /&gt;
a.coreservers.uk&amp;lt;br /&amp;gt;&lt;br /&gt;
ampr-dns.in-berlin.de&amp;lt;br /&amp;gt;&lt;br /&gt;
(These hosts maintain a copy of AMPR.ORG and the 44.in-addr.arpa DNS Zones. 44/8 hosts may use as recursive/Client DNS servers:)&amp;lt;br /&amp;gt;&lt;br /&gt;
gw.ct.ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
dns-mdc.ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
n1uro.ampr.org&lt;br /&gt;
|| DNS || name resolution services|| zone files can be downloaded from ftp://hamradio.ucsd.edu/pub/&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators||Network Tools||&lt;br /&gt;
http://whatismyip.ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
http://yo2tm.ampr.org/nettools.php&amp;lt;br /&amp;gt;&lt;br /&gt;
http://kb3vwg-010.ampr.org/tools&amp;lt;br /&amp;gt;&lt;br /&gt;
http://speedtest.ampr.org&amp;lt;br /&amp;gt;&lt;br /&gt;
http://n1uro.ampr.org/do.shtml&amp;lt;br /&amp;gt;&lt;br /&gt;
 || HTTP|| source IP checker, speed test, Ping, Traceroute, etc.|| NONE&lt;br /&gt;
|-&lt;br /&gt;
| Various Operators ||Network Time Protocol Server || kb3vwg-001.ampr.org (Stratum 2)&amp;lt;br /&amp;gt;gw-44-137.pi9noz.ampr.org (Stratum 2)&amp;lt;br /&amp;gt;f4gve.ampr.org (Stratum 3)&amp;lt;br /&amp;gt; || NTP|| Stratum 2 Network Time Server - References US, Canadian and Mexican Stratum 1 Servers|| AMPRNet hosts have OPEN ACCESS to these time servers &lt;br /&gt;
|-&lt;br /&gt;
| OH7LZB ||[[AMPRNet_VPN]] || http://wiki.ampr.org/index.php/AMPRNet_VPN || VPN|| [http://en.wikipedia.org/wiki/OpenVPN OpenVPN]-based || You must have a X.509 certificate issued by [http://www.arrl.org/logbook-of-the-world ARRL Logbook of the World (LoTW)]. ARRL membership is not required.&lt;br /&gt;
|-&lt;br /&gt;
| N1URO  ||AMPRNet/RF faxing || http://wiki.ampr.org/wiki/axMail-FAX || Facsimile || Online IP based Facsimile service. You have the ability to send emergency communications from packet via Fax. || [http://axmail.sourceforge.net axMail-FAX] Sofware is here.&lt;br /&gt;
|-&lt;br /&gt;
| OH1KK  || KiwiSDR Kaustinen || http://44.139.48.2 || SDR-receiver || KiwiSDR receiver located at Kaustinen, Finland · 0-30 MHz · Antenna switch extension · Northern Europe || Experimental. Also available on non-amprnet at address http://sdr.vy.fi&lt;br /&gt;
|-&lt;br /&gt;
|-}&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=729</id>
		<title>Firewalls</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=729"/>
		<updated>2017-06-07T18:34:00Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: added link to N1?URO&amp;#039;s AMPR NAT page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the Firewall Wiki.&lt;br /&gt;
&lt;br /&gt;
NOTE: This page is intended to be edited by the community to add use practices, command syntax, etc. regarding firewalling and security on AMPRNet nodes. While each operator is ultimately responsible for the administration of their node, it is highly suggested amongst the [[44Net mailing list]] Community that nodes be firewalled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: On an iptables-based firewall, you must enable connection tracking on the tunl0 interface in order to enable Stateful Packet Inspection (i.e. a stateful firewall). Since the IPENCAP Linux Kernel Module IPIP is in the kernel, &#039;&#039;&#039;you must set the default forwarding policy to DROP or REJECT.&#039;&#039;&#039; If you set your default routing policy to ACCEPT, all packets that have not been explicitly DROPped or REJECTed elsewhere, will route, regardless of firewall policies.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Cisco ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DD-WRT ==&lt;br /&gt;
&lt;br /&gt;
DD-WRT uses an iptables-based firewall (see iptables below). Custom rules can be entered at Administration &amp;gt; Commands &amp;gt; &amp;quot;Save Firewall&amp;quot;&lt;br /&gt;
&lt;br /&gt;
https://www.dd-wrt.com/wiki/index.php/Iptables&lt;br /&gt;
&lt;br /&gt;
https://www.dd-wrt.com/wiki/index.php/Firewall&lt;br /&gt;
&lt;br /&gt;
== D-Link ==&lt;br /&gt;
&lt;br /&gt;
On some D-Link devices, the port forwarding feature allows for the options: TCP, UDP and Other. The &amp;quot;Other&amp;quot; option on these models are capable of Destination NAT of IPENCAP packets.&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4) &#039;&#039;&#039;Note: this rule is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In Port Forwarding&lt;br /&gt;
&lt;br /&gt;
 # Create a new Port Forward&lt;br /&gt;
 # Enter the LAN IP of your AMPR node&lt;br /&gt;
 # Select &amp;quot;Other&amp;quot;&lt;br /&gt;
 # Type the number &#039;&#039;&#039;4&#039;&#039;&#039; into the field&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== iptables ==&lt;br /&gt;
&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS IP TRAFFIC THAT&#039;S INVALID ENTERING OR EXITING AMPR&lt;br /&gt;
 # THIS PREVENTS A GENERAL LOOP&lt;br /&gt;
 iptables -I FORWARD -i tunl0 -o tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND IPs NOT FROM YOUR ALLOCATION (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING ! -s 44.xxx.xxx.xxx/xx -i br-amprnet -j DROP&lt;br /&gt;
 # DROPS ROGUE INBOUND ASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 44.xxx.xxx.xxx/xx -i tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND UNASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 # YOU MUST ADD A RULE UNDER THIS LINE TO MAKE EXCEPTIONS (BCP 38)&lt;br /&gt;
 iptables -I FORWARD ! -s 44.xxx.xxx.xxx/xx -o tunl0 -j DROP&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS BOGONS ENTERING AMPRNet&lt;br /&gt;
 # SEE http://www.team-cymru.org/Services/Bogons/bogon-bn-nonagg.txt&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 0.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 10.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 100.64.0.0/10 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 127.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 169.254.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 172.16.0.0/12 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.0.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.2.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.168.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.18.0.0/15 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.51.100.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 203.0.113.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 224.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 240.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # THIS PREVENTS NESTED IPENCAP (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING -p 4 -i tunl0 -j DROP&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable dynamic filtering of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: this rule (or the static rule below) is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REQUIRED: [[ampr-ripd]] (using the -x and -d arguments), the diff command from the [http://www.gnu.org/software/diffutils/manual/diffutils.html diffutils package] and the [https://www.gnu.org/software/sed/manual/sed.html sed command].&lt;br /&gt;
&lt;br /&gt;
 # Place this rule a the last firewall command&lt;br /&gt;
 # Uncomment sleep command below if the rule does not appear&lt;br /&gt;
 # as load_ipipfilter.sh is still executing&lt;br /&gt;
 # sleep 10&lt;br /&gt;
 # load ipipfilter list rule&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF WAN&amp;gt;&#039;&#039;&#039; -j ipipfilter&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 # by Rob, PE1CHL&lt;br /&gt;
 # load_ipipfilter.sh&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 AMPRGW=&amp;quot;169.228.34.84&amp;quot;&lt;br /&gt;
 gwfile=&amp;quot;/tmp/gw&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 # Parse encap.txt for Node IPs and place in /tmp/gw&lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u &amp;gt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
 # Run command to create CHAIN, IF no system output, CHAIN was created&lt;br /&gt;
 iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 if [ $? -eq 0 ]&lt;br /&gt;
 &#039;&#039;&#039;# DO NOT PLACE EMPTY LINES BETWEEN THE TWO COMMANDS ABOVE. ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# THE EQUATION ASKS IF THE LAST SYSTEM COMMAND ENTERED ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# RETURNS &amp;quot;NOTHING.&amp;quot; ADDING A SPACE WILL CHANGE RESULTS OF THE IF COMMAND. ###&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 ##The two lines above replace the line below, which does not work on OpenWRT&lt;br /&gt;
 # if iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 ## &lt;br /&gt;
 &lt;br /&gt;
 # IF no system output, THEN flush the CHAIN and add AMPRGW,&lt;br /&gt;
 # add nodes in encap.txt and a final DROP rule&lt;br /&gt;
 then&lt;br /&gt;
     iptables -F ipipfilter&lt;br /&gt;
     iptables -A ipipfilter -s $AMPRGW -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
     while read ip&lt;br /&gt;
     do&lt;br /&gt;
         iptables -A ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
     done &amp;lt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
     iptables -A ipipfilter -j DROP&lt;br /&gt;
 &lt;br /&gt;
 # ELSE, the CHAIN already exists, determine changes&lt;br /&gt;
 # and INSERT new nodes and DELETE old nodes (excluding AMPRGW)&lt;br /&gt;
 else&lt;br /&gt;
     iptables -L ipipfilter -n | grep ACCEPT | fgrep -v $AMPRGW | \&lt;br /&gt;
         sed -e &#039;s/.*--  //&#039; -e &#039;s/ .*//&#039; | sort | diff - $gwfile | \&lt;br /&gt;
         while read d ip&lt;br /&gt;
         do&lt;br /&gt;
             case &amp;quot;$d&amp;quot; in&lt;br /&gt;
             &amp;quot;&amp;gt;&amp;quot;)&lt;br /&gt;
                 iptables -I ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             &amp;quot;&amp;lt;&amp;quot;)&lt;br /&gt;
                 iptables -D ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             *)&lt;br /&gt;
                 ;;&lt;br /&gt;
             esac&lt;br /&gt;
         done&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 # Delete /tmp/gw when done&lt;br /&gt;
 rm -f $gwfile&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Static IPENCAP Filtering of AMPR Nodes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: this rule (or the dynamic rule above) is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF YOUR WAN&amp;gt;&#039;&#039;&#039; -j ACCEPT &lt;br /&gt;
&lt;br /&gt;
If your AMPR node is downstream, you will create an INPUT &#039;&#039;&#039;and&#039;&#039;&#039; DNAT forward rule to the destination LAN IP of your AMPR node.&lt;br /&gt;
&lt;br /&gt;
To enable receipt of [[RIP]]44&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p udp -s 44.0.0.1 --sport 520 -d 224.0.0.9 --dport 520 -i tunl0 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Masquerade LAN Subnets to AMPRNet&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this instance, eth1 is your 192.168.1.0/24 LAN&lt;br /&gt;
(thanks to Brian, N1URO)&lt;br /&gt;
&lt;br /&gt;
see: https://n1uro.ampr.org/linuxconf/44nat.html&lt;br /&gt;
&lt;br /&gt;
 # NAT setup&lt;br /&gt;
 iptables -t nat -A POSTROUTING -s 192.168.0/24 -o tunl0 -j MASQUERADE -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -m state --state RELATED,ESTABLISHED -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
&lt;br /&gt;
== Microtik ==&lt;br /&gt;
&lt;br /&gt;
== OpenWRT ==&lt;br /&gt;
&lt;br /&gt;
See: iptables (above) and the Instructions for [[setting up a gateway on OpenWRT|setting up a gateway on OpenWRT]].&lt;br /&gt;
&lt;br /&gt;
iptables-based rules can be entered in Network &amp;gt; Firewall &amp;gt; Custom Firewall on the LuCI web interface; or via the command prompt via UCI.&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=727</id>
		<title>Firewalls</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Firewalls&amp;diff=727"/>
		<updated>2017-06-07T17:27:04Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: /* iptables */ added masquerade to 44Net rules&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the Firewall Wiki.&lt;br /&gt;
&lt;br /&gt;
NOTE: This page is intended to be edited by the community to add use practices, command syntax, etc. regarding firewalling and security on AMPRNet nodes. While each operator is ultimately responsible for the administration of their node, it is highly suggested amongst the [[44Net mailing list]] Community that nodes be firewalled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: On an iptables-based firewall, you must enable connection tracking on the tunl0 interface in order to enable Stateful Packet Inspection (i.e. a stateful firewall). Since the IPENCAP Linux Kernel Module IPIP is in the kernel, &#039;&#039;&#039;you must set the default forwarding policy to DROP or REJECT.&#039;&#039;&#039; If you set your default routing policy to ACCEPT, all packets that have not been explicitly DROPped or REJECTed elsewhere, will route, regardless of firewall policies.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Cisco ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== DD-WRT ==&lt;br /&gt;
&lt;br /&gt;
DD-WRT uses an iptables-based firewall (see iptables below). Custom rules can be entered at Administration &amp;gt; Commands &amp;gt; &amp;quot;Save Firewall&amp;quot;&lt;br /&gt;
&lt;br /&gt;
https://www.dd-wrt.com/wiki/index.php/Iptables&lt;br /&gt;
&lt;br /&gt;
https://www.dd-wrt.com/wiki/index.php/Firewall&lt;br /&gt;
&lt;br /&gt;
== D-Link ==&lt;br /&gt;
&lt;br /&gt;
On some D-Link devices, the port forwarding feature allows for the options: TCP, UDP and Other. The &amp;quot;Other&amp;quot; option on these models are capable of Destination NAT of IPENCAP packets.&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4) &#039;&#039;&#039;Note: this rule is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In Port Forwarding&lt;br /&gt;
&lt;br /&gt;
 # Create a new Port Forward&lt;br /&gt;
 # Enter the LAN IP of your AMPR node&lt;br /&gt;
 # Select &amp;quot;Other&amp;quot;&lt;br /&gt;
 # Type the number &#039;&#039;&#039;4&#039;&#039;&#039; into the field&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== iptables ==&lt;br /&gt;
&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS IP TRAFFIC THAT&#039;S INVALID ENTERING OR EXITING AMPR&lt;br /&gt;
 # THIS PREVENTS A GENERAL LOOP&lt;br /&gt;
 iptables -I FORWARD -i tunl0 -o tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND IPs NOT FROM YOUR ALLOCATION (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING ! -s 44.xxx.xxx.xxx/xx -i br-amprnet -j DROP&lt;br /&gt;
 # DROPS ROGUE INBOUND ASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 44.xxx.xxx.xxx/xx -i tunl0 -j DROP&lt;br /&gt;
 # DROPS OUTBOUND UNASSIGNED IPs FROM LOOPING THROUGH tunl0 VIA IPENCAP&lt;br /&gt;
 # YOU MUST ADD A RULE UNDER THIS LINE TO MAKE EXCEPTIONS (BCP 38)&lt;br /&gt;
 iptables -I FORWARD ! -s 44.xxx.xxx.xxx/xx -o tunl0 -j DROP&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # DROPS BOGONS ENTERING AMPRNet&lt;br /&gt;
 # SEE http://www.team-cymru.org/Services/Bogons/bogon-bn-nonagg.txt&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 0.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 10.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 100.64.0.0/10 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 127.0.0.0/8 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 169.254.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 172.16.0.0/12 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.0.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.0.2.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 192.168.0.0/16 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.18.0.0/15 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 198.51.100.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 203.0.113.0/24 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 224.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 iptables -t raw -I PREROUTING -s 240.0.0.0/4 -i tunl0 -j DROP&lt;br /&gt;
 ############################################################&lt;br /&gt;
 # THIS PREVENTS NESTED IPENCAP (BCP 38)&lt;br /&gt;
 iptables -t raw -I PREROUTING -p 4 -i tunl0 -j DROP&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Dynamic IPENCAP Filtering of AMPR Nodes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable dynamic filtering of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: this rule (or the static rule below) is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;REQUIRED: [[ampr-ripd]] (using the -x and -d arguments), the diff command from the [http://www.gnu.org/software/diffutils/manual/diffutils.html diffutils package] and the [https://www.gnu.org/software/sed/manual/sed.html sed command].&lt;br /&gt;
&lt;br /&gt;
 # Place this rule a the last firewall command&lt;br /&gt;
 # Uncomment sleep command below if the rule does not appear&lt;br /&gt;
 # as load_ipipfilter.sh is still executing&lt;br /&gt;
 # sleep 10&lt;br /&gt;
 # load ipipfilter list rule&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF WAN&amp;gt;&#039;&#039;&#039; -j ipipfilter&lt;br /&gt;
&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 # load encap.txt into ipipfilter list&lt;br /&gt;
 # by Rob, PE1CHL&lt;br /&gt;
 # load_ipipfilter.sh&lt;br /&gt;
 &lt;br /&gt;
 PATH=&amp;quot;/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin&amp;quot;&lt;br /&gt;
 AMPRGW=&amp;quot;169.228.34.84&amp;quot;&lt;br /&gt;
 gwfile=&amp;quot;/tmp/gw&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 cd /var/lib/ampr-ripd || exit 1&lt;br /&gt;
 &lt;br /&gt;
 # Parse encap.txt for Node IPs and place in /tmp/gw&lt;br /&gt;
 grep addprivate encap.txt | sed -e &#039;s/.*encap //&#039; | sort -u &amp;gt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
 # Run command to create CHAIN, IF no system output, CHAIN was created&lt;br /&gt;
 iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 if [ $? -eq 0 ]&lt;br /&gt;
 &#039;&#039;&#039;# DO NOT PLACE EMPTY LINES BETWEEN THE TWO COMMANDS ABOVE. ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# THE EQUATION ASKS IF THE LAST SYSTEM COMMAND ENTERED ###&#039;&#039;&#039;&lt;br /&gt;
 &#039;&#039;&#039;# RETURNS &amp;quot;NOTHING.&amp;quot; ADDING A SPACE WILL CHANGE RESULTS OF THE IF COMMAND. ###&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
 ##The two lines above replace the line below, which does not work on OpenWRT&lt;br /&gt;
 # if iptables -N ipipfilter 2&amp;gt;/dev/null&lt;br /&gt;
 ## &lt;br /&gt;
 &lt;br /&gt;
 # IF no system output, THEN flush the CHAIN and add AMPRGW,&lt;br /&gt;
 # add nodes in encap.txt and a final DROP rule&lt;br /&gt;
 then&lt;br /&gt;
     iptables -F ipipfilter&lt;br /&gt;
     iptables -A ipipfilter -s $AMPRGW -j ACCEPT&lt;br /&gt;
 &lt;br /&gt;
     while read ip&lt;br /&gt;
     do&lt;br /&gt;
         iptables -A ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
     done &amp;lt;$gwfile&lt;br /&gt;
 &lt;br /&gt;
     iptables -A ipipfilter -j DROP&lt;br /&gt;
 &lt;br /&gt;
 # ELSE, the CHAIN already exists, determine changes&lt;br /&gt;
 # and INSERT new nodes and DELETE old nodes (excluding AMPRGW)&lt;br /&gt;
 else&lt;br /&gt;
     iptables -L ipipfilter -n | grep ACCEPT | fgrep -v $AMPRGW | \&lt;br /&gt;
         sed -e &#039;s/.*--  //&#039; -e &#039;s/ .*//&#039; | sort | diff - $gwfile | \&lt;br /&gt;
         while read d ip&lt;br /&gt;
         do&lt;br /&gt;
             case &amp;quot;$d&amp;quot; in&lt;br /&gt;
             &amp;quot;&amp;gt;&amp;quot;)&lt;br /&gt;
                 iptables -I ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             &amp;quot;&amp;lt;&amp;quot;)&lt;br /&gt;
                 iptables -D ipipfilter -s $ip -j ACCEPT&lt;br /&gt;
                 ;;&lt;br /&gt;
             *)&lt;br /&gt;
                 ;;&lt;br /&gt;
             esac&lt;br /&gt;
         done&lt;br /&gt;
 fi&lt;br /&gt;
 &lt;br /&gt;
 # Delete /tmp/gw when done&lt;br /&gt;
 rm -f $gwfile&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Static IPENCAP Filtering of AMPR Nodes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To enable input of IPENCAP (IP Protocol Number 4)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: this rule (or the dynamic rule above) is required for other AMPR nodes to initiate inbound traffic to your node.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p 4 -i &#039;&#039;&#039;&amp;lt;INTERFACE OF YOUR WAN&amp;gt;&#039;&#039;&#039; -j ACCEPT &lt;br /&gt;
&lt;br /&gt;
If your AMPR node is downstream, you will create an INPUT &#039;&#039;&#039;and&#039;&#039;&#039; DNAT forward rule to the destination LAN IP of your AMPR node.&lt;br /&gt;
&lt;br /&gt;
To enable receipt of [[RIP]]44&lt;br /&gt;
&lt;br /&gt;
 iptables -t filter -I INPUT -p udp -s 44.0.0.1 --sport 520 -d 224.0.0.9 --dport 520 -i tunl0 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Masquerade LAN Subnets to AMPRNet&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In this instance, eth1 is your 192.168.1.0/24 LAN&lt;br /&gt;
(thanks to Brian, N1URO)&lt;br /&gt;
&lt;br /&gt;
 # NAT setup&lt;br /&gt;
 iptables -t nat -A POSTROUTING -s 192.168.0/24 -o tunl0 -j MASQUERADE -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -m state --state RELATED,ESTABLISHED -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
 iptables -A FORWARD -s 192.168.1/22 -i eth1 -o tunl0 -j ACCEPT -d 44.0.0.0/8&lt;br /&gt;
&lt;br /&gt;
== Microtik ==&lt;br /&gt;
&lt;br /&gt;
== OpenWRT ==&lt;br /&gt;
&lt;br /&gt;
See: iptables (above) and the Instructions for [[setting up a gateway on OpenWRT|setting up a gateway on OpenWRT]].&lt;br /&gt;
&lt;br /&gt;
iptables-based rules can be entered in Network &amp;gt; Firewall &amp;gt; Custom Firewall on the LuCI web interface; or via the command prompt via UCI.&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Startampr&amp;diff=726</id>
		<title>Startampr</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Startampr&amp;diff=726"/>
		<updated>2017-06-05T17:13:15Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: /* Script */  added ToS inherit, this gives outer header same ToS header as inner header&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;startampr&#039;&#039;&#039; is a custom suite of [https://en.wikipedia.org/wiki/Bash_%28Unix_shell%29 Bourne Again Shell] scripts developed by KB3VWG and others in the [[44Net mailing list]] Community, that turns a Debian/Ubuntu-based Linux machine into an AMPR [[Gateway]] on boot; and starts an [https://en.wikipedia.org/wiki/IP_in_IP IPENCAP] (or [https://en.wikipedia.org/wiki/List_of_IP_protocol_numbers IP Protocol] number four) tunnel. The primary advantage to using this suite is that it executes and enables AMPR RIP44 daemons, munge scripts, interfaces and routing commands in proper boot order; and references them using the command syntax, default command arguments and practices that have become the de facto standard on [[AMPRNet]]. It is also minimally invasive, in that the machine otherwise remains an &amp;quot;untouched&amp;quot; default installation; and can be returned to an OEM Ubuntu installation by simply removing all associated files and uninstalling all packages added when configuring the machine to run &#039;&#039;&#039;startampr&#039;&#039;&#039; (please assist me in developing an uninstall script, if interested). Also, if you install a server GUI (e.g. [http://www.webmin.com Webmin]), you can disable the routing features of the machine simply by checking a box, and hitting APPLY (on next reboot, it is disabled). &#039;&#039;&#039;The current versions are 1.0 (no longer developed), and 2.0, released to the [[44Net mailing list]] Community on May 26, 2017 at 14:14 UTC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Detailed Summary ==&lt;br /&gt;
&lt;br /&gt;
In addition to the first and main script, &#039;&#039;&#039;startampr&#039;&#039;&#039;, other tools included with the official release are: init scripts to execute the file, save the routing table (if using a method that does not automatically save it); and an executable script generator (made using [http://linux.die.net/man/1/sed the sed command]) that can restore the AMPR routing table (i.e. in the case the administrator flushes the table). The script uses the [http://www.linuxfoundation.org/collaborate/workgroups/networking/tunneling ipip Linux Kernel module] and implements [http://linux.die.net/man/8/ip Linux ip] routing table&#039;s [https://en.wikipedia.org/wiki/Policy-based_routing policy-based routing] to properly move traffic across the routing plane. It is suggested that [https://en.wikipedia.org/wiki/Iptables iptables] be used to firewall traffic after verification of a proper installation.&lt;br /&gt;
&lt;br /&gt;
The official release uses [[rip44d]] as its [[RIP]]44 protocol daemon; but [[ampr-ripd]] or [[Encap.txt]] with a [[munge script]] may be used (instructions by KB9MWR use ampr-ripd). &#039;&#039;&#039;To operate a [[Gateway]] on [[AMPRNet]], you must have a method of obtaining up-to-date route information. On AMPRNet, a variant of [https://en.wikipedia.org/wiki/Routing_Information_Protocol RIP version 2] protocol, named [[RIP]]44 is used. [https://en.wikipedia.org/wiki/Routing_Information_Protocol RIP version 2] is not the same as [[RIP]]44.&#039;&#039;&#039; rip44d is written in the Perl programming language by Heikki Hannikainen, OH7LZB. [[ampr-ripd]] is written in C by YO2LOJ. The routing table is relatively small, so the performance or memory consumption of this daemon isn&#039;t very critical. The developer choose rip44d simply because it was the only daemon available when version 1.0 was developed. The use of any method to add route information to table 44 will work. It should be noted that: &#039;&#039;&#039;startampr&#039;&#039;&#039; was developed around &#039;&#039;&#039;rip44d&#039;&#039;&#039;; and improves on features not included (e.g. reload of routing table upon reboot). The scripts to backup/restore are not needed when using [[ampr-ripd]] (but can be developed to provide geographically-local tertiary sources of the AMPR routing table).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: if you do not wish to compile software, you must use [[rip44d]] or [[Encap.txt]] with a [[munge script]].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 2.0 Security Update ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;startampr 2.0&#039;s code includes a security fix that corrects a routing issue that allows unencapsulated traffic from the tunnel to leak onto the LAN or Public Internet interface in version 1.0 - this only occurs when a AMPRNnet-facing user attempts to connect using invalid source IPs or invalid AMPRNet IP address&#039;&#039;&#039;. In original development of version 1.0, it was considered that this behavior could be valid to reach subnets ran by operators using the option at: [[Announcing your allocation directly]]; &#039;&#039;&#039;but do not make their tunnel available on a non-44.0.0.0/8 address&#039;&#039;&#039; (it was announced on the [[44Net mailing list]] on 04AUG2015, that AMPRGW now routes traffic to/from BGPed and IPENCAPed AMPR subnets, making this programmatic workaround unnecessary).&lt;br /&gt;
&lt;br /&gt;
It is a generally accepted practice on the Internet that network operators source filter their traffic, making BGPed subnets an exception for AMPRNet Gateways (see [https://tools.ietf.org/html/rfc3013 RFC3013, section 4.3 and 4.4]). It is also accepted AMPRNet practice that these operators consider running a tunneled Gateway on any non-AMPRNet IP available for accessibility to/from those running IPENCAP Gateways. It may be useful to also have redundant VLANs on two or more interfaces possessing the same Public IP at two or more borders; and run a script between the AMPR Gateways - using [https://en.wikipedia.org/wiki/Dynamic_DNS Dynamic DNS] to synchronize them, verify if connectivity goes down on either device&#039;s tunl0 interface and update the [[Portal]] accordingly.&lt;br /&gt;
&lt;br /&gt;
I&#039;m happy and willing to work with any BGP subnet operator who wishes to develop a script to establish an AMPR Gateway for your multi-homed AMPRNet BGPed subnet.&lt;br /&gt;
&lt;br /&gt;
= Requirements, Installation Overview and Features =&lt;br /&gt;
&lt;br /&gt;
# You&#039;ll need a Linux computer, which has been added in the Gateways file using the [[Portal]], so that it is known as an AMPRnet Gateway; and will receive RIP44 updates from the main [[Gateway]]. It will take some time before Amprgw will learn about new gateways.&lt;br /&gt;
# The instructions below are currently only for Debian/Ubuntu, but there&#039;s nothing Debian-specific - it should work fine on other distributions (if the correct packages used (e.g. wget/curl, The Bourne Again Shell/BASH, sed, ip, chmod, PERL, etc.) Interface names, file and folder locations, file permissions, etc. are edited.&lt;br /&gt;
&lt;br /&gt;
You must first properly install:&lt;br /&gt;
* the operating system and network interfaces&lt;br /&gt;
* then properly install &#039;&#039;&#039;startampr&#039;&#039;&#039; at &#039;&#039;&#039;/usr/local/sbin&#039;&#039;&#039; to enable the tunnel. &#039;&#039;&#039;The tunnel interface must be operational and in &#039;UP&#039; status before proceeding.&#039;&#039;&#039;&lt;br /&gt;
* the [[RIP]]44 daemon ([[rip44d]] uses the location &#039;&#039;&#039;/usrlocal/sbin/&#039;&#039;&#039;) which receives periodic routing table updates from the [[AMPRNet]] routing service, and inserts them in the Linux routing table of your choice (most users use table 44; and the scripts use this value as well). &#039;&#039;&#039;You must verify that you are receiving route information before proceeding.&#039;&#039;&#039;&lt;br /&gt;
* boot script for &#039;&#039;&#039;startampr&#039;&#039;&#039;, to &#039;&#039;&#039;/etc/init/&#039;&#039;&#039;&lt;br /&gt;
* (Optional) a script to backup the routing table and create a corresponding restore script, at &#039;&#039;&#039;/etc/cron.hourly/&#039;&#039;&#039;&lt;br /&gt;
* (Optional) a script to restore the AMPRNet routing table on boot, at &#039;&#039;&#039;/etc/if-ip.d/&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Installation of startampr =&lt;br /&gt;
&lt;br /&gt;
Install the the script to &#039;&#039;&#039;/usr/local/sbin&#039;&#039;&#039; and &#039;&#039;&#039;sudo chmod ug+x /usr/local/sbin/startampr&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After obtaining the correct password from the route announcement and entering it into the properly configured script, install the boot and interface-up scripts (sample init scripts provided).&lt;br /&gt;
&lt;br /&gt;
The additional script &#039;&#039;&#039;/etc/cron.hourly/backup_ampr&#039;&#039;&#039; creates an hourly backup of the AMPR routing table, located in two files at &#039;&#039;&#039;/usr/local/sbin&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;/usr/local/sbin/table44_bak &#039;&#039;&#039; - It is a text file that contains a copy of output from the command: &#039;ip route get table 44&#039;&lt;br /&gt;
* &#039;&#039;&#039;/usr/local/sbin/restore44sh&#039;&#039;&#039; - It contains a copy of &#039;&#039;&#039;table44_bak&#039;&#039;&#039; with the command &amp;quot;ip route add table 44 &amp;quot; appended to each line. &#039;&#039;&#039;backup_ampr&#039;&#039;&#039; gives this file executable permissions to user:root and group:root. Execute this file using the command: &#039;&#039;&#039;sudo ./usr/local/sbin/restore44sh&#039;&#039;&#039; to restore your routing table if the need ever occurs.&lt;br /&gt;
&lt;br /&gt;
You can verify the backup is running by issuing the command: &#039;&#039;&#039;ls -l /usr/local/sbin/restore44sh&#039;&#039;&#039; and &#039;&#039;&#039;ls -l /usr/local/sbin/table44_bak&#039;&#039;&#039;&lt;br /&gt;
If the machine has been up, the files should be no more than an hour old.&lt;br /&gt;
&lt;br /&gt;
That should be all. Really. The downside of this configuration is that it will take up to 5 minutes for the gateway to receive a routing update and become operational after a reboot. The additional scripts provided store the current routing table in a local file hourly and load it from there when starting up. Thereafter, after every hour of uptime your routing table is backed up at :17 on the hour. This backup can be used if you ever need to execute the ip command to flush table 44.&lt;br /&gt;
&lt;br /&gt;
= Installation of dependencies on Debian/Ubuntu =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If you use rip44d&#039;&#039;&#039;, install perl, and IO::Socket::Multicast, a Perl module used for receiving the RIP multicast packets&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install perl libio-socket-multicast-perl libio-interface-perl&lt;br /&gt;
&lt;br /&gt;
recommended: &lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install traceroute openssh-server ipset&lt;br /&gt;
&lt;br /&gt;
= Installation of dependencies on other distributions =&lt;br /&gt;
&lt;br /&gt;
Other distributions should have an easy way to install the required packages too (using yum or a similar program). Please fill in details here, if you know them.&lt;br /&gt;
&lt;br /&gt;
= Script =&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #############################################################&lt;br /&gt;
 ###STARTAMPR v2.0 May 26, 2017###&lt;br /&gt;
 ###&lt;br /&gt;
 ### TO DO - Have the AMPRNet Community test and verify&lt;br /&gt;
 ###&lt;br /&gt;
 ### CHANGELOG&lt;br /&gt;
 ###&lt;br /&gt;
 ### v2.0 RC4&lt;br /&gt;
 ### - Dialogue about how to add routes and rules for any created test subnet(s).&lt;br /&gt;
 ###&lt;br /&gt;
 ### v2.0 RC3&lt;br /&gt;
 ### - Exclusively seperates route and tables, as well as priotities by: class and type&lt;br /&gt;
 ### - This makes unnecessary the exclusion of local subnets in ampr-ripd using the &#039;-a&#039; switch,&lt;br /&gt;
 ###   by adding local 44 network(s) to a higher priority routing table&lt;br /&gt;
 ### - This should enable  you can to become a tunnel GW for BGPed 44/8 subnets&lt;br /&gt;
 ### - Provides table 7777 as a BLACKHOLE/NULL Route&lt;br /&gt;
 ### - Adds script to load last hourly backup of table 44 on boot&lt;br /&gt;
 ### -  With script backup_ampr, creates a backup of the routing table a file named table44_bak&lt;br /&gt;
 ###   and an executable restore44sh hourly to use on the running machine to&lt;br /&gt;
 ###   restore table 44  if the table needs to be flushed during uptime&lt;br /&gt;
 ###&lt;br /&gt;
 ### v2.0&lt;br /&gt;
 ### - Streamlined commands and routes&lt;br /&gt;
 ### - Placed syntax for Debian/Ubuntu and OpenWRT/LEDE devices&lt;br /&gt;
 #############################################################&lt;br /&gt;
 ## This script was developed by KB3VWG on a standard&lt;br /&gt;
 ## Ubuntu 16.04.2 LTS PC eth0 configured to the Public facing&lt;br /&gt;
 ## LAN and eth1 to the 44LAN. It is designed to enable an&lt;br /&gt;
 ## AMPR Router using the ampr-ripd v2.0, the standard ampr-ripd,&lt;br /&gt;
 ## using the -t switch to add routes to routing table &#039;44&#039;&lt;br /&gt;
 ## with no further configuration needed (firewall optional)&lt;br /&gt;
 ##############################################################&lt;br /&gt;
 ##################################################################&lt;br /&gt;
 ## This script was modified by LX1DUC to automate even more tasks.&lt;br /&gt;
 ##################################################################&lt;br /&gt;
 ##################################################################&lt;br /&gt;
 ## Thanks to PE1CHL for discovering the need for policy-based routing&lt;br /&gt;
 ## Thanks to KI4SZJ for testing v2.0&lt;br /&gt;
 ##################################################################&lt;br /&gt;
 &lt;br /&gt;
 ### ENABLE IP FORWARDING ###&lt;br /&gt;
 sysctl -w net.ipv4.ip_forward=1&lt;br /&gt;
 ## Allows traceroute to respond using 44net IP of tunl0 or br-amprlan ##&lt;br /&gt;
 echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_errors_use_inbound_ifaddr&lt;br /&gt;
 &lt;br /&gt;
 ################### AMPRNet IPENCAP UBUNTU SYNTAX #######################&lt;br /&gt;
 # modprobe ipip&lt;br /&gt;
 # ip tunnel add tunl0 mode ipip&lt;br /&gt;
 ###NUMBER tunl0 with a /32 from your allocation&lt;br /&gt;
 ###(you may reuse this IP on an Ethernet interface&lt;br /&gt;
 # ip addr add &amp;lt;IP from your 44&amp;gt;/32  dev tunl0&lt;br /&gt;
 # ip link set tunl0 mtu 1480 up&lt;br /&gt;
 # ip tunnel change tunl0 ttl 64 tos inherit pmtudisc&lt;br /&gt;
 &lt;br /&gt;
 ################### AMPRNet IPENCAP OpenWRT/LEDE SYNTAX #######################&lt;br /&gt;
 # ip tunnel add tunl0&lt;br /&gt;
 # ip tunnel change tunl0 mode ipip ttl 64 tos inherit pmtudisc&lt;br /&gt;
 ###(you may reuse this IP on an Ethernet interface&lt;br /&gt;
 # ip addr add &amp;lt;IP from your 44&amp;gt;/32  dev tunl0&lt;br /&gt;
 # ip link set tunl0 mtu 1480 up&lt;br /&gt;
 &lt;br /&gt;
 ################### OPTIONAL - DEFAULT ROUTE FOR INTERNET ACCESS #######################&lt;br /&gt;
 ip route add default dev tunl0 via &amp;lt;AMPRGW_IP&amp;gt; onlink proto 44 table 44&lt;br /&gt;
 &lt;br /&gt;
 ################### POLICY-BADED ROUTING #######################&lt;br /&gt;
 ###OPTIONAL LOCAL RULES&lt;br /&gt;
 ip rule add from &amp;lt;CIDR_44_allocation&amp;gt;  to &amp;lt;LAN e.g. 192.168.1.0/24&amp;gt; table main priority 22&lt;br /&gt;
 &lt;br /&gt;
 #REQUIRED RULES&lt;br /&gt;
 ip rule add to &amp;lt;CIDR_44_allocation&amp;gt;  table main priority 44&lt;br /&gt;
 ip rule add dev tunl0 table 44 priority 45&lt;br /&gt;
 ip rule add dev &amp;lt;interface_for_44LAN&amp;gt; table 44 priority 46&lt;br /&gt;
 ip rule add from &amp;lt;CIDR_44_allocation&amp;gt;  table 44 priority 47&lt;br /&gt;
 &lt;br /&gt;
 ###SOME OF THIS MAY BE NEEDED TO RUN ampr-ripd from another folder than the compile option&lt;br /&gt;
 ###make sure you create the correct save and working folders, etc if you cant recompile ampr-ripd&lt;br /&gt;
 # This directory is not persistent on OpenWRT/LEDE, it must be made on boot for dynamic filtering&lt;br /&gt;
 # mkdir /var/lib/ampr-ripd&lt;br /&gt;
 # Create a blank bootstrap file at /etc/config/encap.txt for this to work&lt;br /&gt;
 # ln -s /etc/config/encap.txt /tmp/lib/ampr-ripd/encap.txt&lt;br /&gt;
 # cd /usr/local/sbin&lt;br /&gt;
 &lt;br /&gt;
 ################### RUN AMPR-RIPD&lt;br /&gt;
 ################### WITH DYNAMIC FIREWALL SCRIPT USING -x&lt;br /&gt;
 ################### see http://wiki.ampr.org/wiki/Firewalls for dynamic script&lt;br /&gt;
 ./ampr-ripd-2.0.x64_Ubuntu16 -i &amp;lt;tunl_interface&amp;gt; -t 44 -a &amp;lt;CIDR_44_allocation&amp;gt; -s -x &#039;/etc/config/load_ipipfilter.sh&#039; -L &amp;lt;CALLSIGN&amp;gt;@&amp;lt;GRID_SQUARE&amp;gt; &amp;amp;&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;startampr documentation uses tunl0 as the tunnel interface (it is the default on RIP44 daemons) and table 44 for those routes. Use the -i &amp;lt;if&amp;gt; and -t &amp;lt;ip table&amp;gt; option to change to another. The command arguments differ between [[rip44d]] and [[ampr-ripd]]. startampr uses rip44d. See the documentation for the RIP44 programs if decide to use custom interfaces, tables or switch to a routing daemon other than [[rip44d]].&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;The script places the routing daemon at /usr/local/sbin/rip44d_&amp;lt;version number&amp;gt; (this assists in preventing inadvertent running of RIP44 Protocol before you have configured startampr.&lt;br /&gt;
* &#039;&#039;&#039;The routing rules do not account for rogue traffic containing both an invalid source and destination IP (which the security of the [[Portal]] generally prevents). Use iptables to DROP forwarding of all traffic entering tunl0 not matching a source or destination of in your allocated subnet(s). This can be done by adding adding rules to drop forwarding, by default, packets not possessing correct source and destination IPs in the range of 44.0.0.0/8, etc.&#039;&#039;&#039;&lt;br /&gt;
* The -a &amp;lt;IP in [[Portal]]&amp;gt; is used to remove your routes from the table (which is incorrect, as they are local). &#039;&#039;&#039;startampr&#039;&#039;&#039; places your local routes in a higher routing table, eliminating the need to use the -a argument. This is a good feature for those who are assigned a dynamic IP address from their Internet Service Provider.&lt;br /&gt;
* The tunnel interface must be up and configured before &#039;&#039;&#039;rip44d&#039;&#039;&#039; starts up. &#039;&#039;&#039;startampr&#039;&#039;&#039; places this command in the proper location.&lt;br /&gt;
* rip44d automatically adds an AMPR route to the Main AMPRNet Gateway on table 44&lt;br /&gt;
* The &#039;&#039;&#039;startampr&#039;&#039;&#039; backup script &#039;&#039;&#039;/etc/cron.hourly/backup_ampr&#039;&#039;&#039; is added to a folder that is configured in Ubuntu, by default, to run scripts at :17 after the hour. The Main AMPR Gateway sends an update every five minutes. For advanced instructions on changing this time interval, see [https://help.ubuntu.com/community/CronHowto the Ubuntu Community cron HowTo].&lt;br /&gt;
* A strict assortment of: file permissions, naming conventions and leading characters (e.g. &#039;&#039;&#039;&amp;quot;#!/bin/bash&amp;quot;&#039;&#039;&#039;) are required in &#039;&#039;&#039;/etc/init/&#039;&#039;&#039;, &#039;&#039;&#039;/etc/if-up.d/&#039;&#039;&#039; (used in a script to reload table 44 on boot) and &#039;&#039;&#039;/etc/cron.hourly/&#039;&#039;&#039;. Note that: &#039;&#039;&#039;startampr&#039;&#039;&#039; has properly named those files. If you wish to edit them, please follow the documentation and README for more details.&lt;br /&gt;
* &#039;&#039;&#039;Please note that: any machine acting as an AMPRNet Gateway must explicitly create high-priority routing rules for all traffic addressed to or from eth0. The network assigned to eth0 must be configured to ONLY use table main.&#039;&#039;&#039; No other valid configuration has been found to properly work (discovered by PE1CHL and tested by KB3VWG and others in the [[44Net mailing list]] Community). &#039;&#039;&#039;This is due to the unique fact that, on AMPRNet routers, 44.0.0.0/8 exists on both the Public (eth0) and AMPRNet-facing (tunl0) sides of the device. There is no way to properly differentiate the route or destination interface of the traffic received from 44.0.0.0/8 over tunl0 (with your 44Router&#039;s 44 IP address), versus that from eth0 (on the Gateway&#039;s Public-facing IP). Meaning, there is no way to route traffic for all cases, except by SOURCE OR DESTINATION IP ADDRESS. Therefore, ALL traffic to and from the network facing eth0, must use eth0.&#039;&#039;&#039; In order to access your AMPRNet from a local network, you must create another routable LAN (and add TO rules, e.g. ip route add to 172.55.0.0/24 table main priority - and masquerade accordingly if configured to reach all of 44.0.0.0/8), or simply connect directly to an AMPR-facing interface. The rule to only use the main table for the eth0 network allows the AMPRNet Gateway to reach 44 hosts on the Public Internet, leaving the operator to provide all routing rules for AMPR-facing interfaces, which is the intent of &#039;&#039;&#039;startampr&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= Support, bug reports and improvements =&lt;br /&gt;
&lt;br /&gt;
If you have questions to ask about the usage of this script, please contact the [[44Net mailing list]].&lt;br /&gt;
&lt;br /&gt;
If you have improvements to the script and wish to submit a patch, please contact KB3VWG on the [[44Net mailing list]], or via contact details in the [[Portal]]. Thank you!&lt;br /&gt;
&lt;br /&gt;
The daemon was written by Lynwood, KB3VWG, and with major contributions from PE1CHL (for implementation of policy-based IP routing), Heikki Hannikainen, OH7LZB (to version 1.0&#039;s integration with &#039;&#039;&#039;[[rip44d]]&#039;&#039;&#039;), and Marc, LX1DUC (to automate enabling of IP forwarding).&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
* [[Ubuntu Linux Gateway Example]]&lt;br /&gt;
* [[Setting up a gateway on Linux]]&lt;br /&gt;
* [[ampr-ripd]]&lt;br /&gt;
* [[Encap.txt]]&lt;br /&gt;
* [[munge script]]&lt;br /&gt;
* [[rip44d]]&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
&lt;br /&gt;
* [http://www.qsl.net/kb9mwr/wapr/tcpip/rip44d.html Alternative installation instructions by KB9MWR]&lt;br /&gt;
* [http://marc.storck.lu/blog/2013/08/howto-setup-an-amprnet-gateway-on-linux/ Alternative installation instructions by Marc, LX1DUC]&lt;br /&gt;
* [(link to KB3VWG&#039;s site here) Detailed Readme and Installation instructions by KB3VWG]&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Startampr&amp;diff=725</id>
		<title>Startampr</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Startampr&amp;diff=725"/>
		<updated>2017-06-05T14:03:13Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: /* Script */ added discovery packet -L argument information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;startampr&#039;&#039;&#039; is a custom suite of [https://en.wikipedia.org/wiki/Bash_%28Unix_shell%29 Bourne Again Shell] scripts developed by KB3VWG and others in the [[44Net mailing list]] Community, that turns a Debian/Ubuntu-based Linux machine into an AMPR [[Gateway]] on boot; and starts an [https://en.wikipedia.org/wiki/IP_in_IP IPENCAP] (or [https://en.wikipedia.org/wiki/List_of_IP_protocol_numbers IP Protocol] number four) tunnel. The primary advantage to using this suite is that it executes and enables AMPR RIP44 daemons, munge scripts, interfaces and routing commands in proper boot order; and references them using the command syntax, default command arguments and practices that have become the de facto standard on [[AMPRNet]]. It is also minimally invasive, in that the machine otherwise remains an &amp;quot;untouched&amp;quot; default installation; and can be returned to an OEM Ubuntu installation by simply removing all associated files and uninstalling all packages added when configuring the machine to run &#039;&#039;&#039;startampr&#039;&#039;&#039; (please assist me in developing an uninstall script, if interested). Also, if you install a server GUI (e.g. [http://www.webmin.com Webmin]), you can disable the routing features of the machine simply by checking a box, and hitting APPLY (on next reboot, it is disabled). &#039;&#039;&#039;The current versions are 1.0 (no longer developed), and 2.0, released to the [[44Net mailing list]] Community on May 26, 2017 at 14:14 UTC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Detailed Summary ==&lt;br /&gt;
&lt;br /&gt;
In addition to the first and main script, &#039;&#039;&#039;startampr&#039;&#039;&#039;, other tools included with the official release are: init scripts to execute the file, save the routing table (if using a method that does not automatically save it); and an executable script generator (made using [http://linux.die.net/man/1/sed the sed command]) that can restore the AMPR routing table (i.e. in the case the administrator flushes the table). The script uses the [http://www.linuxfoundation.org/collaborate/workgroups/networking/tunneling ipip Linux Kernel module] and implements [http://linux.die.net/man/8/ip Linux ip] routing table&#039;s [https://en.wikipedia.org/wiki/Policy-based_routing policy-based routing] to properly move traffic across the routing plane. It is suggested that [https://en.wikipedia.org/wiki/Iptables iptables] be used to firewall traffic after verification of a proper installation.&lt;br /&gt;
&lt;br /&gt;
The official release uses [[rip44d]] as its [[RIP]]44 protocol daemon; but [[ampr-ripd]] or [[Encap.txt]] with a [[munge script]] may be used (instructions by KB9MWR use ampr-ripd). &#039;&#039;&#039;To operate a [[Gateway]] on [[AMPRNet]], you must have a method of obtaining up-to-date route information. On AMPRNet, a variant of [https://en.wikipedia.org/wiki/Routing_Information_Protocol RIP version 2] protocol, named [[RIP]]44 is used. [https://en.wikipedia.org/wiki/Routing_Information_Protocol RIP version 2] is not the same as [[RIP]]44.&#039;&#039;&#039; rip44d is written in the Perl programming language by Heikki Hannikainen, OH7LZB. [[ampr-ripd]] is written in C by YO2LOJ. The routing table is relatively small, so the performance or memory consumption of this daemon isn&#039;t very critical. The developer choose rip44d simply because it was the only daemon available when version 1.0 was developed. The use of any method to add route information to table 44 will work. It should be noted that: &#039;&#039;&#039;startampr&#039;&#039;&#039; was developed around &#039;&#039;&#039;rip44d&#039;&#039;&#039;; and improves on features not included (e.g. reload of routing table upon reboot). The scripts to backup/restore are not needed when using [[ampr-ripd]] (but can be developed to provide geographically-local tertiary sources of the AMPR routing table).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: if you do not wish to compile software, you must use [[rip44d]] or [[Encap.txt]] with a [[munge script]].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 2.0 Security Update ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;startampr 2.0&#039;s code includes a security fix that corrects a routing issue that allows unencapsulated traffic from the tunnel to leak onto the LAN or Public Internet interface in version 1.0 - this only occurs when a AMPRNnet-facing user attempts to connect using invalid source IPs or invalid AMPRNet IP address&#039;&#039;&#039;. In original development of version 1.0, it was considered that this behavior could be valid to reach subnets ran by operators using the option at: [[Announcing your allocation directly]]; &#039;&#039;&#039;but do not make their tunnel available on a non-44.0.0.0/8 address&#039;&#039;&#039; (it was announced on the [[44Net mailing list]] on 04AUG2015, that AMPRGW now routes traffic to/from BGPed and IPENCAPed AMPR subnets, making this programmatic workaround unnecessary).&lt;br /&gt;
&lt;br /&gt;
It is a generally accepted practice on the Internet that network operators source filter their traffic, making BGPed subnets an exception for AMPRNet Gateways (see [https://tools.ietf.org/html/rfc3013 RFC3013, section 4.3 and 4.4]). It is also accepted AMPRNet practice that these operators consider running a tunneled Gateway on any non-AMPRNet IP available for accessibility to/from those running IPENCAP Gateways. It may be useful to also have redundant VLANs on two or more interfaces possessing the same Public IP at two or more borders; and run a script between the AMPR Gateways - using [https://en.wikipedia.org/wiki/Dynamic_DNS Dynamic DNS] to synchronize them, verify if connectivity goes down on either device&#039;s tunl0 interface and update the [[Portal]] accordingly.&lt;br /&gt;
&lt;br /&gt;
I&#039;m happy and willing to work with any BGP subnet operator who wishes to develop a script to establish an AMPR Gateway for your multi-homed AMPRNet BGPed subnet.&lt;br /&gt;
&lt;br /&gt;
= Requirements, Installation Overview and Features =&lt;br /&gt;
&lt;br /&gt;
# You&#039;ll need a Linux computer, which has been added in the Gateways file using the [[Portal]], so that it is known as an AMPRnet Gateway; and will receive RIP44 updates from the main [[Gateway]]. It will take some time before Amprgw will learn about new gateways.&lt;br /&gt;
# The instructions below are currently only for Debian/Ubuntu, but there&#039;s nothing Debian-specific - it should work fine on other distributions (if the correct packages used (e.g. wget/curl, The Bourne Again Shell/BASH, sed, ip, chmod, PERL, etc.) Interface names, file and folder locations, file permissions, etc. are edited.&lt;br /&gt;
&lt;br /&gt;
You must first properly install:&lt;br /&gt;
* the operating system and network interfaces&lt;br /&gt;
* then properly install &#039;&#039;&#039;startampr&#039;&#039;&#039; at &#039;&#039;&#039;/usr/local/sbin&#039;&#039;&#039; to enable the tunnel. &#039;&#039;&#039;The tunnel interface must be operational and in &#039;UP&#039; status before proceeding.&#039;&#039;&#039;&lt;br /&gt;
* the [[RIP]]44 daemon ([[rip44d]] uses the location &#039;&#039;&#039;/usrlocal/sbin/&#039;&#039;&#039;) which receives periodic routing table updates from the [[AMPRNet]] routing service, and inserts them in the Linux routing table of your choice (most users use table 44; and the scripts use this value as well). &#039;&#039;&#039;You must verify that you are receiving route information before proceeding.&#039;&#039;&#039;&lt;br /&gt;
* boot script for &#039;&#039;&#039;startampr&#039;&#039;&#039;, to &#039;&#039;&#039;/etc/init/&#039;&#039;&#039;&lt;br /&gt;
* (Optional) a script to backup the routing table and create a corresponding restore script, at &#039;&#039;&#039;/etc/cron.hourly/&#039;&#039;&#039;&lt;br /&gt;
* (Optional) a script to restore the AMPRNet routing table on boot, at &#039;&#039;&#039;/etc/if-ip.d/&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Installation of startampr =&lt;br /&gt;
&lt;br /&gt;
Install the the script to &#039;&#039;&#039;/usr/local/sbin&#039;&#039;&#039; and &#039;&#039;&#039;sudo chmod ug+x /usr/local/sbin/startampr&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After obtaining the correct password from the route announcement and entering it into the properly configured script, install the boot and interface-up scripts (sample init scripts provided).&lt;br /&gt;
&lt;br /&gt;
The additional script &#039;&#039;&#039;/etc/cron.hourly/backup_ampr&#039;&#039;&#039; creates an hourly backup of the AMPR routing table, located in two files at &#039;&#039;&#039;/usr/local/sbin&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;/usr/local/sbin/table44_bak &#039;&#039;&#039; - It is a text file that contains a copy of output from the command: &#039;ip route get table 44&#039;&lt;br /&gt;
* &#039;&#039;&#039;/usr/local/sbin/restore44sh&#039;&#039;&#039; - It contains a copy of &#039;&#039;&#039;table44_bak&#039;&#039;&#039; with the command &amp;quot;ip route add table 44 &amp;quot; appended to each line. &#039;&#039;&#039;backup_ampr&#039;&#039;&#039; gives this file executable permissions to user:root and group:root. Execute this file using the command: &#039;&#039;&#039;sudo ./usr/local/sbin/restore44sh&#039;&#039;&#039; to restore your routing table if the need ever occurs.&lt;br /&gt;
&lt;br /&gt;
You can verify the backup is running by issuing the command: &#039;&#039;&#039;ls -l /usr/local/sbin/restore44sh&#039;&#039;&#039; and &#039;&#039;&#039;ls -l /usr/local/sbin/table44_bak&#039;&#039;&#039;&lt;br /&gt;
If the machine has been up, the files should be no more than an hour old.&lt;br /&gt;
&lt;br /&gt;
That should be all. Really. The downside of this configuration is that it will take up to 5 minutes for the gateway to receive a routing update and become operational after a reboot. The additional scripts provided store the current routing table in a local file hourly and load it from there when starting up. Thereafter, after every hour of uptime your routing table is backed up at :17 on the hour. This backup can be used if you ever need to execute the ip command to flush table 44.&lt;br /&gt;
&lt;br /&gt;
= Installation of dependencies on Debian/Ubuntu =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If you use rip44d&#039;&#039;&#039;, install perl, and IO::Socket::Multicast, a Perl module used for receiving the RIP multicast packets&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install perl libio-socket-multicast-perl libio-interface-perl&lt;br /&gt;
&lt;br /&gt;
recommended: &lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install traceroute openssh-server ipset&lt;br /&gt;
&lt;br /&gt;
= Installation of dependencies on other distributions =&lt;br /&gt;
&lt;br /&gt;
Other distributions should have an easy way to install the required packages too (using yum or a similar program). Please fill in details here, if you know them.&lt;br /&gt;
&lt;br /&gt;
= Script =&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #############################################################&lt;br /&gt;
 ###STARTAMPR v2.0 May 26, 2017###&lt;br /&gt;
 ###&lt;br /&gt;
 ### TO DO - Have the AMPRNet Community test and verify&lt;br /&gt;
 ###&lt;br /&gt;
 ### CHANGELOG&lt;br /&gt;
 ###&lt;br /&gt;
 ### v2.0 RC4&lt;br /&gt;
 ### - Dialogue about how to add routes and rules for any created test subnet(s).&lt;br /&gt;
 ###&lt;br /&gt;
 ### v2.0 RC3&lt;br /&gt;
 ### - Exclusively seperates route and tables, as well as priotities by: class and type&lt;br /&gt;
 ### - This makes unnecessary the exclusion of local subnets in ampr-ripd using the &#039;-a&#039; switch,&lt;br /&gt;
 ###   by adding local 44 network(s) to a higher priority routing table&lt;br /&gt;
 ### - This should enable  you can to become a tunnel GW for BGPed 44/8 subnets&lt;br /&gt;
 ### - Provides table 7777 as a BLACKHOLE/NULL Route&lt;br /&gt;
 ### - Adds script to load last hourly backup of table 44 on boot&lt;br /&gt;
 ### -  With script backup_ampr, creates a backup of the routing table a file named table44_bak&lt;br /&gt;
 ###   and an executable restore44sh hourly to use on the running machine to&lt;br /&gt;
 ###   restore table 44  if the table needs to be flushed during uptime&lt;br /&gt;
 ###&lt;br /&gt;
 ### v2.0&lt;br /&gt;
 ### - Streamlined commands and routes&lt;br /&gt;
 ### - Placed syntax for Debian/Ubuntu and OpenWRT/LEDE devices&lt;br /&gt;
 #############################################################&lt;br /&gt;
 ## This script was developed by KB3VWG on a standard&lt;br /&gt;
 ## Ubuntu 16.04.2 LTS PC eth0 configured to the Public facing&lt;br /&gt;
 ## LAN and eth1 to the 44LAN. It is designed to enable an&lt;br /&gt;
 ## AMPR Router using the ampr-ripd v2.0, the standard ampr-ripd,&lt;br /&gt;
 ## using the -t switch to add routes to routing table &#039;44&#039;&lt;br /&gt;
 ## with no further configuration needed (firewall optional)&lt;br /&gt;
 ##############################################################&lt;br /&gt;
 ##################################################################&lt;br /&gt;
 ## This script was modified by LX1DUC to automate even more tasks.&lt;br /&gt;
 ##################################################################&lt;br /&gt;
 ##################################################################&lt;br /&gt;
 ## Thanks to PE1CHL for discovering the need for policy-based routing&lt;br /&gt;
 ## Thanks to KI4SZJ for testing v2.0&lt;br /&gt;
 ##################################################################&lt;br /&gt;
 &lt;br /&gt;
 ### ENABLE IP FORWARDING ###&lt;br /&gt;
 sysctl -w net.ipv4.ip_forward=1&lt;br /&gt;
 ## Allows traceroute to respond using 44net IP of tunl0 or br-amprlan ##&lt;br /&gt;
 echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_errors_use_inbound_ifaddr&lt;br /&gt;
 &lt;br /&gt;
 ################### AMPRNet IPENCAP UBUNTU SYNTAX #######################&lt;br /&gt;
 # modprobe ipip&lt;br /&gt;
 # ip tunnel add tunl0 mode ipip&lt;br /&gt;
 ###NUMBER tunl0 with a /32 from your allocation&lt;br /&gt;
 ###(you may reuse this IP on an Ethernet interface&lt;br /&gt;
 # ip addr add &amp;lt;IP from your 44&amp;gt;/32  dev tunl0&lt;br /&gt;
 # ip link set tunl0 mtu 1480 up&lt;br /&gt;
 # ip tunnel change tunl0 ttl 64 pmtudisc&lt;br /&gt;
 &lt;br /&gt;
 ################### AMPRNet IPENCAP OpenWRT/LEDE SYNTAX #######################&lt;br /&gt;
 # ip tunnel add tunl0&lt;br /&gt;
 # ip tunnel change tunl0 mode ipip ttl 64 pmtudisc&lt;br /&gt;
 ###(you may reuse this IP on an Ethernet interface&lt;br /&gt;
 # ip addr add &amp;lt;IP from your 44&amp;gt;/32  dev tunl0&lt;br /&gt;
 # ip link set tunl0 mtu 1480 up&lt;br /&gt;
 &lt;br /&gt;
 ################### OPTIONAL - DEFAULT ROUTE FOR INTERNET ACCESS #######################&lt;br /&gt;
 ip route add default dev tunl0 via &amp;lt;AMPRGW_IP&amp;gt; onlink proto 44 table 44&lt;br /&gt;
 &lt;br /&gt;
 ################### POLICY-BADED ROUTING #######################&lt;br /&gt;
 ###OPTIONAL LOCAL RULES&lt;br /&gt;
 ip rule add from &amp;lt;CIDR_44_allocation&amp;gt;  to &amp;lt;LAN e.g. 192.168.1.0/24&amp;gt; table main priority 22&lt;br /&gt;
 &lt;br /&gt;
 #REQUIRED RULES&lt;br /&gt;
 ip rule add to &amp;lt;CIDR_44_allocation&amp;gt;  table main priority 44&lt;br /&gt;
 ip rule add dev tunl0 table 44 priority 45&lt;br /&gt;
 ip rule add dev &amp;lt;interface_for_44LAN&amp;gt; table 44 priority 46&lt;br /&gt;
 ip rule add from &amp;lt;CIDR_44_allocation&amp;gt;  table 44 priority 47&lt;br /&gt;
 &lt;br /&gt;
 ###SOME OF THIS MAY BE NEEDED TO RUN ampr-ripd from another folder than the compile option&lt;br /&gt;
 ###make sure you create the correct save and working folders, etc if you cant recompile ampr-ripd&lt;br /&gt;
 # This directory is not persistent on OpenWRT/LEDE, it must be made on boot for dynamic filtering&lt;br /&gt;
 # mkdir /var/lib/ampr-ripd&lt;br /&gt;
 # Create a blank bootstrap file at /etc/config/encap.txt for this to work&lt;br /&gt;
 # ln -s /etc/config/encap.txt /tmp/lib/ampr-ripd/encap.txt&lt;br /&gt;
 # cd /usr/local/sbin&lt;br /&gt;
 &lt;br /&gt;
 ################### RUN AMPR-RIPD&lt;br /&gt;
 ################### WITH DYNAMIC FIREWALL SCRIPT USING -x&lt;br /&gt;
 ################### see http://wiki.ampr.org/wiki/Firewalls for dynamic script&lt;br /&gt;
 ./ampr-ripd-2.0.x64_Ubuntu16 -i &amp;lt;tunl_interface&amp;gt; -t 44 -a &amp;lt;CIDR_44_allocation&amp;gt; -s -x &#039;/etc/config/load_ipipfilter.sh&#039; -L &amp;lt;CALLSIGN&amp;gt;@&amp;lt;GRID_SQUARE&amp;gt; &amp;amp;&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;startampr documentation uses tunl0 as the tunnel interface (it is the default on RIP44 daemons) and table 44 for those routes. Use the -i &amp;lt;if&amp;gt; and -t &amp;lt;ip table&amp;gt; option to change to another. The command arguments differ between [[rip44d]] and [[ampr-ripd]]. startampr uses rip44d. See the documentation for the RIP44 programs if decide to use custom interfaces, tables or switch to a routing daemon other than [[rip44d]].&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;The script places the routing daemon at /usr/local/sbin/rip44d_&amp;lt;version number&amp;gt; (this assists in preventing inadvertent running of RIP44 Protocol before you have configured startampr.&lt;br /&gt;
* &#039;&#039;&#039;The routing rules do not account for rogue traffic containing both an invalid source and destination IP (which the security of the [[Portal]] generally prevents). Use iptables to DROP forwarding of all traffic entering tunl0 not matching a source or destination of in your allocated subnet(s). This can be done by adding adding rules to drop forwarding, by default, packets not possessing correct source and destination IPs in the range of 44.0.0.0/8, etc.&#039;&#039;&#039;&lt;br /&gt;
* The -a &amp;lt;IP in [[Portal]]&amp;gt; is used to remove your routes from the table (which is incorrect, as they are local). &#039;&#039;&#039;startampr&#039;&#039;&#039; places your local routes in a higher routing table, eliminating the need to use the -a argument. This is a good feature for those who are assigned a dynamic IP address from their Internet Service Provider.&lt;br /&gt;
* The tunnel interface must be up and configured before &#039;&#039;&#039;rip44d&#039;&#039;&#039; starts up. &#039;&#039;&#039;startampr&#039;&#039;&#039; places this command in the proper location.&lt;br /&gt;
* rip44d automatically adds an AMPR route to the Main AMPRNet Gateway on table 44&lt;br /&gt;
* The &#039;&#039;&#039;startampr&#039;&#039;&#039; backup script &#039;&#039;&#039;/etc/cron.hourly/backup_ampr&#039;&#039;&#039; is added to a folder that is configured in Ubuntu, by default, to run scripts at :17 after the hour. The Main AMPR Gateway sends an update every five minutes. For advanced instructions on changing this time interval, see [https://help.ubuntu.com/community/CronHowto the Ubuntu Community cron HowTo].&lt;br /&gt;
* A strict assortment of: file permissions, naming conventions and leading characters (e.g. &#039;&#039;&#039;&amp;quot;#!/bin/bash&amp;quot;&#039;&#039;&#039;) are required in &#039;&#039;&#039;/etc/init/&#039;&#039;&#039;, &#039;&#039;&#039;/etc/if-up.d/&#039;&#039;&#039; (used in a script to reload table 44 on boot) and &#039;&#039;&#039;/etc/cron.hourly/&#039;&#039;&#039;. Note that: &#039;&#039;&#039;startampr&#039;&#039;&#039; has properly named those files. If you wish to edit them, please follow the documentation and README for more details.&lt;br /&gt;
* &#039;&#039;&#039;Please note that: any machine acting as an AMPRNet Gateway must explicitly create high-priority routing rules for all traffic addressed to or from eth0. The network assigned to eth0 must be configured to ONLY use table main.&#039;&#039;&#039; No other valid configuration has been found to properly work (discovered by PE1CHL and tested by KB3VWG and others in the [[44Net mailing list]] Community). &#039;&#039;&#039;This is due to the unique fact that, on AMPRNet routers, 44.0.0.0/8 exists on both the Public (eth0) and AMPRNet-facing (tunl0) sides of the device. There is no way to properly differentiate the route or destination interface of the traffic received from 44.0.0.0/8 over tunl0 (with your 44Router&#039;s 44 IP address), versus that from eth0 (on the Gateway&#039;s Public-facing IP). Meaning, there is no way to route traffic for all cases, except by SOURCE OR DESTINATION IP ADDRESS. Therefore, ALL traffic to and from the network facing eth0, must use eth0.&#039;&#039;&#039; In order to access your AMPRNet from a local network, you must create another routable LAN (and add TO rules, e.g. ip route add to 172.55.0.0/24 table main priority - and masquerade accordingly if configured to reach all of 44.0.0.0/8), or simply connect directly to an AMPR-facing interface. The rule to only use the main table for the eth0 network allows the AMPRNet Gateway to reach 44 hosts on the Public Internet, leaving the operator to provide all routing rules for AMPR-facing interfaces, which is the intent of &#039;&#039;&#039;startampr&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= Support, bug reports and improvements =&lt;br /&gt;
&lt;br /&gt;
If you have questions to ask about the usage of this script, please contact the [[44Net mailing list]].&lt;br /&gt;
&lt;br /&gt;
If you have improvements to the script and wish to submit a patch, please contact KB3VWG on the [[44Net mailing list]], or via contact details in the [[Portal]]. Thank you!&lt;br /&gt;
&lt;br /&gt;
The daemon was written by Lynwood, KB3VWG, and with major contributions from PE1CHL (for implementation of policy-based IP routing), Heikki Hannikainen, OH7LZB (to version 1.0&#039;s integration with &#039;&#039;&#039;[[rip44d]]&#039;&#039;&#039;), and Marc, LX1DUC (to automate enabling of IP forwarding).&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
* [[Ubuntu Linux Gateway Example]]&lt;br /&gt;
* [[Setting up a gateway on Linux]]&lt;br /&gt;
* [[ampr-ripd]]&lt;br /&gt;
* [[Encap.txt]]&lt;br /&gt;
* [[munge script]]&lt;br /&gt;
* [[rip44d]]&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
&lt;br /&gt;
* [http://www.qsl.net/kb9mwr/wapr/tcpip/rip44d.html Alternative installation instructions by KB9MWR]&lt;br /&gt;
* [http://marc.storck.lu/blog/2013/08/howto-setup-an-amprnet-gateway-on-linux/ Alternative installation instructions by Marc, LX1DUC]&lt;br /&gt;
* [(link to KB3VWG&#039;s site here) Detailed Readme and Installation instructions by KB3VWG]&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Startampr&amp;diff=724</id>
		<title>Startampr</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Startampr&amp;diff=724"/>
		<updated>2017-06-05T14:01:43Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: /* Script */ change optional IP numbering of tunl0 to required&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;startampr&#039;&#039;&#039; is a custom suite of [https://en.wikipedia.org/wiki/Bash_%28Unix_shell%29 Bourne Again Shell] scripts developed by KB3VWG and others in the [[44Net mailing list]] Community, that turns a Debian/Ubuntu-based Linux machine into an AMPR [[Gateway]] on boot; and starts an [https://en.wikipedia.org/wiki/IP_in_IP IPENCAP] (or [https://en.wikipedia.org/wiki/List_of_IP_protocol_numbers IP Protocol] number four) tunnel. The primary advantage to using this suite is that it executes and enables AMPR RIP44 daemons, munge scripts, interfaces and routing commands in proper boot order; and references them using the command syntax, default command arguments and practices that have become the de facto standard on [[AMPRNet]]. It is also minimally invasive, in that the machine otherwise remains an &amp;quot;untouched&amp;quot; default installation; and can be returned to an OEM Ubuntu installation by simply removing all associated files and uninstalling all packages added when configuring the machine to run &#039;&#039;&#039;startampr&#039;&#039;&#039; (please assist me in developing an uninstall script, if interested). Also, if you install a server GUI (e.g. [http://www.webmin.com Webmin]), you can disable the routing features of the machine simply by checking a box, and hitting APPLY (on next reboot, it is disabled). &#039;&#039;&#039;The current versions are 1.0 (no longer developed), and 2.0, released to the [[44Net mailing list]] Community on May 26, 2017 at 14:14 UTC.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Detailed Summary ==&lt;br /&gt;
&lt;br /&gt;
In addition to the first and main script, &#039;&#039;&#039;startampr&#039;&#039;&#039;, other tools included with the official release are: init scripts to execute the file, save the routing table (if using a method that does not automatically save it); and an executable script generator (made using [http://linux.die.net/man/1/sed the sed command]) that can restore the AMPR routing table (i.e. in the case the administrator flushes the table). The script uses the [http://www.linuxfoundation.org/collaborate/workgroups/networking/tunneling ipip Linux Kernel module] and implements [http://linux.die.net/man/8/ip Linux ip] routing table&#039;s [https://en.wikipedia.org/wiki/Policy-based_routing policy-based routing] to properly move traffic across the routing plane. It is suggested that [https://en.wikipedia.org/wiki/Iptables iptables] be used to firewall traffic after verification of a proper installation.&lt;br /&gt;
&lt;br /&gt;
The official release uses [[rip44d]] as its [[RIP]]44 protocol daemon; but [[ampr-ripd]] or [[Encap.txt]] with a [[munge script]] may be used (instructions by KB9MWR use ampr-ripd). &#039;&#039;&#039;To operate a [[Gateway]] on [[AMPRNet]], you must have a method of obtaining up-to-date route information. On AMPRNet, a variant of [https://en.wikipedia.org/wiki/Routing_Information_Protocol RIP version 2] protocol, named [[RIP]]44 is used. [https://en.wikipedia.org/wiki/Routing_Information_Protocol RIP version 2] is not the same as [[RIP]]44.&#039;&#039;&#039; rip44d is written in the Perl programming language by Heikki Hannikainen, OH7LZB. [[ampr-ripd]] is written in C by YO2LOJ. The routing table is relatively small, so the performance or memory consumption of this daemon isn&#039;t very critical. The developer choose rip44d simply because it was the only daemon available when version 1.0 was developed. The use of any method to add route information to table 44 will work. It should be noted that: &#039;&#039;&#039;startampr&#039;&#039;&#039; was developed around &#039;&#039;&#039;rip44d&#039;&#039;&#039;; and improves on features not included (e.g. reload of routing table upon reboot). The scripts to backup/restore are not needed when using [[ampr-ripd]] (but can be developed to provide geographically-local tertiary sources of the AMPR routing table).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE: if you do not wish to compile software, you must use [[rip44d]] or [[Encap.txt]] with a [[munge script]].&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== 2.0 Security Update ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;startampr 2.0&#039;s code includes a security fix that corrects a routing issue that allows unencapsulated traffic from the tunnel to leak onto the LAN or Public Internet interface in version 1.0 - this only occurs when a AMPRNnet-facing user attempts to connect using invalid source IPs or invalid AMPRNet IP address&#039;&#039;&#039;. In original development of version 1.0, it was considered that this behavior could be valid to reach subnets ran by operators using the option at: [[Announcing your allocation directly]]; &#039;&#039;&#039;but do not make their tunnel available on a non-44.0.0.0/8 address&#039;&#039;&#039; (it was announced on the [[44Net mailing list]] on 04AUG2015, that AMPRGW now routes traffic to/from BGPed and IPENCAPed AMPR subnets, making this programmatic workaround unnecessary).&lt;br /&gt;
&lt;br /&gt;
It is a generally accepted practice on the Internet that network operators source filter their traffic, making BGPed subnets an exception for AMPRNet Gateways (see [https://tools.ietf.org/html/rfc3013 RFC3013, section 4.3 and 4.4]). It is also accepted AMPRNet practice that these operators consider running a tunneled Gateway on any non-AMPRNet IP available for accessibility to/from those running IPENCAP Gateways. It may be useful to also have redundant VLANs on two or more interfaces possessing the same Public IP at two or more borders; and run a script between the AMPR Gateways - using [https://en.wikipedia.org/wiki/Dynamic_DNS Dynamic DNS] to synchronize them, verify if connectivity goes down on either device&#039;s tunl0 interface and update the [[Portal]] accordingly.&lt;br /&gt;
&lt;br /&gt;
I&#039;m happy and willing to work with any BGP subnet operator who wishes to develop a script to establish an AMPR Gateway for your multi-homed AMPRNet BGPed subnet.&lt;br /&gt;
&lt;br /&gt;
= Requirements, Installation Overview and Features =&lt;br /&gt;
&lt;br /&gt;
# You&#039;ll need a Linux computer, which has been added in the Gateways file using the [[Portal]], so that it is known as an AMPRnet Gateway; and will receive RIP44 updates from the main [[Gateway]]. It will take some time before Amprgw will learn about new gateways.&lt;br /&gt;
# The instructions below are currently only for Debian/Ubuntu, but there&#039;s nothing Debian-specific - it should work fine on other distributions (if the correct packages used (e.g. wget/curl, The Bourne Again Shell/BASH, sed, ip, chmod, PERL, etc.) Interface names, file and folder locations, file permissions, etc. are edited.&lt;br /&gt;
&lt;br /&gt;
You must first properly install:&lt;br /&gt;
* the operating system and network interfaces&lt;br /&gt;
* then properly install &#039;&#039;&#039;startampr&#039;&#039;&#039; at &#039;&#039;&#039;/usr/local/sbin&#039;&#039;&#039; to enable the tunnel. &#039;&#039;&#039;The tunnel interface must be operational and in &#039;UP&#039; status before proceeding.&#039;&#039;&#039;&lt;br /&gt;
* the [[RIP]]44 daemon ([[rip44d]] uses the location &#039;&#039;&#039;/usrlocal/sbin/&#039;&#039;&#039;) which receives periodic routing table updates from the [[AMPRNet]] routing service, and inserts them in the Linux routing table of your choice (most users use table 44; and the scripts use this value as well). &#039;&#039;&#039;You must verify that you are receiving route information before proceeding.&#039;&#039;&#039;&lt;br /&gt;
* boot script for &#039;&#039;&#039;startampr&#039;&#039;&#039;, to &#039;&#039;&#039;/etc/init/&#039;&#039;&#039;&lt;br /&gt;
* (Optional) a script to backup the routing table and create a corresponding restore script, at &#039;&#039;&#039;/etc/cron.hourly/&#039;&#039;&#039;&lt;br /&gt;
* (Optional) a script to restore the AMPRNet routing table on boot, at &#039;&#039;&#039;/etc/if-ip.d/&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
= Installation of startampr =&lt;br /&gt;
&lt;br /&gt;
Install the the script to &#039;&#039;&#039;/usr/local/sbin&#039;&#039;&#039; and &#039;&#039;&#039;sudo chmod ug+x /usr/local/sbin/startampr&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
After obtaining the correct password from the route announcement and entering it into the properly configured script, install the boot and interface-up scripts (sample init scripts provided).&lt;br /&gt;
&lt;br /&gt;
The additional script &#039;&#039;&#039;/etc/cron.hourly/backup_ampr&#039;&#039;&#039; creates an hourly backup of the AMPR routing table, located in two files at &#039;&#039;&#039;/usr/local/sbin&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;/usr/local/sbin/table44_bak &#039;&#039;&#039; - It is a text file that contains a copy of output from the command: &#039;ip route get table 44&#039;&lt;br /&gt;
* &#039;&#039;&#039;/usr/local/sbin/restore44sh&#039;&#039;&#039; - It contains a copy of &#039;&#039;&#039;table44_bak&#039;&#039;&#039; with the command &amp;quot;ip route add table 44 &amp;quot; appended to each line. &#039;&#039;&#039;backup_ampr&#039;&#039;&#039; gives this file executable permissions to user:root and group:root. Execute this file using the command: &#039;&#039;&#039;sudo ./usr/local/sbin/restore44sh&#039;&#039;&#039; to restore your routing table if the need ever occurs.&lt;br /&gt;
&lt;br /&gt;
You can verify the backup is running by issuing the command: &#039;&#039;&#039;ls -l /usr/local/sbin/restore44sh&#039;&#039;&#039; and &#039;&#039;&#039;ls -l /usr/local/sbin/table44_bak&#039;&#039;&#039;&lt;br /&gt;
If the machine has been up, the files should be no more than an hour old.&lt;br /&gt;
&lt;br /&gt;
That should be all. Really. The downside of this configuration is that it will take up to 5 minutes for the gateway to receive a routing update and become operational after a reboot. The additional scripts provided store the current routing table in a local file hourly and load it from there when starting up. Thereafter, after every hour of uptime your routing table is backed up at :17 on the hour. This backup can be used if you ever need to execute the ip command to flush table 44.&lt;br /&gt;
&lt;br /&gt;
= Installation of dependencies on Debian/Ubuntu =&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;If you use rip44d&#039;&#039;&#039;, install perl, and IO::Socket::Multicast, a Perl module used for receiving the RIP multicast packets&lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install perl libio-socket-multicast-perl libio-interface-perl&lt;br /&gt;
&lt;br /&gt;
recommended: &lt;br /&gt;
&lt;br /&gt;
 sudo apt-get install traceroute openssh-server ipset&lt;br /&gt;
&lt;br /&gt;
= Installation of dependencies on other distributions =&lt;br /&gt;
&lt;br /&gt;
Other distributions should have an easy way to install the required packages too (using yum or a similar program). Please fill in details here, if you know them.&lt;br /&gt;
&lt;br /&gt;
= Script =&lt;br /&gt;
&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 #############################################################&lt;br /&gt;
 ###STARTAMPR v2.0 May 26, 2017###&lt;br /&gt;
 ###&lt;br /&gt;
 ### TO DO - Have the AMPRNet Community test and verify&lt;br /&gt;
 ###&lt;br /&gt;
 ### CHANGELOG&lt;br /&gt;
 ###&lt;br /&gt;
 ### v2.0 RC4&lt;br /&gt;
 ### - Dialogue about how to add routes and rules for any created test subnet(s).&lt;br /&gt;
 ###&lt;br /&gt;
 ### v2.0 RC3&lt;br /&gt;
 ### - Exclusively seperates route and tables, as well as priotities by: class and type&lt;br /&gt;
 ### - This makes unnecessary the exclusion of local subnets in ampr-ripd using the &#039;-a&#039; switch,&lt;br /&gt;
 ###   by adding local 44 network(s) to a higher priority routing table&lt;br /&gt;
 ### - This should enable  you can to become a tunnel GW for BGPed 44/8 subnets&lt;br /&gt;
 ### - Provides table 7777 as a BLACKHOLE/NULL Route&lt;br /&gt;
 ### - Adds script to load last hourly backup of table 44 on boot&lt;br /&gt;
 ### -  With script backup_ampr, creates a backup of the routing table a file named table44_bak&lt;br /&gt;
 ###   and an executable restore44sh hourly to use on the running machine to&lt;br /&gt;
 ###   restore table 44  if the table needs to be flushed during uptime&lt;br /&gt;
 ###&lt;br /&gt;
 ### v2.0&lt;br /&gt;
 ### - Streamlined commands and routes&lt;br /&gt;
 ### - Placed syntax for Debian/Ubuntu and OpenWRT/LEDE devices&lt;br /&gt;
 #############################################################&lt;br /&gt;
 ## This script was developed by KB3VWG on a standard&lt;br /&gt;
 ## Ubuntu 16.04.2 LTS PC eth0 configured to the Public facing&lt;br /&gt;
 ## LAN and eth1 to the 44LAN. It is designed to enable an&lt;br /&gt;
 ## AMPR Router using the ampr-ripd v2.0, the standard ampr-ripd,&lt;br /&gt;
 ## using the -t switch to add routes to routing table &#039;44&#039;&lt;br /&gt;
 ## with no further configuration needed (firewall optional)&lt;br /&gt;
 ##############################################################&lt;br /&gt;
 ##################################################################&lt;br /&gt;
 ## This script was modified by LX1DUC to automate even more tasks.&lt;br /&gt;
 ##################################################################&lt;br /&gt;
 ##################################################################&lt;br /&gt;
 ## Thanks to PE1CHL for discovering the need for policy-based routing&lt;br /&gt;
 ## Thanks to KI4SZJ for testing v2.0&lt;br /&gt;
 ##################################################################&lt;br /&gt;
 &lt;br /&gt;
 ### ENABLE IP FORWARDING ###&lt;br /&gt;
 sysctl -w net.ipv4.ip_forward=1&lt;br /&gt;
 ## Allows traceroute to respond using 44net IP of tunl0 or br-amprlan ##&lt;br /&gt;
 echo 1 &amp;gt; /proc/sys/net/ipv4/icmp_errors_use_inbound_ifaddr&lt;br /&gt;
 &lt;br /&gt;
 ################### AMPRNet IPENCAP UBUNTU SYNTAX #######################&lt;br /&gt;
 # modprobe ipip&lt;br /&gt;
 # ip tunnel add tunl0 mode ipip&lt;br /&gt;
 ###NUMBER tunl0 with a /32 from your allocation&lt;br /&gt;
 ###(you may reuse this IP on an Ethernet interface&lt;br /&gt;
 # ip addr add &amp;lt;IP from your 44&amp;gt;/32  dev tunl0&lt;br /&gt;
 # ip link set tunl0 mtu 1480 up&lt;br /&gt;
 # ip tunnel change tunl0 ttl 64 pmtudisc&lt;br /&gt;
 &lt;br /&gt;
 ################### AMPRNet IPENCAP OpenWRT/LEDE SYNTAX #######################&lt;br /&gt;
 # ip tunnel add tunl0&lt;br /&gt;
 # ip tunnel change tunl0 mode ipip ttl 64 pmtudisc&lt;br /&gt;
 ###(you may reuse this IP on an Ethernet interface&lt;br /&gt;
 # ip addr add &amp;lt;IP from your 44&amp;gt;/32  dev tunl0&lt;br /&gt;
 # ip link set tunl0 mtu 1480 up&lt;br /&gt;
 &lt;br /&gt;
 ################### OPTIONAL - DEFAULT ROUTE FOR INTERNET ACCESS #######################&lt;br /&gt;
 ip route add default dev tunl0 via &amp;lt;AMPRGW_IP&amp;gt; onlink proto 44 table 44&lt;br /&gt;
 &lt;br /&gt;
 ################### POLICY-BADED ROUTING #######################&lt;br /&gt;
 ###OPTIONAL LOCAL RULES&lt;br /&gt;
 ip rule add from &amp;lt;CIDR_44_allocation&amp;gt;  to &amp;lt;LAN e.g. 192.168.1.0/24&amp;gt; table main priority 22&lt;br /&gt;
 &lt;br /&gt;
 #REQUIRED RULES&lt;br /&gt;
 ip rule add to &amp;lt;CIDR_44_allocation&amp;gt;  table main priority 44&lt;br /&gt;
 ip rule add dev tunl0 table 44 priority 45&lt;br /&gt;
 ip rule add dev &amp;lt;interface_for_44LAN&amp;gt; table 44 priority 46&lt;br /&gt;
 ip rule add from &amp;lt;CIDR_44_allocation&amp;gt;  table 44 priority 47&lt;br /&gt;
 &lt;br /&gt;
 ###SOME OF THIS MAY BE NEEDED TO RUN ampr-ripd from another folder than the compile option&lt;br /&gt;
 ###make sure you create the correct save and working folders, etc if you cant recompile ampr-ripd&lt;br /&gt;
 # This directory is not persistent on OpenWRT/LEDE, it must be made on boot for dynamic filtering&lt;br /&gt;
 # mkdir /var/lib/ampr-ripd&lt;br /&gt;
 # Create a blank bootstrap file at /etc/config/encap.txt for this to work&lt;br /&gt;
 # ln -s /etc/config/encap.txt /tmp/lib/ampr-ripd/encap.txt&lt;br /&gt;
 # cd /usr/local/sbin&lt;br /&gt;
 &lt;br /&gt;
 ################### RUN AMPR-RIPD&lt;br /&gt;
 ################### WITH DYNAMIC FIREWALL SCRIPT USING -x&lt;br /&gt;
 ################### see http://wiki.ampr.org/wiki/Firewalls for dynamic script&lt;br /&gt;
 ./ampr-ripd-2.0.x64_Ubuntu16 -i &amp;lt;tunl_interface&amp;gt; -t 44 -a &amp;lt;CIDR_44_allocation&amp;gt; -s -x &#039;/etc/config/load_ipipfilter.sh&#039; &amp;amp;&lt;br /&gt;
&lt;br /&gt;
= Notes =&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;startampr documentation uses tunl0 as the tunnel interface (it is the default on RIP44 daemons) and table 44 for those routes. Use the -i &amp;lt;if&amp;gt; and -t &amp;lt;ip table&amp;gt; option to change to another. The command arguments differ between [[rip44d]] and [[ampr-ripd]]. startampr uses rip44d. See the documentation for the RIP44 programs if decide to use custom interfaces, tables or switch to a routing daemon other than [[rip44d]].&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;The script places the routing daemon at /usr/local/sbin/rip44d_&amp;lt;version number&amp;gt; (this assists in preventing inadvertent running of RIP44 Protocol before you have configured startampr.&lt;br /&gt;
* &#039;&#039;&#039;The routing rules do not account for rogue traffic containing both an invalid source and destination IP (which the security of the [[Portal]] generally prevents). Use iptables to DROP forwarding of all traffic entering tunl0 not matching a source or destination of in your allocated subnet(s). This can be done by adding adding rules to drop forwarding, by default, packets not possessing correct source and destination IPs in the range of 44.0.0.0/8, etc.&#039;&#039;&#039;&lt;br /&gt;
* The -a &amp;lt;IP in [[Portal]]&amp;gt; is used to remove your routes from the table (which is incorrect, as they are local). &#039;&#039;&#039;startampr&#039;&#039;&#039; places your local routes in a higher routing table, eliminating the need to use the -a argument. This is a good feature for those who are assigned a dynamic IP address from their Internet Service Provider.&lt;br /&gt;
* The tunnel interface must be up and configured before &#039;&#039;&#039;rip44d&#039;&#039;&#039; starts up. &#039;&#039;&#039;startampr&#039;&#039;&#039; places this command in the proper location.&lt;br /&gt;
* rip44d automatically adds an AMPR route to the Main AMPRNet Gateway on table 44&lt;br /&gt;
* The &#039;&#039;&#039;startampr&#039;&#039;&#039; backup script &#039;&#039;&#039;/etc/cron.hourly/backup_ampr&#039;&#039;&#039; is added to a folder that is configured in Ubuntu, by default, to run scripts at :17 after the hour. The Main AMPR Gateway sends an update every five minutes. For advanced instructions on changing this time interval, see [https://help.ubuntu.com/community/CronHowto the Ubuntu Community cron HowTo].&lt;br /&gt;
* A strict assortment of: file permissions, naming conventions and leading characters (e.g. &#039;&#039;&#039;&amp;quot;#!/bin/bash&amp;quot;&#039;&#039;&#039;) are required in &#039;&#039;&#039;/etc/init/&#039;&#039;&#039;, &#039;&#039;&#039;/etc/if-up.d/&#039;&#039;&#039; (used in a script to reload table 44 on boot) and &#039;&#039;&#039;/etc/cron.hourly/&#039;&#039;&#039;. Note that: &#039;&#039;&#039;startampr&#039;&#039;&#039; has properly named those files. If you wish to edit them, please follow the documentation and README for more details.&lt;br /&gt;
* &#039;&#039;&#039;Please note that: any machine acting as an AMPRNet Gateway must explicitly create high-priority routing rules for all traffic addressed to or from eth0. The network assigned to eth0 must be configured to ONLY use table main.&#039;&#039;&#039; No other valid configuration has been found to properly work (discovered by PE1CHL and tested by KB3VWG and others in the [[44Net mailing list]] Community). &#039;&#039;&#039;This is due to the unique fact that, on AMPRNet routers, 44.0.0.0/8 exists on both the Public (eth0) and AMPRNet-facing (tunl0) sides of the device. There is no way to properly differentiate the route or destination interface of the traffic received from 44.0.0.0/8 over tunl0 (with your 44Router&#039;s 44 IP address), versus that from eth0 (on the Gateway&#039;s Public-facing IP). Meaning, there is no way to route traffic for all cases, except by SOURCE OR DESTINATION IP ADDRESS. Therefore, ALL traffic to and from the network facing eth0, must use eth0.&#039;&#039;&#039; In order to access your AMPRNet from a local network, you must create another routable LAN (and add TO rules, e.g. ip route add to 172.55.0.0/24 table main priority - and masquerade accordingly if configured to reach all of 44.0.0.0/8), or simply connect directly to an AMPR-facing interface. The rule to only use the main table for the eth0 network allows the AMPRNet Gateway to reach 44 hosts on the Public Internet, leaving the operator to provide all routing rules for AMPR-facing interfaces, which is the intent of &#039;&#039;&#039;startampr&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
= Support, bug reports and improvements =&lt;br /&gt;
&lt;br /&gt;
If you have questions to ask about the usage of this script, please contact the [[44Net mailing list]].&lt;br /&gt;
&lt;br /&gt;
If you have improvements to the script and wish to submit a patch, please contact KB3VWG on the [[44Net mailing list]], or via contact details in the [[Portal]]. Thank you!&lt;br /&gt;
&lt;br /&gt;
The daemon was written by Lynwood, KB3VWG, and with major contributions from PE1CHL (for implementation of policy-based IP routing), Heikki Hannikainen, OH7LZB (to version 1.0&#039;s integration with &#039;&#039;&#039;[[rip44d]]&#039;&#039;&#039;), and Marc, LX1DUC (to automate enabling of IP forwarding).&lt;br /&gt;
&lt;br /&gt;
=See also=&lt;br /&gt;
&lt;br /&gt;
* [[Ubuntu Linux Gateway Example]]&lt;br /&gt;
* [[Setting up a gateway on Linux]]&lt;br /&gt;
* [[ampr-ripd]]&lt;br /&gt;
* [[Encap.txt]]&lt;br /&gt;
* [[munge script]]&lt;br /&gt;
* [[rip44d]]&lt;br /&gt;
&lt;br /&gt;
= Links =&lt;br /&gt;
&lt;br /&gt;
* [http://www.qsl.net/kb9mwr/wapr/tcpip/rip44d.html Alternative installation instructions by KB9MWR]&lt;br /&gt;
* [http://marc.storck.lu/blog/2013/08/howto-setup-an-amprnet-gateway-on-linux/ Alternative installation instructions by Marc, LX1DUC]&lt;br /&gt;
* [(link to KB3VWG&#039;s site here) Detailed Readme and Installation instructions by KB3VWG]&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
	<entry>
		<id>https://wiki.ampr.org/w/index.php?title=Archive/Main_Page&amp;diff=718</id>
		<title>Archive/Main Page</title>
		<link rel="alternate" type="text/html" href="https://wiki.ampr.org/w/index.php?title=Archive/Main_Page&amp;diff=718"/>
		<updated>2017-05-27T12:24:22Z</updated>

		<summary type="html">&lt;p&gt;Kb3vwg: added date to AMPRGW IP change notice&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Welcome to the AMPRNet Wiki.&lt;br /&gt;
&lt;br /&gt;
Since its allocation to Amateur Radio in the mid-1980&#039;s, Internet network 44 (44.0.0.0/8), known as the AMPRNet™, has been used by amateur radio operators to conduct scientific research and to experiment with digital communications over radio with a goal of advancing the state of the art of Amateur Radio networking, and to educate amateur radio operators in these techniques. - [http://www.ampr.org/ www.ampr.org]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;IMPORTANT INFORMATION:&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;MAY 2017 - Please be advised that the IP of AMPRGW will change in the near future, see the Services page for the new host address.&#039;&#039;&#039;&lt;br /&gt;
__NOTOC__&lt;br /&gt;
== Starting points ==&lt;br /&gt;
* [[Quickstart]] guide for getting onto the [[AMPRNet]]&lt;br /&gt;
* Basic information about the [[AMPRNet]] and the [[ampr.org]] domain&lt;br /&gt;
* [[Services]] available on AMPRNet&lt;br /&gt;
* If you are looking to get an IP allocation within the 44/8 AMPRNet please read the [[Portal]] page.&lt;br /&gt;
* Frequently Asked Questions (FAQ) [[FAQ]]&lt;br /&gt;
&lt;br /&gt;
== How to connect to AMPRNet ==&lt;br /&gt;
&lt;br /&gt;
* Instructions for [[Setting up a gateway on Linux|setting up a Linux gateway]]&lt;br /&gt;
* Instructions for [[Setting up a gateway on OpenBSD|setting up an OpenBSD gateway]]&lt;br /&gt;
* Instructions for [[setting up a gateway on Cisco Routers|setting up a  gateway on Cisco Routers]].&lt;br /&gt;
* Instructions for [[setting up a gateway on MikroTik Routers|setting up a  gateway on MikroTik Routers]].&lt;br /&gt;
* Instructions for [[setting up a gateway on OpenWRT|setting up a gateway on OpenWRT]].&lt;br /&gt;
* Instructions for [[setting up a gateway on Ubiquiti EdgeRouter|setting up a gateway on Ubiquiti EdgeRouter]].&lt;br /&gt;
* Instructions for [[announcing your allocation directly|directly announcing your allocation via your Internet Service Provider (ISP)]].&lt;br /&gt;
* Instructions for [[AMPRNet VPN|Accessing AMPRNet via VPN]] (experimental).&lt;br /&gt;
* &amp;lt;b&amp;gt;[[Why can&#039;t I just route my AMPRNet allocation directly myself ?]]&amp;lt;/b&amp;gt;&lt;br /&gt;
* If you already operate a [[gateway]] please ensure you have registered on the [[portal]] and &amp;quot;claimed&amp;quot; your [[gateway]].&lt;br /&gt;
&lt;br /&gt;
== Mailing List ==&lt;br /&gt;
To keep up-to-date on AMPRNet information please consider joining the [[44Net mailing list]].&lt;br /&gt;
&lt;br /&gt;
== Contribute! ==&lt;br /&gt;
If you wish to contribute to the wiki, please send an email to &amp;lt;tt&amp;gt;wiki (at) ampr.org&amp;lt;/tt&amp;gt; introducing yourself. Please specify your full name, amateur radio callsign and your preferred username. A login will then be created for you.&lt;br /&gt;
&lt;br /&gt;
== Terms of Service ==&lt;br /&gt;
Use of 44.0.0.0/8 address space is governed by these [http://www.ampr.org/terms-of-service/ Terms of Service]&lt;br /&gt;
&lt;br /&gt;
== All Pages ==&lt;br /&gt;
[http://wiki.ampr.org/wiki/Special:AllPages Here&#039;s a list of all pages currently on the AMPRNet Wiki]&lt;/div&gt;</summary>
		<author><name>Kb3vwg</name></author>
	</entry>
</feed>