21-DHCP Relay技术 //IOU模拟
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了21-DHCP Relay技术 //IOU模拟相关的知识,希望对你有一定的参考价值。
一、实验拓扑:
二、命令部署:
1、基本命令:
Server(config)#int f1/0
Server(config-if)#no shutdown
Server(config-if)#no switchport
Server(config-if)#ip add 172.168.24.1 255.255.255.0
Server(config)#ip dhcp pool vlan10
Server(dhcp-config)#network 192.168.10.0 255.255.255.0
Server(dhcp-config)#default-router 192.168.10.254
Server(dhcp-config)#dns-server 8.8.8.8
Server(dhcp-config)#lease 15
Server(config)#ip dhcp pool vlan20
Server(dhcp-config)#network 192.168.20.0 255.255.255.0
Server(dhcp-config)#default-router 192.168.20.254
Server(dhcp-config)#dns-server 8.8.8.8
Server(dhcp-config)#lease 30
Server(config)#ip dhcp excluded-address 192.168.10.254
Server(config)#ip dhcp excluded-address 192.168.20.254
Server(config)#ip routing
Server(config)#router ospf 100
Server(config-router)#network 172.168.24.0 0.0.0.255 area 0
SW1(config)#int f1/0
SW1(config-if)#no shutdown
SW1(config-if)#no switchport
SW1(config-if)#ip address 172.168.24.2 255.255.255.0
SW1(config)#int f1/1
SW1(config-if)#no shutdown
SW1(config-if)#switchport trunk encapsulation dot1q
SW1(config-if)#switchport mode trunk
SW1(config)#int vlan 10
SW1(config-if)#no shutdown
SW1(config-if)#ip address 192.168.10.254 255.255.255.0
SW1(config)#int vlan 20
SW1(config-if)#no shutdown
SW1(config-if)#ip address 192.168.20.254 255.255.255.0
SW1(config)#ip routing
SW1(config)#router ospf 100
SW1(config-router)#network 172.168.24.0 0.0.0.255 area 0
SW1(config-router)#network 192.168.10.0 0.0.0.255 area 0
SW1(config-router)#network 192.168.20.0 0.0.0.255 area 0
SW2(config)#int f1/0
SW2(config-if)#no shutdown
SW2(config-if)#switchport trunk encapsulation dot1q
SW2(config-if)#switchport mode trunk
SW2(config)#int f1/1
SW2(config-if)#no shutdown
SW2(config-if)#switchport mode access
SW2(config-if)#switchport access vlan 10
SW2(config)#int f1/2
SW2(config-if)#no shutdown
SW2(config-if)#switchport mode access
SW2(config-if)#switchport access vlan 20
SW2(vlan)#vlan 10
VLAN 10 added:
Name: VLAN0010
SW2(vlan)#vlan 20
VLAN 20 added:
Name: VLAN0020
SW2(config)#no ip routing
PC1(config)#int f0/0
PC1(config-if)#no shutdown
PC1(config-if)#ip address dhcp
PC1(config)#no ip routing
PC1(config)#ip default-gateway 192.168.10.254
PC2(config)#int f0/0
PC2(config-if)#no shutdown
PC2(config-if)#ip address dhcp
PC2(config)#no ip routing
PC2(config)#ip default-gateway 192.168.20.254
2、重点命令:
SW1(config)#int vlan 10
SW1(config-if)#ip helper-address 172.168.24.1
SW1(config)#int vlan 20
SW1(config-if)#ip helper-address 172.168.24.1
三、验证:
(1)交换机SW2和三层交换机SW1抓包
VLAN20发出的DHCP Discover
VLAN10发出的DHCP Discover
(2)Server端和三层交换机SW1之间抓包
GNS3-0.8.6
GNS3:IOU
结论:必须要用IOU做才有效果,其它模拟命令可以敲,但是都没有效果的。
以上是关于21-DHCP Relay技术 //IOU模拟的主要内容,如果未能解决你的问题,请参考以下文章
20-Etherchannel 以太通道链路冗余技术(三层冗余) //IOU模拟
24-BPDU Filter和BPDU Guard(BPDU过滤和防护) //IOU模拟