标签:ospf lease relay src 交换机 over 效果 com port
一、实验拓扑: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做才有效果,其它模拟命令可以敲,但是都没有效果的。
标签:ospf lease relay src 交换机 over 效果 com port
原文地址:http://blog.51cto.com/13856092/2137430