I'm running an image (Yocto) on a SabreSD board and wonder how I change from DCHP client mode to static mode, when it comes to setting the network port?
How do I a turn on/off DHCP from the command line?
Also, how do I change the MAC address?
To disable DHCP, please remove it(ip=dhcp) in uboot command line;
To use a static IP, you can use ifconfig command such as:
ifconfig eth0 10.192.242.117
To change MAC address, you can use below command in commandline:
This means that I can only run the image with either DCHP on or off.
In our case we want to be able to change it dynamically, when the Linux image is running.
I found in /etc/networking/interfaces that I think I should be able to change this setting.
As for MAC address it can be permanently changed by burning e-fuse.
Alternatively you can add the command like this
ifconfig eth0 hw ether 00:04:9f:00:e9:bb
into init script of the system to overwrite the value.
The better way to configure eth0 for a static IP address, rather than dhcp, is like this in the /etc/network/interfaces file:
# Wired or wireless interfaces
#iface eth0 inet dhcp
iface eth0 inet static
There is a good tutorial here: