DHCP Auto-Assign IP

Source: Internet
Author: User
Tags get ip

Prepare the lab environment

Host type Operating system IP Address
DHCP Service side CONTOS7 (RHEL7) operating system 192.168.0.1
DHCP client CONTOS7 (RHEL7) operating system

DHCP Auto get address

Configure the virtual machine network type

Configuring IP using the nmtui command

Configuration of the DHCP server (requires a fixed IP: (Manual))

DCHP client settings (set to get IP automatically: (Automatic))

The virtual machine's DHCP service should be turned on by default for the virtual machine software vmwareworkstation, and must be turned off after the following operation

Start configuring the DHCP configuration file after completing the above operation

[Email protected] system]# cat/etc/dhcp/dhcpd.conf

Ddns-update-style none; #设置DHCP服务不自动动态更新
Ignore client-updates; #忽略客户机更新DNS记录
Subnet 192.168.10.0 netmask 255.255.255.0 {#作用域为192.168.10.0/24 network Segment
Range 192.168.10.50 192.168.10.100; #IP地址池为192.168.10.50--100 (approximately 50 IP addresses)
Option Subnet-mask 255.255.255.0; #定义客户机的子网掩码
Option routers 192.168.10.1; #定义客户机的网关地址
Option Domain-name "Baidu.com"; #定义默认的搜索域
Option Domain-name-servers 192.168.10.1; #定义客户机的DNS地址
Default-lease-time 2300; #定义默认租约时间
Max-lease-time 3211; #定义最大预约时间
} #此为结束符

Each parameter in the configuration file of the DHCPD service program needs to be ";" Good ending.

Start the DHCPD service program Systemctl restart DHCPD

Add to boot Systemctl enable DHCPD

Finally, restart the network on the DHCP client (systemctl restart networks) to see the results.

DHCP Auto-Assign IP

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.