Linux Server Deployment Series four-DHCP

Source: Internet
Author: User
Tags cairo gtk

The configuration of the DHCP server is one of the simplest services in the Linux server configuration, and there are many related documents on the Web, but most of them simply explain the configuration. Although this document may not be perfect, I would like to be able to make it as clear as possible, and I hope that we can provide more valuable advice. For the DHCP work process, you can refer to the "DHCP workflow detailed (http://guoxuemin.blog.51cto.com/379574/163475)". The main topics we are going to talk about today are the following: 1. DHCP installation 2. Basic Configuration 3. Multi-scope and relay Agent configuration 4. DHCP server security 5. Management monitoring DHCP Server The system used in this document is CentOS5, and the DHCP server is not installed by default. First, DHCP installationLinux defaults to installing DHCP clients, and you can use the command: Rpm-qa|grep DHCP to view relevant installation information. To configure the server as a DHCP server, You will also need to install the following packages: dhcp-3.0.5-18.el5.i386.rpm,dhcp-devel-3.0.5-18.el5.i386.rpm,dhcpv6-1.0.10-16.el5.i386.rpm. (Note that the version of the DHCP installation package differs depending on the operating system version.) The specific installation is as follows: Second, the basic configurationBelow we use an example to illustrate the configuration of the DHCP server, a company's network is as follows: Using network segment 192.168.99.0/ 24, Gateway Address: 192.168.99.1,dns and DHCP server address: 192.168.99.9, the company domain name: GUOXUEMIN.CN,DHCP address pool is: 192.168.99.51-192.168.99.254, in addition, boss computer binding 192 .168.99.46 this address.  1. You can also create a new dhcpd.conf by copying/usr/share/doc/dhcp-3.0.5/dhcpd.conf.sample to/etc/dhcpd.conf.   2. Configure the/etc/dhcpd.conf, as follows: # vi /etc/dhcpd.conf  parameter Description: 1) Ddns-update-style: Defines the supported DNS dynamic update types.    Optional Parameters: None: Dynamic update not supported, Interim:dns Interactive update mode, AD-HOC: Special DNS update mode. 2) ignore  client-updates: Ignore client update. 3) subnet  192.168.99.0  netmask  255.255.255.0: Specifies the subnet of the configuration. 4) option  Routers: Default gateway address. 5) option  Subnet-mask: Sets the client subnet mask. 6) option  Nis-domain: Specifies the name of the NIS domain to which it belongs. 7) option  domain-name: Specify the domain name. 8) option  domain-name-servers: Specifies the DNS server address. 9) option  Time-offset: Specifies the client time offset to UTC. range  DYNAMIC-BOOTP: Address pool IP range. One) default-lease-time: Default IP address lease time. Max-lease-time: The maximum value of the client IP lease time. host  client: Defines the reserved clients address.     hardware  Ethernet: Network card MAC address.     fixed-address: the reserved IP address.  3. Information about the client leased IP address is stored in the lease database, and you can use the command:cat /var/lib/dhcpd/dhcpd.leases to view the lease database information. Note that the newly installed lease database is empty, requires a DHCP server to run, and has data records after the client is used.   4. Client configuration: 1) The configuration of the Windows client does not have to say much, the Earth people know that you can use the command ipconfig /renew refresh the address;  2) Configure the Linux client # vi /etc/sysconfig/ Network-.s/ifcfg-eth0 changed Bootproto=none to Bootproto=dhcp. Use command: # Ifdown eth0; Ifup eth0 Restart the NIC. OK, the client can use DHCP to get the IP address.   three, multi-scope and relay Agent configurationNext, let's look at the configuration of multi-scope and relay agents, or an example. A company has two subnets 192.168.99.0/24 and 192.168.100.0/24,192.168.100.0/24 network segments that use a relay proxy server. 1. Multi-scope configuration This situation is in the VLAN network, often need, here we installed on the DHCP server two network cards, connect two subnets, if there is a three-tier switch does not require multiple network cards, but the configuration of the DHCP server is the same, only need to configure a three-tier switch. We can use Ifconfig to check the usage of the NIC: Server configuration such as: 2. Relay Agent configuration The Relay Agent computer also needs to install the DHCP-3.0.5-18.EL5.I386.RPM package, by default, the relay agent computer does not forward the client's request and needs to use the command dhcrelay command to specify the DHCP server before forwarding. Such as: Four, DHCP security of the serverIf there is only one DHCP server on the network, once the server fails, all the clients in the network will be unable to obtain the IP address and the entire network will be paralyzed. To avoid this, we have to consider using a double-click Backup. When doing a two-machine backup, the scope of the DHCP server is divided into 80/20 rules, the master server manages 80% of the network IP address, and the secondary server manages 20% of the network IP address. In daily work, the allocation of TCP/IP information is done by the primary DHCP server, and the secondary DHCP server does not start working until the primary server is unavailable. Double-click Backup DHCP server method as described above, just as the configuration method, only in the partition of the address pool, the 80% address to the primary server division, 20% of the address to the secondary server division. We continue to take the first instance to illustrate that a secondary DHCP server is added to the first instance, and the primary DHCP server is configured as follows: The secondary DHCP server is configured as follows: v. Management and Monitoring DHCP ServerThe configuration of DHCP is very simple, but for some of the brothers who are accustomed to using graphics, they may feel somewhat abstract. However, fortunately, we have the means to solve, you can use the GADMIN-DHCPD program, configure a graphical user interface. Let's take a look at the specific ways to do this: 1. Environmental InspectionGADMIN-DHCPD requires GCC, Qt, GTK + and other software support, you can use the command rpm-qa|grep gcc; Rpm-qa|grep qt; Rpm-qa|grep GTK to check if these programs are installed in the system. In general, the GCC and QT system will be installed by default, but the GTK + system will not be installed by default, for example, my system does not install GTK +, let's look at the installation method of GTK +: 2. Installing support software GTK +1) GTK + requires the following software support to install:glib-2.12.10.tar.gz  (: ftp://ftp.gtk.org/pub/glib/2.12/) atk-1.10.1.tar.gz  (: FTP ://ftp.gtk.org/pub/gtk/v2.8/) freetype-2.3.9.tar.gz  (: http://sourceforge.net/projects/ FreeType) fontconfig-2.4.2.tar.gz  (:/http/www.fontconfig.org/release/) cairo-1.4.12.tar.gz  (:// cairographics.org/releases/) pango-1.14.10.tar.gz  (: ftp://ftp.gnome.org/pub/GNOME/sources/ Pango) libpng-1.2.10.tar.gz  (: http://www.libpng.org/pub/png/libpng.html) gtk+-2.10.12.tar.gz  (: ftp:// ftp.gtk.org/pub/gtk/v2.10/) 2) Set the environment variable in order to be able to find the corresponding library to compile during the installation, two environment variables are established first. Steps are as follows: # export  ld_library_path=/usr/local/lib# export  pkg_config_path=/usr/local/lib/pkgconfig3) Installation glib# tar  zxvf  glib-2.12.10.tar.gz# cd  glib-2.12.10#./configure# make# make  uninstall# make   INSTALL4) Install atk# tar  zxvf  atk-1.10.1.tar.gz# cd  atk-1.10.1#./configure# make# make  INSTALL5) Install freetype# tar  zxvf  freetype-2.3.9.tar.gz# cd  freetype-2.3.9#./configure# make# make  install6) installation fontconfig# tar  zxvf  fontconfig-2.4.2.tar.gz# cd& nbsp fontconfig#./configure# make# make  install7) Install the Cairo installation method, Ibid. 8) Install Pango installation method, ibid. 9) Install Libpng installation method, ibid. 10) Install the GTK + installation method, as above. 3. installation GADMIN-DHCPD Software:http://mange.dynalias.org/linux/gadmin-dhcpd/# tar zxvf gadmin-dhcpd-0.4.2.tar.gz# cd gadmin-dhcpd#./configure# make# Make Install 4. Use GADMIN-DHCPD SoftwareOn the command line, enter:/USR/LOCAL/SBIN/GADMIN-DHCPD, you can see the graphical configuration of the DHCP interface: The graphical configuration of the environment is set to complete, so that is not very convenient? OK,DHCP server to this deployment is complete.

This article is from the "Tonyguo de blog" Knowledge: "blog, be sure to keep this source http://tonyguo.blog.51cto.com/379574/172822

Linux Server Deployment Series four-DHCP

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.