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