Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

DHCP (dynamic Host configuration Protocol) Lab:

2025-03-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Note: the following four labs should pay attention to the impact of firewall and Selinux on the service:

1. Simple DHCP service building

Lab environment: two virtual machines, using bridging mode

DHCP server-side IP address:

Install the software:

Modify the configuration file:

Client verification: (the client's Nic is configured in dhcp automatic acquisition mode)

2.IP address retention Lab:

Modify the configuration file:

Client authentication:

3. Super domain experiment:

Modify the configuration file:

Client authentication:

4.DHCP Relay Agent Lab:

Description: three virtual machines are required: (one DHCP server, one for relay and routing forwarding, and one for client)

Among them, the relay proxy server needs to add two network cards, the experimental environment DHCP machine is in VMnet10, DHCRelay is in VMnet10, the other is in VMnet11, and the client is in VMnet11.

(DHCP server side) DHCP server IP:

Specify the gateway:

Modify the configuration file:

(DHCRelay) you need to install the dhcp software and enable the routing and forwarding feature:

Dhcrelay configuration file: (/ etc/sysconfig/dhcrelay)

(client authentication)

The knowledge points required for this experiment:

Summary:

DHCP service

1. Software package: dhcp

2. Service name: dhcpd (main program), dhcrelay (relay service)

3. Port: udp 67 udp 68

4. Configuration file:

/ etc/dhcp/dhcpd.conf main configuration file

/ etc/sysconfig/dhcrelay Relay profile

/ usr/share/doc/dhcp*/dhcpd.conf.sample master profile template

5. Common configuration items

……

6. Set up DHCP and DHCP relay services

The process of the experiment:

Set up a DHCP server:

Server side:

1. Yum-y install dhcp

2 、 cp/ usr/share/doc/dhcp*/dhcpd.conf.sample / etc/dhcp/dhcpd.conf

3. Vim / etc/dhcp/dhcpd.conf removes redundant configurations and retains a subnet area

Subnet 192.168.115.0 netmask 255.255.255.0 {

Option routers 192.168.115.172

Option subnet-mask 255.255.255.0

Range 192.168.115.10 192.168.115.100

Default-lease-time 21600

Max-lease-time 23200

}

4 、 service dhcpd restart

Client:

1 、 vim / etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0

ONBOOT=yes

BOOTPROTO=dhcp

2 、 service network restart

Set up DHCP relay service:

Server side:

1. Yum-y install dhcp

2 、 cp/ usr/share/doc/dhcp*/dhcpd.conf.sample / etc/dhcp/dhcpd.conf

3. Vim / etc/dhcp/dhcpd.conf removes redundant configurations and retains a subnet area

Subnet 192.168.1.0 netmask 255.255.255.0 {

Option routers 192.168.1.2

Option subnet-mask 255.255.255.0

Option domain-name-servers 192.168.1.2

Range 192.168.1.10 192.168.1.100

Default-lease-time 21600

Max-lease-time 23200

}

Subnet 192.168.200.0 netmask 255.255.255.0 {

Option routers 192.168.200.1

Option subnet-mask 255.255.255.0

Range 192.168.200.10 192.168.200.100

Default-lease-time 21600

Max-lease-time 23200

}

4 、 service dhcpd restart

5 、 route add default gw 192.168.1.2

Relay end:

1. Yum-y install dhcp

2 、 vim / etc/sysctl.conf

Ip.net.ipv4_forward 1

3. Sysctl-p

4 、 vim / etc/sysconfig/dhcrelay

INTERFACE = "eth0 eth2"

DHCPSERVER = "192.168.115.179"

5 、 service dhcrelay restart

Client:

1 、 vim / etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0

ONBOOT=yes

BOOTPROTO=dhcp

2 、 service network restart

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report