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
[email protected] ~$ifconfig eth0 192.168.1.120 (set eth0 to IP 192.168.1.120) [email protected] ~$ifconfig (View current network status)
Command line set routing default gateway IP address
Enter the command in HyperTerminal:
[email protected] ~$route add default gw 192.168.1.10 /etc/resolv.conf (file with dns server information) nameserver 188.8.131.52 nameserver 184.108.40.206
Ø 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:
[email protected] ~$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:
[email protected] ~$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
roo[email protected] ~$ ifconfig eth0 192.168.1.101 netmask 255.255.255.0
2. Modify the MAC address
Use the following command to temporarily modify
[email protected] ~$ ifconfig eth0 down [email protected] ~$ ifconfig eth0 hw ether 08:90:90:90:90:90 [email protected] ~$ 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
[email protected] ~$ 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