Embedded Linux development board, connect to the computer through a network cable, share the computer wireless network, and access the external network

1. Wireless shared network

  1. Control Panel---->Network and Internet---->Network Connections
  2. Right-click WLAN---->Properties

    "Ethernet", which is the computer network port that the development board is connected to through a network cable.
  3. After clicking OK, it will usually appear that
    Insert image description here
    the IP address of the Ethernet will be automatically changed to 192.168.137.1. You can check whether the IP address has been modified by "right-clicking Ethernet---->Properties---->lnternet Protocol Version 4 (TCP/IPv4)---->Properties".
    Insert image description here

2. Set the IP and gateway on the development board

  1. Set the IP, which needs to be consistent with the Ethernet IP network segment.
ifconfig eth0 192.168.137.30
  1. Set up gateway
route add default gw 192.168.137.1
  1. Auto-start settings at boot
    vi /etc/network/interfaces
    ② Add in
auto eth0
iface eth0 inet static
address 192.168.137.30
netmask 255.255.255.0
gateway 192.168.137.1

3. Test

  1. Turn off all firewalls on your computer

  2. The development board can ping any URL, such as Baidu
    Insert image description here

  3. If you can only ping the IP address but not the domain name, a problem will occur: ping: bad address 'www.baidu.com'
    vi /etc/resolv.conf
    ② Modify the file to

nameserver 114.114.114.114
nameserver 8.8.8.8

4. Reference document links

Connect the ARM-linux development board to the computer with a network cable to access the external network

Guess you like

Origin blog.csdn.net/m0_43443861/article/details/128526034