CentOS7 Network Setting

#display devices
[root@localhost ~]# nmcli d

#set ipv4 address
[root@localhost ~]# nmcli c modify eth0 ipv4.address 192.168.100/24

#ip default gateway
[root@localhost ~]# nmcli c modify eth0 ipv4.gateway 192.168.1.1

#set static for static setting (it's "auto" for DHCP)
[root@localhost ~]# nmcli c modify eth0 ipv4.method manual

#restart the interface and reload the setting
[root@localhost ~]# nmcli c down enp0s3; nmcli c up enp0s3

#show setting
[root@localhost ~]# nmcli d show enp0s3

#show status
[root@localhost ~]# ip add show

posted @ 2019-07-21 21:56  cnxiaol  阅读(418)  评论(0编辑  收藏  举报