Ubuntu18.04, Centos7 static IP

1、 Ubuntu

Static IP: zhang@Ubuntu:~$ sudo vim /etc/netplan/50-cloud-init.yaml

network:
   ethernets:
   ens33:
   addresses:[192.168.18.129/24]
   dhcp4:false
   gateway4:192.168.18.2
   nameservers:
     addresses:[8.8.8.8,114.114.114.114]
version:2

Restart the network service: sudo netplan apply

2、 Centos

Static IP: [root@Centos ~]# vi /etc/sysconfig/network-scripts/ifcfg-eno16777736

TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
IPADDR=192.168.18.128
GATEWAY=192.168.18.2
NETMASK=255.255.255.0

Configure DNS: [root@Centos ~]# vi /etc/resolv.conf

nameserver 114.114.114.114
nameserver 192.168.0.1

Restart network service: systemctl restart network.service

Recommended Posts

Ubuntu18.04, Centos7 static IP
ubuntu16.04 set static ip
ubuntu 18.04 set static ip method
Set static IP under Centos
How to set static IP in ubuntu14.04
Set static IP for CentOS in VMware
How to set static IP on Ubuntu 18.04 Server
ubuntu 17.10 set solid IP
Summary of CentOS method to set static IP
How to set static IP on Ubuntu 18.04 Server
Explain how to set static IP on ubuntu14.04
ubuntu 14.04 configure 3-wire 3IP
[Quick Start with Ubuntu] Two, Ubuntu set static IP
Centos7 configure IP address
Explain the implementation of Centos8 static IP configuration
Centos: add an IP address
Centos configure multiple virtual IP
Centos configure multiple virtual IP
The difference between CentOS and Ubuntu
CentOS 8 (2)
ubuntu modify and configure ip address
CentOS 8 (1)
How is CentOS different from Ubuntu?
CentOS7 configure static address, turn off firewall
Centos7 configuration host name and IP address
IP address problem after restarting CentOS 7 system