From afb29b1be3639f2582bfea4d0e0e5fe16482a328 Mon Sep 17 00:00:00 2001 From: Maksim Ivanov <34414986+Ld-Hagen@users.noreply.github.com> Date: Tue, 14 Sep 2021 21:28:32 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=BC=D1=8F=20WAN=20=D0=B8=D0=BD=D1=82?= =?UTF-8?q?=D0=B5=D1=80=D1=84=D0=B5=D0=B9=D1=81=D0=B0=20=D1=82=D0=B5=D0=BF?= =?UTF-8?q?=D0=B5=D1=80=D1=8C=20=D1=85=D1=80=D0=B0=D0=BD=D0=B8=D1=82=D1=81?= =?UTF-8?q?=D1=8F=20=D0=B2=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=BD=D0=BE=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- white_ip.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/white_ip.sh b/white_ip.sh index 75f0c91..b377464 100644 --- a/white_ip.sh +++ b/white_ip.sh @@ -2,6 +2,7 @@ #Подсеть и маска net_addr="100.64.0.0" net_mask="10" +wan_iface="pppoe-wan" #Преобразование IP адреса в число ip2int () @@ -19,7 +20,7 @@ start_int=`ip2int $net_addr` (( end_int = start_int + 2 ** ( 32 - net_mask ) - 1 )) #Получение адреса wan интерфейса, при необходимости замените на свой вариант -ip=$(ip -f inet -o addr show pppoe-wan|cut -d\ -f 7 | cut -d/ -f 1) +ip=$(ip -f inet -o addr show $wan_iface | cut -d\ -f 7 | cut -d/ -f 1) ip_int=`ip2int $ip` echo `date` Current IP is $ip "("$ip_int")"