1. Prerequisite — Ensure that the three are connected to each other
1.1. Core – Direct connection of network cable between development board and Windows host
1.2. Set static IP addresses for Windows hosts
usewin+r
, the inputcmd
To open the command line, enteripconfig
Check whether the Settings are correct:
1.3. Configure a Static IP address for a Linux VM
Important: The vm and development board need to be connected, so use the bridge mode.
- Configure the virtual NIC used by the VM.
Open the virtual Web editor:
Then configure the Ubuntu system using the configured VMnet0 nic:
- Log in to the Ubuntu system and configure the VM IP address.
useifconfig
View network adapter:
Disable the nic:
sudo ifconfig ens33 down
Copy the code
Disabling the DHCP service:
sudo dhclient -r
Copy the code
Set the NIC IP address:
Sudo ifconfig ens33Copy the code
Note That the IP address to be set must be in the same network segment as the IP address (192.168.1.11) of the Windows host. If the IP address is in a different network segment, you need to set the routing table. Open the network card
sudo ifconfig ens33 up
Copy the code
Check the IP address again after a few seconds:
ifconfig
Copy the code
The configuration is successful.
This mode is valid only after the restart. Therefore, if you need to restart the network, you need to modify the network configuration file:
sudo vi /etc/network/interfaces
Copy the code
Finally, configure the network of the development board and log in to the development board through the serial port (use putty in Windows or Minicom in Linux).
Also, view the network card:
ifconfig
Copy the code
Set the IP address:
The ifconfig eth0 192.168.1.36Copy the code
After a few seconds, check whether the IP address is set successfully.
ifconfig
Copy the code
You can see that the IP address is set successfully.
The configuration takes effect only this time. If you want the configuration to remain valid after the restart, run the following command to modify the file:
vi /etc/network/interfaces
Copy the code
Add a custom configuration for eth0:
After IP addresses are set for Windows hosts, VMS, and development boards, test whether the two hosts can ping each other and perform subsequent SSH service tests. The operations are the same as those performed after IP addresses are dynamically obtained. For details, see:
[Embedded Linux] Network environment construction between Windows, Vmware VIRTUAL machine and development board (using dynamic IP through router)