Original link: https://www.chen.fun/zh/2023/07/static-ip-address/
The last summer vacation of my school career is coming as scheduled. Because I may not be able to go home for the New Year this year, I will return to vacation early this time. The daily pastime is to do scientific research (you can’t graduate QAQ if you paddle), cook for your family, and take a (sports) camera and ride a bike in the countryside. It’s a small fortune. Regarding work equipment, I usually use a laptop to connect an external monitor to minimize the tossing and turning of multiple computers. But at home, there is still a desktop computer bought for writing a master’s thesis during the epidemic, which is a pity, so I decided to change it to a Linux server and run time-consuming programs such as MCMC through a remote connection.
The server is next to the router and connected to the network cable, and I work in another room. In order to facilitate remote connection, I changed the server ip address to static. First enter ip addr
on the command line to view the ip address. My computer lists three results, lo for the local loop interface, enp3s for the wired connection, and wlp4s0 1 for the wireless connection.
The network configuration file sudo /etc/netplan/00-installer-config.yaml
sets the dynamic ip address dhcp4: true
by default. Modify it as follows:
|
|
After that, connect to the server remotely through VS Code. For specific operations, refer to the previous example of connecting VS Code to WSL.
-
The names of different network cards are different, but the beginning should be consistent, for example, en (ethernet) means Ethernet, wl (wlan) means wireless local area network. Subsequent p means PCI, o (on-board) means on-board device index number, s (slot) means hot-plug index number, x means MAC address, etc. ︎
This article is transferred from: https://www.chen.fun/zh/2023/07/static-ip-address/
This site is only for collection, and the copyright belongs to the original author.