Home | 简体中文 | 繁体中文 | 杂文 | Github | 知乎专栏 | 51CTO学院 | CSDN程序员研修院 | OSChina 博客 | 腾讯云社区 | 阿里云栖社区 | Facebook | Linkedin | Youtube | 打赏(Donations) | About
知乎专栏多维度架构

25.2. DHCP

25.2.1. DHCP Server

eth0 公网ip

eth1 192.168.0.1 255.255.255.0

eth2 192.168.1.1 255.255.255.0

		
dhcpd.conf配置内容如下:

#Sample /etc/dhcpd.conf
default-lease-time 1200;
max-lease-time 19200;
option domain-name-servers 202.102.192.68,202.102.199.68; 
#option domain-name "test.test";
ddns-update-style ad-hoc;

subnet 192.168.0.0 netmask 255.255.255.0 {
	range 192.168.0.20 192.168.0.200;
	option subnet-mask 255.255.255.0;
	option broadcast-address 192.168.0.255;
	option routers 192.168.0.1;
}
subnet 192.168.1.0 netmask 255.255.255.0 {
	range 192.168.1.20 192.168.1.200;
	option subnet-mask 255.255.255.0;
	option broadcast-address 192.168.1.255;
	option routers 192.168.1.1;
}		
		
		

25.2.2. dhclient

all interface

		 
$ sudo dhclient			
		
		

eth0

		 
$ sudo dhclient eth0			
		
		

25.2.3. release matching connections

windows

		
  > ipconfig /release
  > ipconfig /renew