openvpn-bonding icon indicating copy to clipboard operation
openvpn-bonding copied to clipboard

Client error on startbond.sh: Error: any valid address is expected rather than "dev".

Open Brettk80 opened this issue 2 years ago • 2 comments

brett@raspberrypi:/etc/openvpn $ sudo ./startbond.sh 2024-02-13 15:42:55 TUN/TAP device tap1 opened 2024-02-13 15:42:55 Persist state set to: ON 2024-02-13 15:42:55 TUN/TAP device tap2 opened 2024-02-13 15:42:55 Persist state set to: ON ########################################### adding routing table vpn1 Tunnel Interface 1 is eth1 with IP address 192.168.0.39/24 ########################################### adding routing table vpn2 Tunnel Interface 2 is usb0 with IP address 192.168.185.161/24 Error: any valid address is expected rather than "dev". ###########################################

Brettk80 avatar Feb 13 '24 15:02 Brettk80

run "ip route show" and see what position in the string the gateway address is for usb0. Probably need to change line 71 to :

tunnelInterfaceGW=$(ip r | grep 'default.*'${tunnelInterface} | awk '{print $9}') specifically for usb0.

You can also add a check like this:

tunnelInterfaceGW=""
# let's read out the default gateway from the main table
if [ "$tunnelInterface" = "qmimux0" ] || [ "$tunnelInterface" = "qmimux1" ] || [ "$tunnelInterface" = "ubs0" ] ;
then
    tunnelInterfaceGW=$(ip r | grep 'default.*'${tunnelInterface} | awk '{print $9}')
else
    tunnelInterfaceGW=$(ip r | grep 'default.*'${tunnelInterface} | awk '{print $3}')
fi

(For simcard interfaces such as qmimux0 / qmimux1 the gateway address is also at position 9 in the output string)

AGIinspired avatar Apr 12 '24 07:04 AGIinspired

Unplug the internet connections from the connector and reconnect them. It worked for me.

Gmmadj avatar Apr 29 '24 12:04 Gmmadj