1.创建虚拟机
设置网卡,会自动IP
2.配置静态IP
[root@192 ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens33
dhcp:动态IP
static:静态IP
重启网卡
[root@192 ~]# systemctl restart network
[root@192 ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:e4:10:58 brd ff:ff:ff:ff:ff:ff
inet 192.168.6.141/24 brd 192.168.6.255 scope global noprefixroute ens33
valid_lft forever preferred_lft forever
inet6 fe80::8dc2:dd3:655b:306/64 scope link noprefixroute
valid_lft forever preferred_lft forever
[root@192 ~]#