Linux DHCP service Setup

Source: Internet
Author: User
Tags nameserver

the construction of Linux DHCP

View IP address information:ifconfig eth0 ifconfig-a(view all)

View host name:hostname

View tcp/udp port:netstat-anptu-a(All) - n(digital) - P(process) - t(tcp) - u(UDP)

Tracking network nodes:traceroute

To view DNS resource records:nslookup

Configure IP address (temporary):

Ifconfig eth0 IP address

Ifconfig eth0:1 IP address

Configure host Name:hostname hostname

Configure default gateway:route add default GW gateway address

Delete:route del default GW gateway address

Set network parameters (fixed)

Modify /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE: Sets the name of the network interface

Onboot: Set whether the network interface is Activated when the Linux system starts

Bootproto: Setting the network interface configuration static(static) DHCP(dynamic)

IPADDR: Set the IP address of the network interface

NETMASK: Subnet mask

Gateway: setting up Gateways

Modify host Name:/etc/sysconfig/network

Set the DNS server address (preferred and alternate DNS) to modify /etc/resolv.cof add: NameServer 202.10.0.20 (preferred) nameserver 202.106.151.46 (standby)

DHCP Service Setup

1. Install the package (on the Linux system installation CD)

Query: rpm-qa | grep dhcp

Installation: RPM-IVH DHP

Service script:/ETC/INIT.D/DHCPD

Master configuration file:/etc/dhcp/dhcpd.conf

Protocol port: DUP(server) UDP ( client ) query:netstat-anpu

Dhcp Template:cp/usr/share/doc/dhcp-4.1.1/dhcpd.conf.sample/etc/dhcp/dhcpd.conf

Modified:subnet 192.168.1.0 netmask 255.255.255.0 {

Range 192.168.1.100 192.168.1.200; ( define address pool )

Option subent-mask 255.255.255.0; ( define subnet mask )

Otpion routers 192.168.1.1; ( define Gateway )

Option dpmain-name-servers 202.106.0.20; (define DNS service address)

}

Reserved address:

Host name {

Hardware Ethernet Keep the mac address of the host

Fixed-address 192.168.1.99; (Reserved IP)

}

Troubleshooting (View log):tail-30/var/log/messages

Linux clients get IPautomatically:dhclient-d eth0


This article from "Xu Willow Blog" blog, please be sure to keep this source http://xylbk.blog.51cto.com/10543671/1741008

Linux DHCP service Setup

Related Article

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.