Voxl 2 Mini Static IP
-
https://docs.modalai.com/voxl2-mini-shell-access/
The bottom of this doc says "If using wired ethernet, set up a static IP address." but I've tried doing ifconfig eth0 ~ip address~ netmask ~subnet~ to no avail. I've also tried ip addr add xxx.xxx.xxx.xxx/yy dev eth0 to no avail (always sets ip to 169.254.4.1). I know the Voxl 2 wasn't able to have a static ip set so if it is the same for the mini then so be it, the doc just made it seem like it may be possible so I was just curious
-
@bendraper It is possible to set a static ip on both the voxl2 and voxl2 mini.
It is just ubuntu OS. What modem/router are you connecting to?
-
@wilkinsaf I was just connecting to my laptop for now. Laptop set with a static IP
-
Here is what one of my guys uses
ip addr flush dev eth0 ip link set dev eth0 up ip addr add 192.168.1.100/255.255.255.0 dev eth0
-
i would make sure that the ethernet is the only thing connected that is supplying network connectivity. (no modem, 4g/5g hat, etc...)
otherwise you willl need to do some extra configuration with voxl-modem -
@wilkinsaf This worked! Thank you
-
@wilkinsaf Actually it seems these settings don't stick after rebooting the voxl... Any ideas?
-
@wilkinsaf google seems to suggest changing a /etc/network/interfaces file may do the trick but this file does not exist in the voxl filesystem
-
If you make a script to do this, you might want to make it monitor eth0 state so if eth0 goes down and back up, the IP doesn't get removed.
Here's a bash example of what I do to check the IP address of ethernet and put it back if it goes down and back upwhile true do if [[ -e "/sys/class/net/$eth_dongle_interface" ]]; then eth_dongle_ip=$(ip -4 addr show $eth_dongle_interface | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | head -1) else eth_dongle_ip="" fi if [[ "$eth_dongle_ip" != *"$ETHERNET_IP"* && -e "/sys/class/net/$eth_dongle_interface" ]]; then echo "setting IP address to: $ETHERNET_IP" ip addr flush dev $eth_dongle_interface sleep 1 ip link set dev $eth_dongle_interface up sleep 1 ip addr add $ETHERNET_IP/255.255.255.0 dev $eth_dongle_interface fi sleep 1 done
Of course, this is in my modified voxl-modem with custom variables for the interface (eth0 or eth1) and variables for the IP address. You might just want to hard code those when testing.