海思平台设置静态IP
嵌入式设备设置IP地址,修改/etc/init.d/S09Init文件。 (1)设置IP 10.1.11.1, 对应硬件网口0。 ifconfig eth0 hw ether 80:00:0A:01:0B:01 # 如果设置子网掩码255.255.255.0,则ping不通局域网内IP是10.3.21.1的单IP设备。 ifconfig eth0 10.1.11.1 netmask 255.0.0.0 # 如果设置网关192.168.130.1,则无法加入组播收发组播消息。 route add default gw 10.1.1.1 eth0 (2)设置IP 192.168.130.143, 对应硬件网口1。 ifconfig eth1 hw ether 80:00:C0:A8:82:8F ifconfig eth1 192.168.130.143 netmask 255.255.255.0 route add default gw 192.168.130.1 eth1 (3)设置虚拟IP 192.168.130.141, 对应硬件网口xxx。 # 设置MAC地址,2字节固定值+4字节IP地址 # 80:00固定前缀,IP192.168.130.141翻译成16进制C0:A8:82:8D ifconfig eth1:0 hw ether 80:00:C0:A8:82:8D #