IMX6ULL 대시보드 정적 IP 설정
2008 단어 IMX6ULL 학습-베어 메탈
정적 IP 설정
/etc/network/interface 파일 편집 vi /etc/network/interfaces
// # Wired or wireless interfaces
auto eth0
iface eth0 inet dhcp
iface eth1 inet dhcp
이 코드는 네트워크 카드 설정이 동적으로 IP를 가져오는 것을 표시합니다. 우리는 eth0을 주석해 드리겠습니다.# Wired or wireless interfaces
auto eth0
#iface eth0 inet dhcp //
iface eth1 inet dhcp
그리고 파일에 다음 명령을 추가합니다iface eth0 inet static // eth0 IP
address 192.168.1.111 // IP
netmask 255.255.255.0 //
gateway 192.168.1.1 //
broadcast 192.168.1.255 //
전체 파일은 다음과 같습니다.# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# The loopback interface
auto lo
iface lo inet loopback
# Wireless interfaces
iface wlan0 inet dhcp
wireless_mode managed
wireless_essid any
wpa-driver wext
wpa-conf /etc/wpa_supplicant.conf
iface atml0 inet dhcp
# Wired or wireless interfaces
auto eth0
#iface eth0 inet dhcp
iface eth1 inet dhcp
iface eth0 inet static
address 192.168.1.111
netmask 255.255.255.0
gateway 192.168.1.1
broadcast 192.168.1.255
# Ethernet/RNDIS gadget (g_ether)
# ... or on host side, usbnet and random hwaddr
iface usb0 inet static
address 192.168.7.2
netmask 255.255.255.0
network 192.168.7.0
gateway 192.168.7.1
# Bluetooth networking
iface bnep0 inet dhcp
NIC 재부팅 /etc/init.d/networking restart
전원 켜기 자동 부팅 설정
/etc/init.d/rc에서 파일의 마지막에 다음 명령을 추가하면 됩니다ifconfig eth0 192.168.1.111 netmask 255.255.255.0
route add default gw 192.168.1.1
다음 명령을 사용하여 파일에 추가할 수도 있습니다.echo "ifconfig eth0 192.168.xxx.xxx netmask 255.255.255.0" | tee -a /etc/init.d/rc
echo "route add default gw 192.168.xxx.1" | tee -a /etc/init.d/rc
vi /etc/network/interfaces
// # Wired or wireless interfaces
auto eth0
iface eth0 inet dhcp
iface eth1 inet dhcp
# Wired or wireless interfaces
auto eth0
#iface eth0 inet dhcp //
iface eth1 inet dhcp
iface eth0 inet static // eth0 IP
address 192.168.1.111 // IP
netmask 255.255.255.0 //
gateway 192.168.1.1 //
broadcast 192.168.1.255 //
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# The loopback interface
auto lo
iface lo inet loopback
# Wireless interfaces
iface wlan0 inet dhcp
wireless_mode managed
wireless_essid any
wpa-driver wext
wpa-conf /etc/wpa_supplicant.conf
iface atml0 inet dhcp
# Wired or wireless interfaces
auto eth0
#iface eth0 inet dhcp
iface eth1 inet dhcp
iface eth0 inet static
address 192.168.1.111
netmask 255.255.255.0
gateway 192.168.1.1
broadcast 192.168.1.255
# Ethernet/RNDIS gadget (g_ether)
# ... or on host side, usbnet and random hwaddr
iface usb0 inet static
address 192.168.7.2
netmask 255.255.255.0
network 192.168.7.0
gateway 192.168.7.1
# Bluetooth networking
iface bnep0 inet dhcp
/etc/init.d/networking restart
전원 켜기 자동 부팅 설정
/etc/init.d/rc에서 파일의 마지막에 다음 명령을 추가하면 됩니다ifconfig eth0 192.168.1.111 netmask 255.255.255.0
route add default gw 192.168.1.1
다음 명령을 사용하여 파일에 추가할 수도 있습니다.echo "ifconfig eth0 192.168.xxx.xxx netmask 255.255.255.0" | tee -a /etc/init.d/rc
echo "route add default gw 192.168.xxx.1" | tee -a /etc/init.d/rc
ifconfig eth0 192.168.1.111 netmask 255.255.255.0
route add default gw 192.168.1.1
echo "ifconfig eth0 192.168.xxx.xxx netmask 255.255.255.0" | tee -a /etc/init.d/rc
echo "route add default gw 192.168.xxx.1" | tee -a /etc/init.d/rc