Detailed tutorial on development board Internet access
Written in front
Today I want to configure the boa server of the development board. I need to download sudo apt-get install bison flex, but I keep getting errors, which makes me confused. Then I think about it and I really shouldn’t. Ah, there is no problem with the communication between the computer and the development board, but that’s just it. The development board needs a transit route or relies on a computer to access the Internet. This article explains how the development board shares the Internet with the computer
PC operation
First open the Network Sharing Center on your computer, namely Control Panel\Network and Internet\Network Connections
WLAN is the wifi your computer is connected to, and the Ethernet 2 shown (displaying an unidentified network) is the network card of the development board, as shown in the figure below
Right-click on the wlan properties, select Sharing, check Allow other network users to connect through this computer's Internet connection (N), and select the development board network card you are using (mine is Ethernet 2), as shown in the figure below
After clicking OK, a prompt may pop up, saying to assign a default IP to your Ethernet 2, but mine is not displayed. The netizen's screenshot is as follows
Right-click Ethernet 2 and select Properties, select ipv4, click Properties, and you can see that the IP automatically assigned to us is: 192.168.137.1
Now you can open the command box in the pc command box, that is, win+r cmd, and you can see that the ip of Ethernet 2 is 192.168.137.1, and the ip of your own wifi, that is, wlan, is 192.168.33.199
Development board operation
Next, log in to your development board through the serial port. You can use MobaXterm or xshell. Start writing the IP. Note that it must be in the same network segment. Your Ethernet is network segment 137, and the board is also in this network segment. (The following steps are provided by the network author)
1. Configure IP (note that the network port must correspond)
ifconfig eth0 192.168.137.30 up
2. Configure gateway
route add default gw 192.168.137.1
nameserver 8.8.8.8
3. Set up the development board to start the connection (add the instructions for configuring IP and gateway to the /etc/profile file, and then use the source command. If you don’t want to You can ignore this item for self-starting connections)
sudo vim /etc/profile
source /etc/profile
Since the network configuration of my development board is under /etc/netplan, modify the network configuration according to your own board. The above steps are universal.
The network settings of my own board are as follows:
Next, ping the PC to see if it can be connected.
ping 192.168.137.1
Next, ping Baidu to see if it can be reached.
ping baidu.com
As shown in the picture below, you can see that both of my tests passed. If you still get errors, please read carefully and follow the steps. There may be errors in the previous configuration. For example, you shared the Ethernet, or changed the IP of the Ethernet. The development board is not in the same network segment.