The essence is to share laptop wifi, configure Ethernet static IP, and then connect on the industrial computer
Reference:
https://zhuanlan.zhihu.com/p/378814739
https://blog.csdn.net/weixin_42128941/article/details/98635554
equipment
- Laptop win10
- Wonderful calculation ubuntu16.04
- cable
First, connect the laptop and the industrial computer with a network cable to ensure that the laptop is connected to the Internet.
Find the current WLAN in the network connection of the win10 system, open the sharing settings, and select Ethernet.
If you don't find the Ethernet option, turn on the mobile hotspot first, and then repeat the previous step to find it.
Open the Ethernet properties and you will see that the IP address has been assigned under IPv4. Remember this IP and it will be used under the industrial computer.
Then under Miaosuan ubuntu16.04, first use ifconfig to check whether the computer has eth0, and use the following command to modify the static ip
sudo gedit /etc/network/interfaces
#写入下面这些内容
auto eth0
iface eth0 inet static
address 192.168.137.100 # 此处改为192.168.137.x,x为2~255内的任意数
gateway 192.168.137.1 # 这里就是win10下以太网的ip,必须一样
netmask 255.255.255.0
source-directory /etc/network/interfaces.d
Then you can ping 192.168.137.100 to see if the connection is successful, or check the status of the Ethernet to see if there is reception.
Finally, you can set up the domain name resolution server
cat /etc/resolv.conf
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
That’s it!