mirror of
https://gitlab.com/shorewall/code.git
synced 2024-12-22 14:20:40 +01:00
Add sample 'findgw' scripts to the Multi-ISP doc
Signed-off-by: Tom Eastep <teastep@shorewall.net>
This commit is contained in:
parent
4edd6026f0
commit
cfc6b7405f
@ -342,6 +342,33 @@
|
|||||||
may try to use those stale files to determine the gateway
|
may try to use those stale files to determine the gateway
|
||||||
address.</para>
|
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
|
<para>The GATEWAY may be omitted (enter '-') for point-to-point
|
||||||
links.</para>
|
links.</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
|
Loading…
Reference in New Issue
Block a user