I need to set up an ethernet connection to a LIDAR, the steps to do so are:
Without the sensor connected to PC
sudo ip addr add 10.5.5.1/24 dev enp12s0
where enp12s0
is the name of my computers ethernet network interface, found by ifconfig
.
Then connect the sensor and
sudo ip link set enp12s0 up
sudo dnsmasq -C /dev/null -kd -F 10.5.5.50,10.5.5.100 -i enp12s0 --bind-dynamic
I was curious if I could automate this? I have tried changing the netplan yaml
config file, as well as adding wired connection types through gnomes network interface gui. But I can't seem to get it working.
My hope is to be able to make a profile where I can click on the wired connections in gnome and select this instead of having to redo the above steps all the time. How would I go about doing this?
Note: this is for ubuntu 20.04 LTS.
enp12s0
for other connections as well or is it sufficient to run a configuration script when the interface is brought up?