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

@ -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>