Browse Source

wg-installer: cosmetic changes

Use "ip addr" instead of "ip addres" or "ip a".

Signed-off-by: Nick Hainke <vincent@systemli.org>
lilik-openwrt-22.03
Nick Hainke 3 years ago
parent
commit
38a9a3e0dc
3 changed files with 6 additions and 6 deletions
  1. +1
    -1
      net/wg-installer/common/wg.sh
  2. +2
    -2
      net/wg-installer/wg-client/wg-client-installer.sh
  3. +3
    -3
      net/wg-installer/wg-server/lib/wg_functions.sh

+ 1
- 1
net/wg-installer/common/wg.sh View File

@ -29,7 +29,7 @@ check_wg_neighbors() {
wg_interfaces=$(ip link | grep wg | awk '{print $2}' | sed 's/://')
for phy in $wg_interfaces; do
linklocal=$(ip -6 a list dev $phy | grep "scope link" | awk '{print $2}' | sed 's/\/64//') 2>/dev/null
linklocal=$(ip -6 addr list dev $phy | grep "scope link" | awk '{print $2}' | sed 's/\/64//') 2>/dev/null
ips=$(ping ff02::1%$phy -w5 -W5 -c10 | awk '/from/{print($4)}' | sed 's/.$//') 2>/dev/null
delete=1
for ip in $ips; do


+ 2
- 2
net/wg-installer/wg-client/wg-client-installer.sh View File

@ -86,8 +86,8 @@ register_client_interface () {
ip link add dev $ifname type wireguard
ip -6 a a dev $ifname $client_ip
ip -6 a a dev $ifname fe80::2/64
ip -6 addr add dev $ifname $client_ip
ip -6 addr add dev $ifname fe80::2/64
wg set $ifname listen-port $port private-key $privkey peer $pubkey allowed-ips 0.0.0.0/0,::0/0 endpoint "${endpoint}:${gw_port}"
ip link set up dev $ifname
ip link set mtu $mtu_client dev $ifname # configure mtu here!


+ 3
- 3
net/wg-installer/wg-server/lib/wg_functions.sh View File

@ -65,14 +65,14 @@ wg_register () {
# create wg tunnel
ip link add dev $ifname type wireguard
wg set $ifname listen-port $port private-key $gw_key peer $public_key allowed-ips 0.0.0.0/0,::0/0
ip -6 address add $gw_ip_assign dev $ifname
ip -6 address add fe80::1/64 dev $ifname
ip -6 addr add $gw_ip_assign dev $ifname
ip -6 addr add fe80::1/64 dev $ifname
v4prefix=$(uci get wgserver.@server[0].base_v4prefix)
if [ $? -eq 0 ]; then
gw_ipv4=$(owipcalc $v4prefix add $offset next 32) # gateway ip
gw_ipv4_assign="${gw_ipv4}/32"
ip address add $gw_ipv4_assign broadcast 255.255.255.255 dev $ifname
ip addr add $gw_ipv4_assign broadcast 255.255.255.255 dev $ifname
fi
ip link set up dev $ifname


Loading…
Cancel
Save