在虚拟中操作
1.rht-vmctl reset desktop ##在主机中
2.vim /etc/sysconfig/network-scripts/ifcfg-eth0 ##编辑网络配置
3.systemctl restart network ##重启网络配置
4.yum install dncp.x86_64 -y ##安装dhcp服务组件
5.cd /etc/dhcp/
6.ls ##查看有没有文件
7.vim dhcpd.conf
8.cp /usr/share/doc/dhcp*/dhcpd.conf.example /etc/dhcp/dhcpd.conf ##复制示例文档
9. vim dhcpd.conf ##编辑配置文档
option domain-name-servers 114.114.114.114;
# DHCP server to understand the network topology.
# This is a very basic subnet declaration.
subnet 172.25.254.0 netmask 255.255.255.0 {
range 172.25.254.200 172.25.254.210;
option routers 172.25.254.250;
10.systemctl start dhcpd ##开启dhcp服务
11.systemctl enable dhcpd ##系统启用
测试:
rht-vmctl reset server ##在主机中
rht-vmctl view server ##在主机中
ifconfig