Uboot 의 환경설정에서 DHCP를 On/Off 할 수 있습니다.


EM-IMX6DQ 보드에서 DHCP를 On하기 위해서는 Uboot에서 다음과 같이 설정하면 됩니다.


MX6QFALinux U-Boot > edit bootargs_ram

edit: setenv bootargs console=ttymxc0,115200 root=/dev/ram0 rw --no-log initrd=0x1a000000,16M ramdisk=32768 video=mxcfb0:dev=hdmi,1920x1080@60,if=RGB24 vmalloc=192M


에서 다음을 추가하면 됩니다.


ip=dhcp eth=${ethaddr}


아래의 내용은 추가한 내용입니댜.


edit: setenv bootargs console=ttymxc0,115200 root=/dev/ram0 rw --no-log initrd=0x1a000000,16M ramdisk=32768 video=mxcfb0:dev=hdmi,1920x1080@60,if=RGB24 vmalloc=192M ip=dhcp eth=${ethaddr}


위와 같이 빨간 글씨를 추가한 후 저장을 합니다.


MX6QFALinux U-Boot > saveenv


리부팅을 하면 아래와 같은 커널 메세지를 확인 할 수 있습니다.


eth0: Freescale FEC PHY driver [Generic PHY] (mii_bus:phy_addr=1:05, irq=-1)
ADDRCONF(NETDEV_UP): eth0: link is not ready
PHY: 1:05 - Link is Up - 100/Full
ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Sending DHCP requests ., OK
IP-Config: Got DHCP answer from 0.0.0.0, my address is 190.160.0.189
IP-Config: Complete:
     device=eth0, addr=190.160.0.189, mask=255.255.0.0, gw=190.160.10.1,
     host=190.160.0.189, domain=, nis-domain=(none),
     bootserver=0.0.0.0, rootserver=0.0.0.0, rootpath=


부팅 후 정상적으로 설정되었는지 확인 합니다.


root@primero-s:~# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:fa:14:06:03:20
          inet addr:190.160.0.189  Bcast:190.160.255.255  Mask:255.255.0.0
          inet6 addr: fe80::2fa:14ff:fe06:320/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:739 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:99604 (99.6 KB)  TX bytes:1758 (1.7 KB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:50 errors:0 dropped:0 overruns:0 frame:0
          TX packets:50 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:4252 (4.2 KB)  TX bytes:4252 (4.2 KB)


root@primero-s:~# ping 190.160.10.1
PING 190.160.10.1 (192.160.10.1) 56(84) bytes of data.
64 bytes from 190.160.10.1: icmp_req=1 ttl=64 time=11.1 ms
64 bytes from 190.160.10.1: icmp_req=2 ttl=64 time=0.773 ms
64 bytes from 190.160.10.1: icmp_req=3 ttl=64 time=0.738 ms
64 bytes from 190.160.10.1: icmp_req=4 ttl=64 time=0.767 ms



--------

dhcp 설정을 Off 하기 위해서는 ip=dhcp 를 ip=off 로 해 주시면 됩니다.