DHCP、DHCP继电器
一. DHCP
一、配置交换机:
开关ENA
Switch#conf
配置来自from terminal,memory,or network [terminal]?
Enter configuration commands,one per line. End with CNTL/Z。
sitch(config ) #vlan 10
sitch(config-VLAN ) #vlan 20
sitch (配置- VLAN ) #exit
switch(config ) #int f0/1
switch(config-if ) #sw acc vlan 10
sitch(config-if ) #int f0/2
switch(config-if ) #sw acc vlan 20
sitch(config-if ) #int f0/3
switch(config-if ) # SW模式中继
switch(config-if ) #exit
二、配置路由器:
1、配备网关:
Routerena
Router#conf
配置来自from terminal,memory,or network [terminal]?
Enter configuration commands,one per line. End with CNTL/Z。
router(config ) #int f0/0
Router(config-if ) #no shu
路由器(config-if ) #int f0/0.10
router(config-subif ) #加密核心1q 10
router(config-subif ) # IP地址192.168.10.254255.255.255.255.0
路由器(config-subif ) #int f0/0.20
路由器(config-subif ) #加密核心20
router(config-subif ) # IP address 192.168.20.254255.255.255.255.255.255.0
router(config-subif ) #do show ip int b
2、配置DHCP服务:
router(config ) #ip dhcp pool vlan10创建地址池
路由器(DHCP-config ) #网络192.168.10.0255.255.255.0网段、子网掩码
路由器(DHCP-config ) #默认路由器192.168.10.254默认网关
路由器(DHCP-config ) #dns-server 1.1.1.1 DNS服务器地址
router(DHCP-config ) #exit
路由器(config ) # ipdhcpexcluded-address 192.168.10.1192.168.10.10排除地址
router(config ) #ip dhcp pool vlan20
Router(DHCP-config ) #网络192.168.20.0255.255.255.255.0
路由器(DHCP-config ) #default-router 192.168.20.254
router(DHCP-config ) #dns-server 1.1.1.1
router(DHCP-config ) #exit
router(config ) # ipdhcpexcluded-address 192.168.20.1192.168.20.10
三、测试
二. DHCP继电器
一、配置交换机:
开关ENA
Switch#conf
配置来自from terminal,memory,or network [terminal]?
Enter configuration commands,one per line. End with CNTL/Z。
sitch(config ) #vlan 10
sitch(config-VLAN ) #vlan 20
sitch (配置- VLAN ) #exit
switch(config ) #int f0/1
switch(config-if ) #sw acc vlan 10
sitch(config-if ) #int f0/2
switch(config-if ) #sw acc vlan 20
sitch(config-if ) #int f0/3
switch(config-if ) # SW模式中继
switch(config-if ) #exit
二、配置路由器router0:
Routerena
Router#conf
配置来自from terminal,memory,or network [terminal]?
Enter configuration commands,one per line. End with CNTL/Z。
router(config ) #int f0/0
Router(config-if ) #no shu
路由器(config-if ) #int f0/0.10
router(config-subif ) #加密核心1q 10
router(config-subif ) # IP地址192.168.10.254255.255.255.255.0
路由器(config-subif ) #ip helper-address 12.1.1.1配置继电器
路由器(config-subif ) #int f0/0.20
路由器(config-subif ) #加密核心20
router(config-subif ) # IP address 192.168.20.254255.255.255.255.255.255.0
路由器(config-subif ) #ip helper-address 12.1.1.1配置继电器
router(config-subif ) #exit
router(config ) #int f0/1
router(config-if ) #ip add 12.1.1.2 255.255.255.0
router(config-if ) #no shutdown
三、配置路由器router2:
Routerena
Router#conf
配置来自from terminal,memory,or network [terminal]?
Enter configuration commands,one per line. End with CNTL/Z。
router(config ) #int f0/0
router(config-if ) #ip add 12.1.1.1 255.255.255.0
router(config-if ) #no shutdown
router(config-if ) #exit
路由器(config ) # IP路由0.0.0.0.0 ) 12.1.1.2配置路由
router(config ) #ip dhcp pool vlan10
Router(DHCP-config ) #网络192.168.10.0255.255.255.0
路由器(DHCP-config ) #default-router 192.168.10.254
router(DHCP-config ) #dns-server 1.1.1.1
router(DHCP-config ) #exit
router(config ) #ip dhcp pool vlan20
Router(DHCP-config ) #网络192.168.20.0255.255.255.255.0
路由器(DHCP-config ) #default-router 192.168.20.254
router(DHCP-config ) #dns-server 1.1.1.1
router(DHCP-config ) #exit
路由器(config ) #
四、测试