Article Directory
- statement
- Network Configuration
- System file configuration
statement
The main reason is to check your own blog when you connect to the Internet in the future, and then just do it. There is no need to search for information randomly. Some information is wrong, but it will mess up your Ubuntu environment.
Network Configuration
Virtual network editor
Change settings
Add a network, add a Vment0, and set it to bridge mode, and set the bridge connection to automatic
Set the network adapter to bridged state
System file configuration
Open the command window (right-click the stand-alone desktop and select Open Terminal or Ctrl+Alt+T), and enter ifconfig
There are two words here, lo stands for 127.0.0.1, which is localhost, don't mess with this, this is the loopback address, which refers to the local machine, and is generally used for testing. The loopback address (127.xxx) is the loopback address of the machine, that is, the IP address inside the host's IP stack
sudo vi /etc/network/interfaces, edit the file
Here, it involves the vi command to configure the file, let me briefly explain the vi command :
vi instruction
Basically vi can be divided into three states, namely command mode (command mode), insert mode (Insert mode) and bottom line mode (last line mode)
Command mode
How to enter command mode
Just inside, in command mode, when switching to the insertion mode and the line mode , press 「ESC」
the key return to command mode
Insert mode
Only in insert mode, you can only do text input , press the 「ESC」
key to return to the command line mode
How to enter insert mode
- Press "i" to switch to the insert mode "insert mode", press "i" to enter the insert mode to start inputting the file from the current position of the cursor ;
- After pressing "a" to enter the insert mode, the text will be input from the position next to the current cursor position ;
- After pressing "o" to enter the insert mode, a new line is inserted, and text is entered from the beginning of the line .
Press ↑↓←→ by mistake in insert mode
I don't know if you have such a situation, I do it anyway, and become more and more miscellaneous with one click, laughing to death. . . In this case, you only need to enter the command mode , then press ↑↓←→ to move to the miscellaneous line, and press dd
to delete an entire line.
Bottom row mode
Save the file or exit vi, you can also set the editing environment, such as searching for strings, listing line numbers, etc. In this case, I usually just use it for file preservation . . . .
How to enter bottom row mode
In the insert mode, can not enter line mode, need to press 「ESC」
key to return to command-line mode , and then press :
enter line mode, and then to wq
(save and exit vi)
ip gateway subnet mask DNS server address
ip has two requirements
- On the same network segment as the physical host
- At this time, the ip configuration is empty
The gateway only needs to change the last digit of ip to 1, and the subnet mask 255.255.255.0
and DNS server address are the same as the gateway, or you can directly create a general one (8.8.8.8 and 233.5.5.5)
Restart network service
sudo /etc/init.d/networking force-reload
==> Reload the network configuration filesudo /etc/init.d/networking restart
Heavy 启 Ubuntu
Then you can ping www.baidu.com
myself
important point
The physical machine ip thing is still looking for a popular one. I don’t understand what the school network means. This is ipv4 10.139.92.152
:? ? ? ? ? ? ?
Blind guess is the intranet IP. Operators such as mobile telecom often distribute their own intranet IP to users, especially in places with high density such as schools, because the IP address pool is not enough.
I configure these on Ubuntu. Inside, the result cannot be connected. . . Pissed off
Then I used my mobile phone hotspot, connected to the computer, re-assigned one to the physical machine ip
, and finally got an IP that looked normal
and ping www.baidu.com
very normal
to sum up
I believe this blog will soon come in and re-read it, laughing to death. . . . . . . Come on