background
- In order to realize the mutual data transmission between the development board and the linux under the virtual machine, PC and linux. The environment is restricted, too far from the router, and the development board cannot be directly connected to the router. So use the network port of the development board to connect directly to the network port of the notebook, and the notebook is connected to wifi to learn to debug the development board.
IP address of each device
PC Ethernet:
linux (ubuntu) under 192.168.1.20 virtual machine: 192.168.1.21
development board: 192.168.1.22
PC configuration
Open the network connection, and the corresponding configuration is as follows:
click OK. At the same time, you can use the shortcut key (win+r), enter cmd, and be sure to enter ipconfig to view the Ethernet status. Remember, the Ethernet and wlan on the PC side cannot be in the same network segment .
Network configuration under virtual machine
Attach a link to the description of the three networks of the virtual machine (thanks to the author): Virtual machine VMware 3 network modes (bridge, nat, Host-only)
I use ubuntu, the corresponding operations are as follows:
The information I filled in is address: 192.168.1.21; subnet mask: 255.255.255.0; gateway: 192.168.1.1.
Open the terminal, enter ifconfig, you can view the corresponding network configuration
To do this, you can first test whether the PC and Linux can ping through.
PC: Open the command line, enter ping 192.168.1.21
linux: Open the terminal, enter ping 192.168.1.20, press Ctrl+C to cancel.
In the test, it was found that the PC can ping linux, but linux cannot ping the PC. If you encounter a similar situation, please refer to (thanks to the author): The computer can ping the ubuntu of the virtual machine, but the solution for Ubuntu ping different computers:
Development board configuration
I tested it when the development board uboot was started. After the development board was reset, press Enter to enter. In this case, after the configuration is completed, the development board can ping the PC and Linux, but not vice versa (it is a normal phenomenon, after the root file system is loaded, you can ping each other).
The development board settings are as follows:
=> setenv ipaddr 192.168.1.22
=> setenv ethaddr 00:04:9f:04:d2:35
=> setenv gatewayip 192.168.1.1
=> setenv netmask 255.255.255.0
=> setenv serverip 192.168.1.21
=> saveenv
other
What's more frustrating is that with this setting, ubuntu (linux) cannot access the Internet. After trying and similar operations, it can be realized that both windows and ubuntu can access the Internet. Attached link: https://blog.csdn.net/ping_devil/article/details/106598521
For the first time, please correct me if there are any disadvantages.
If there is any infringement, please contact me to delete it, thank you! ! !
Attached reference link (thanks to the author):
[1]. https://blog.csdn.net/lxllinux/article/details/79923360
[2]. https://blog.csdn.net/tanhao199406/article/details/ 45619329