OMAPL138设置静态 IP 和修改MAC地址

一、设置静态IP

将自动获取的 udhcpc server 改名,就可以屏蔽自动获取 IP
root@wd:~# mv /sbin/udhcpc /sbin/bak-udhcpc
然后在 etc/network/interfaces 文件里增加静态 IP,修改如下:
root@wd:~# vi /etc/network/interfaces
# Wired or wireless interfaces
#auto eth0
#iface eth0 inet dhcp
#iface eth1 inet dhcp
auto eth0
iface eth0 inet static
address 192.168.4.100
netmask 255.255.255.0
network 192.168.4.0
gateway 192.168.4.1

二、修改MAC地址

Linux 下修改MAC地址:
ifconfig eth0 down
ifconfig eth0 hw ether A0:F6:FD:60:C9:B0
ifconfig eth0 up
Linux下修改MAC地址断电后就会丢失

Uboot命令下修改MAC地址:
setenv ethaddr A0:F6:FD:60:C9:B0
saveenv
Uboot命令行下修改MAC地址断电后不会丢失

猜你喜欢

转载自blog.csdn.net/panjun1229/article/details/79282067