Dhcp service
1. Server side
(1) configure the server to be ip static
1. Modified by drawing: nm-connection-editor
two。 Configure Yum source cd / etc/yum.repos.d ls vim rhel_dvd.repo configure yum source yum inatll dhcp install dhcp yum clean all clear yum cache 3.vim / etc/dhcp/dhcpd.conf view configuration file cp/ usr/share/doc/dhcp/dhcpd.conf.example (profile template) copy profile template to / Etc/dhcp/dhcpd.conf 5.vim / etc/dhcp/dhcpd.conf modify configuration file * * edit content * * 6 # option definitions common to all supported networks...
7 option domain-name "westos.com"; domain name
8 option domain-name-servers 172.25.254.250; dns address
nine
10 default-lease-time 600; default lease term
11 max-lease-time 7200; maximum lease term
twelve
13 # Use this to enble / disable dynamic dns updates globally.
14 # ddns-update-style none
fifteen
16 # If this DHCP server is the official DHCP server for the local
17 # network, the authoritative directive should be uncommented.
18 # authoritative
nineteen
20 # Use this to send dhcp log messages to a different log file (you also
21 # have to hack syslog.conf to complete the redirection).
22 log-facility local7; log level
twenty-three
24 # No service will be given on this subnet, but declaring it helps the
25 # DHCP server to understand the network topology.
twenty-six
twenty-seven
twenty-eight
29 # This is a very basic subnet declaration.
thirty
31 subnet 172.25.254.0 netmask 255.255.255.0 {set the network bits for allocating ip
32 range 172.25.254.200 172.25.254.220; ip address pool
33 option routers 172.25.254.250; the gateway obtained by the customer host
Client
1. Edit configuration file to modify dhcp:vim / etc/sysconfig/network-scripts/ifcfg-eth0
BOOTPROTO=dhcp
2.systemctl restart network restart service to get ip
3.3.ifconfig * * View ip