IP and MAC Address Modification of iMX6 Single Board Computer
How to set the IP address of the imx6 single board computer:
The imx6 single board computer network related configuration statement:
The network usage environment of each imx6 single board computer user may not be the same. This operation is based on the Forlinx embedded imx6 single board computer. The network environment is as follows. In actual use, please configure it according to the actual network environment.
Network connection method: The single board computer is directly connected to a router that can access the Internet.
Router IP: 192.168.1.10
Subnet mask: 255.255.255.0
Step 1: Set the IP address of the imx6 single board computer, you can choose from the following two setting methods.
Ø Method 1:
Set a fixed IP address from the command line
root@freescale ~$ifconfig eth0 192.168.1.120 (set eth0 to IP 192.168.1.120) root@freescale ~$ifconfig (View current network status)
Command line set routing default gateway IP address
Enter the command in HyperTerminal:
root@freescale ~$route add default gw 192.168.1.10 /etc/resolv.conf (file with dns server information) nameserver 220.127.116.11 nameserver 18.104.22.168
Ø Method 2:
Command line settings to automatically obtain an IP address
If your imx6 single board computer is connected to the router, and the router supports DHCP automatic IP address assignment, you can enter the command in the super terminal:
root@freescale ~$udhcpc -i eth0
It is used to dynamically obtain the IP address. The "-i" parameter is used to specify the name of the network card. The network card name of the wired network of the Forlinx imx6 single board computer is eth0.
/etc/resolv.conf (The dns server information in the file will be automatically added.)
Step 2: Network Connectivity Test
Use the ping command to test whether the network is connected. The command is as follows:
root@freescale ~$ping 192.168.1.10
Ctrl + C to exit.
IP and MAC address modification of imx6 single board computer
1. Configure IP address, subnet mask, default gateway, DNS server, router settings refer to the previous chapter on how to set IP address for imx6 single board computer
root@freescale ~$ ifconfig eth0 192.168.1.101 netmask 255.255.255.0
2. Modify the MAC address
Use the following command to temporarily modify
root@freescale ~$ ifconfig eth0 down root@freescale ~$ ifconfig eth0 hw ether 08:90:90:90:90:90 root@freescale ~$ ifconfig eth0 up eth0: Freescale FEC PHY driver [Generic PHY] (mii_bus:phy_addr=1:01, irq=-1)
Permanently modify, modify the rc.local file
root@freescale ~$ cat /etc/rc.d/rc.local | tail for i in 0 1 2; do if [ -e /sys/class/graphics/fb$i ]; then chmod 0666 /sys/class/graphics/fb$i/pan fi done ifconfig eth0 down ifconfig eth0 hw ether 08:90:90:90:90:90 ifconfig eth0 up