Ubuntu18.04 set ip address

1. themselves with a ubuntu18.04 vCenter installation, because the result is vCenter6.7 only web interface, GUI operating mouse found the wrong place, no way can only be set by the ip address cli way.

2. briefly look at the ip address of the virtual machine, and then connect up via ssh.

There is a bit ubuntu default root user is not allowed to modify

/etc/ssh/sshd.config of permitrootlogin set to yes then restart the sshd service on it

And ubuntu use systemd can be said as a managed service can be used directly. Systemctl restart sshd way to restart the service.

3. simple setup

3.1 Setting ip address

First to get card information through ifconfig.

 

 It can be relatively simple to see the card information

Then modify the configuration file

vim / etc / Network / in the interfaces 
add content: 
pay attention to choose a good card equipment
Auto ens160 iface ens160 inet
static address 10.24 . 22.150 Gateway 10.24 . 255.254 Netmask 255.255 . 0.0 dns -nameservers 10.100 . 1.11

3.2 After setting the ip address found although there are dns-servers set but still can not communicate with the network can not apt to install something.

Then you need to modify the dns settings

vim / etc / systemd / resolved.conf 

increase good content in it 
[Resolve] 
the DNS = 10.100 . 1.11 


restart the service or restart the machine just fine. 
  
systemctl restart systemd-resolved

3.3 Verify that you can access domain network

root@pscloud:/etc# systemctl restart systemd-resolved
root@pscloud:/etc# ping www.163.com
PING z163ipv6.v.bsgslb.cn (218.92.152.19) 56(84) bytes of data.
64 bytes from 218.92.152.19 (218.92.152.19): icmp_seq=1 ttl=53 time=30.2 ms
64 bytes from 218.92.152.19 (218.92.152.19): icmp_seq=2 ttl=53 time=29.9 ms
64 bytes from 218.92.152.19 (218.92.152.19): icmp_seq=3 ttl=53 time=29.9 ms
64 bytes from 218.92.152.19 (218.92.152.19): icmp_seq=4 ttl=53 time=30.0 ms

Guess you like

Origin www.cnblogs.com/jinanxiaolaohu/p/12111458.html