DHCP server configuration

xiaoxiao2021-03-05  29

DHCP Server Configuration DHCP Service Configuration DHCP Service accounts for 67 ports, and DHCP is the protocol of Bootps. You can prove this command: #cat / etc / services | grep bootpsbootps 67 / TCP #BootP ServierBootps 67 / UDPDHCP full name is Dynamic Host Configuration Protocol, is designed by the IETF (Internet Engineer Task Force), The detailed protocol content is in RFC document RFC2131 and RFC1541. It is used to automatically assign a network protocol for TCP / IP information to the client. Each DHCP client is connected to a central location DHCP server that returns a client network configuration that includes IP addresses, gateways, and DNS server information. DHCP work procedure (1) IP rental request: After the DHCP client starts the computer, broadcast a DHCPDiscover packet through the UDP port 67, providing IP leases to any DHCP server on the network. (2) IP rental provides: All DHCP servers on the network receive this packet, each DHCP server responds to a DHCPOFFER broadcast package via UDP port 68, and provides an IP address. (3) IP rental selection: After receiving the provision from more than one DHCP server, the client will select the first DHCPoffer package and broadcast a DHCPRequest message package in the network, indicating that you have accepted a DHCP server. IP address. The broadcast package contains the IP address of the IP address and the server's IP address. (4) IP rental confirmation: After receiving DHCP servers selected by the client, public broadcation returns a DHCPACK message package that has been accepted by the client, indicating the legal rent of this IP address and Other configuration information is placed in the broadcast package to the client. After receiving the DHCPACK package, the client will use the information in the broadcast package to configure your TCP / IP, and the lease process is completed, and the client can communicate in the network.

/ usr / sbin / dhcpd // DHCP execution file / var/lib/dhcp/dhcpd.Leases // DHCP lease file DHCP profile Linux default is no dhcpd.conf file, you need ourselves to / usr / share / doc / DHCP.CONF.SAMPLE Template files are copied to the / ETC folder under folder DHCPD.CONF # cp /usr/share/doc/DHCP-3.0P12/DHCP.CONF.SAMPLE / ETC / DHCPD .conf # vi /etc/dhcpd.conf // Open /etc/dhcpd.conf file DDNS-UPDATE-STYLE InterInter; // Configuration Use Transition DHCP-DNS Interactive Update Mode Ignore Client-Updates; // ignore client update Subnet 192.168.0.0 Netmask 255.255.255.0 {// Subnet must be later, set which network segment you want to provide DHCP, note that the DHCP server IP address must match the network segment, otherwise the DHCP service cannot start Option Routers 192.168. 0.1; // Specify the default gateway Option Subnet-Mask 255.255.255.0 for DHCP customers; / / Netmask Option Nis-Domain "domain.org" for DHCP customers; / / settings for DHCP customers NIS domain Option Domain-name "domain.org"; / / Set DNS Domain Option Domain-Name-Servers 192.168.1.1; // for DHCP Customer Set the DNS server address Option Time-Offset -18000; // Setting Offset Time (s) Range Dynamic-Bootp 192.168.0.128 192.168.0.0.0.128 192.168.0.255; // Set the address pool, assign the address segment of the IP address for the DHCP client, and the customer can be divided into any address within that section; It is recommended to change 192.168.0.255 to 192.0.168.254 because the client cannot be divided Erge with 255 machine, 255 is the broadcast address default-lease-time 21600; / / Set the default address tenancy for DHCP customers, units in second max-lease-time 43200; / / Set the longest address for DHCP customers Rental period, the unit is the second ns {// This part is about the declaration of the DHCP server next-server marvin.redhat.com; // Set the host name used to define the server from the boot file, for free workstation Hardware Ethernet 12: 34: 56: 78: AB: CD // Specifies the MAC address of DHCP customers fixed-address 207.175.42.254; // Specify the MAC address assignment fixed IP address}} is the detail of each of the DHCP configuration files. Explanation. If you touch the DCHP settings, start the DHCP service start unsuccessful, please check if the / etc / sysconfig / network file network network is YES, if not Yes, modify it, YES.

#vi / etc / sysconfig / networknetworking = yes or execute this operation equivalent to the above operation #echo "networking = yes" >> / etc / syconfig / network below Let's configure DHCP client #vi / etc / sysconfig / network -scripts / ifcfg-eth0Device = eth0 // NIC device file name settings correct bootproto = DHCP // Automatically get IP address onboot = YES Save Exit (WQ), start DHCP service #service dhcpd start, set into effect. Users can get one of the IP addresses in the DHCP server address pool. #ifconfig // will see an IP address in the address pool assigned by the client to the DHCP client to assign fixed IP addresses to the DHCP client View Mac (NIC) address #ifconfig // You can check the MAC address, For example, the MAC address is 12: 34: 56: 78: AB: CD Setting #vi /etc/dhcpd.redhat.com; Hardware Ethernet 12: 34: 56: 78: AB; Hardware Ethernet 12: 34: 56: 78: Ab : Cd // Specify the DHCP client network card address is 12: 34: 56: 78: AB: CD, IP address fixed setting to 192.168.0.100 fixed-address 192.168.0.100 Save Exit (WQ) #Service DHCPD RESTART / / Restart DHCP Service settings take effect in the DHCP client to restart the network service #service network restart to get the IP address of the DHCP server to the client. #ifconfig // View IP Address INET ADDR 192.168.0.100 Settings effective, and DHCP servers have allocated fixed IP addresses for DHCP clients. After the DHCP client restarts the NetWork service, you can see some of the information effects of the DHCP host. - Local connection --- attribute (counterattack) - - Regular --- Internet Protocol (TCP / IP) --- Property --- Automatic IP Address - Determine - Determine Viewing the IP Address : Start --- Run --- CMD --- IPConfig Tip: If you cannot automatically get an IP address, check if there is a firewall to open, if you have closed all firewalls. Fixed Windows IP address method The same is the same as the Linux operating system, just when the IP address is viewed, the command is different, in Windows is IPConfig, Linux is ifconfig. Get new IP addresses IPConfig / release -all // in Windows iPconfig / Release -all // Release all NIC IP Address IPConfig / Renew -All // If all NIC IP addresses get a DHCP server to assign a new IP address. WinodWs Change the NIC (Mac) Address My Computer --- Properties --- Hardware --- Device Manager --- Network Adapter --- XXXXXX (Net Card Name) --- Advanced - Advanced - --Network Address - value (continuously filled in 12-bit MAC address) Note: The first three sections of the same manufacturer MAC address are the same.

This tutorial is only for the majority of Linux enthusiasts to learn. If you want to learn Linux, Linuxext recommends that you buy this Linux book with this tutorial effect better! This tutorial is copyrighted by Linuxext. If you want to reprint, please feel free to contact us! ! If you do not allow private reprints that are allowed to be legally responsible, the consequences are at your own risk! ! Linuxext has the final interpretation right and retention interpretation right! ! [This post has been modified by McMaraman at 2005-4-21 0:30:03]

转载请注明原文地址:https://www.9cbs.com/read-33569.html

New Post(0)