Add sample 'findgw' scripts to the Multi-ISP doc

Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
Tom Eastep 2015-05-29 13:44:26 -07:00
parent 4edd6026f0
commit cfc6b7405f

View File

@ -119,7 +119,7 @@
ISP.</para>
</footnote> as in the following diagram.</para>
<graphic align="center" fileref="images/TwoISPs.png" valign="middle" />
<graphic align="center" fileref="images/TwoISPs.png" valign="middle"/>
<itemizedlist>
<listitem>
@ -342,6 +342,33 @@
may try to use those stale files to determine the gateway
address.</para>
<para>If Shorewall is unable to detect the gateway, it is likely
because you are using a DHCP client that Shorewall doesn't
natively support. You can work around that issue by using the
<emphasis role="bold">findgw</emphasis> <ulink
url="shorewall_extension_scripts.htm">extension
script.</ulink></para>
<para>For example, these examples from Mika Ilmaranta, work with
RHEL7-based systems with nmcli:</para>
<programlisting>nmcli --terse --fields IP6.GATEWAY device show ${1} | cut -f2- -d':' # IPv6
nmcli --terse --fields IP4.GATEWAY device show ${1} | cut -f2- -d':' #IPv4
</programlisting>
<para>This one from PGNd works on OpenSuSE running wicked:</para>
<programlisting>svc_status=$( systemctl is-active wickedd-dhcp4.service )
if [ $svc_status == 'active' ]; then
data="/var/lib/wicked/lease-${1}-dhcp-ipv4.xml"
if [ -f $data ]; then
gateway=$( xml_grep 'gateway' $data --text_only )
echo $gateway
fi
fi</programlisting>
<para>The GATEWAY may be omitted (enter '-') for point-to-point
links.</para>
</listitem>
@ -2480,7 +2507,7 @@ exit 0
on ursa that I will describe here</emphasis>.</para>
<para>Below is a diagram of our network:<graphic align="center"
fileref="images/Network2008a.png" /></para>
fileref="images/Network2008a.png"/></para>
<para>The local wired network in my office is connected to both gateways
and uses the private (RFC 1918) network 172.20.1.0/24. The Comcast
@ -2651,7 +2678,7 @@ wlan0 192.168.0.0/24</programlisting><note>
<para>The network is pictured in the following diagram:</para>
<graphic fileref="images/Network2013.png" />
<graphic fileref="images/Network2013.png"/>
<section>
<title>IPv4 Configuration</title>