Hi nilot,
Thanks for the question!
Here is what I did on my machine to set an interface to static. I am still playing with how to automate the command you are interested in through NetworkManager. I currently have an alias set up (in zsh) to run the command.
To create an alias for the command to start the DHCP service with dnsmasq:
alias -g os1-dhcp='sudo dnsmasq -C /dev/null -kd -F 10.5.5.50,10.5.5.100 -i eth1 --bind-dynamic'
You could run the start DHCP command at startup as a temporary solution until we find a better way with NetworkManager.
Setting Static IP on an Interface:
Edit the interfaces
file with this command (vim
or your favorite text editor)
sudo vim /etc/network/interfaces
Substitute eth1
for the name of your interface that you would like to bind to the 10.5.5.1 IP address.
eth0
on my machine is used to connect to the internet, which is why I left it using DHCP. If you want to do the same, then just replace eth0
with the name of your internet interface.
# interfaces(5) file used by ifup(8) and ifdown(8)
# Loopback interface for local connections
auto lo
iface lo inet loopback
#Interface for getting to the Internet
auto eth0
iface eth0 inet dhcp
# Interface to bind for use with the OS1 lidar
auto eth1
iface eth1 inet static
address 10.5.5.1
netmask 255.255.255.0
"For these settings to take effect you need to restart your networking services."
sudo /etc/init.d/networking restart
Reference used: NetworkConfigurationCommandLine/Automatic (last edited 2015-07-18 12:02:04 by peter-hentrich)