請教各位大俠:
拓撲圖如下,目的是PC1-5都能獲取到DHCPServer的動態地址,在Router路由器上做了DHCP relay的配置,各個路由器和交換機的配置見后面,現在問題是:
1、192.168.88.253可以ping通254,但192.168.88.254無法ping通253。
2、192.168.99.11可以ping通21,但192.168.99.21無法ping通11,同理,11可以ping通31、23等交換機,但反過來Ping .11都ping不通

Router的配置清單:
[V200R003C00]
<Huawei> system-view
[Huawei]sysname Router
[Router]vlan batch 100 200 300 888 999
[Router]dhcp enable
[Router]interface Vlanif 100
[Router-Vlanif100]ip address 192.168.10.1 255.255.255.0
[Router-Vlanif100]dhcp select relay
[Router-Vlanif100]dhcp relay server-ip 192.168.88.254
[Router-Vlanif100]quit
[Router]interface Vlanif 200
[Router-Vlanif200]ip address 192.168.20.1 255.255.255.0
[Router-Vlanif200]dhcp select relay
[Router-Vlanif200]dhcp relay server-ip 192.168.88.254
[Router-Vlanif200]quit
[Router]interface Vlanif 300
[Router-Vlanif300]ip address 192.168.30.1 255.255.255.0
[Router-Vlanif300]dhcp select relay
[Router-Vlanif300]dhcp relay server-ip 192.168.88.254
[Router-Vlanif300]quit
[Router]interface Vlanif888
[Router-Vlanif888]ip address 192.168.88.253 255.255.255.0
[Router-Vlanif888]quit
[Router]interface Vlanif999
[Router-Vlanif999]description Management-vlan
[Router-Vlanif999]ip address 192.168.99.11 255.255.255.0
[Router-Vlanif999]quit
[Router]interface Ethernet0/0/0
[Router-Ethernet0/0/0]description To_DHCPServer
[Router-Ethernet0/0/0]port link-type trunk
[Router-Ethernet0/0/0]port trunk allow-pass vlan 2 to 4094
[Router-Ethernet0/0/0]quit
[Router]interface Ethernet0/0/1
[Router-Ethernet0/0/1]description To_Switch0
[Router-Ethernet0/0/1]port link-type trunk
[Router-Ethernet0/0/1]port trunk allow-pass vlan 2 to 4094
[Router-Ethernet0/0/1]quit
[Router]interface Ethernet0/0/3
[Router-Ethernet0/0/3]description To_Switch3
[Router-Ethernet0/0/3]port link-type trunk
[Router-Ethernet0/0/3]port trunk allow-pass vlan 2 to 4094
[Router-Ethernet0/0/3]quit
[Router]interface Ethernet0/0/8
[Router-Ethernet0/0/8]description To_Output
[Router-Ethernet0/0/8]quit
[Router]ip route-static 0.0.0.0 0.0.0.0 192.168.88.254
DHCP Server的配置清單:
[V200R003C00]
<Huawei> system-view
[Huawei]sysname DHCPServer
[DHCPServer]vlan batch 888 999
[DHCPServer]dhcp enable
[DHCPServer]ip pool ForVlan100
[DHCPServer-ip-pool-ForVlan100]network 192.168.10.0 mask 255.255.255.0
[DHCPServer-ip-pool-ForVlan100]excluded-ip-address 192.168.10.2 192.168.10.99
[DHCPServer-ip-pool-ForVlan100]excluded-ip-address 192.168.10.200 192.168.10.254
[DHCPServer-ip-pool-ForVlan100]dns-list 172.16.8.8
[DHCPServer-ip-pool-ForVlan100]gateway-list 192.168.10.1
[DHCPServer-ip-pool-ForVlan100]quit
[DHCPServer]ip pool ForVlan200
[DHCPServer-ip-pool-ForVlan200]network 192.168.20.0 mask 255.255.255.0
[DHCPServer-ip-pool-ForVlan200]excluded-ip-address 192.168.20.2 192.168.20.99
[DHCPServer-ip-pool-ForVlan200]excluded-ip-address 192.168.20.200 192.168.20.254
[DHCPServer-ip-pool-ForVlan200]dns-list 172.16.8.8
[DHCPServer-ip-pool-ForVlan200]gateway-list 192.168.20.1
[DHCPServer-ip-pool-ForVlan200]quit
[DHCPServer]ip pool ForVlan300
[DHCPServer-ip-pool-ForVlan300]network 192.168.30.0 mask 255.255.255.0
[DHCPServer-ip-pool-ForVlan300]excluded-ip-address 192.168.30.2 192.168.30.99
[DHCPServer-ip-pool-ForVlan300]excluded-ip-address 192.168.30.200 192.168.30.254
[DHCPServer-ip-pool-ForVlan300]dns-list 172.16.8.8
[DHCPServer-ip-pool-ForVlan300]gateway-list 192.168.30.1
[DHCPServer-ip-pool-ForVlan300]quit
[DHCPServer]interface Vlanif888
[DHCPServer-Vlanif888]ip address 192.168.88.254 255.255.255.0
[DHCPServer-Vlanif888]dhcp select global
[DHCPServer-Vlanif888]quit
[DHCPServer]interface Vlanif999
[DHCPServer-Vlanif999]description Management-vlan
[DHCPServer-Vlanif999]ip address 192.168.99.254 255.255.255.0
[DHCPServer-Vlanif999]quit
[DHCPServer]interface Ethernet0/0/0
[DHCPServer-Ethernet0/0/0]description To_Router
[DHCPServer-Ethernet0/0/0]port link-type trunk
[DHCPServer-Ethernet0/0/0]port trunk allow-pass vlan 2 to 4094
[DHCPServer-Ethernet0/0/0]quit
[DHCPServer]ip route-static 0.0.0.0 0.0.0.0 192.168.88.253
Switch0的配置清單:
<Huawei> system-view
[Huawei]sysname Switch0
[Switch0]vlan batch 100 200 999
[Switch0-Vlanif999]description Management-vlan
[Switch0-Vlanif999]ip address 192.168.99.21 255.255.255.0
[Switch0-Vlanif999]quit
[Switch0]interface GigabitEthernet0/0/21
[Switch0-GigabitEthernet0/0/21]description To_Switch1
[Switch0-GigabitEthernet0/0/21]port link-type trunk
[Switch0-GigabitEthernet0/0/21]port trunk allow-pass vlan 2 to 4094
[Switch0-GigabitEthernet0/0/21]quit
[Switch0]interface GigabitEthernet0/0/22
[Switch0-GigabitEthernet0/0/22]description To_Switch2
[Switch0-GigabitEthernet0/0/22]port link-type trunk
[Switch0-GigabitEthernet0/0/22]port trunk allow-pass vlan 2 to 4094
[Switch0-GigabitEthernet0/0/22]quit
[Switch0]interface GigabitEthernet0/0/24
[Switch0-GigabitEthernet0/0/24]description To_Router
[Switch0-GigabitEthernet0/0/24]port link-type trunk
[Switch0-GigabitEthernet0/0/24]port trunk allow-pass vlan 2 to 4094
[Switch0-GigabitEthernet0/0/24]quit
[Switch0]ip route-static 0.0.0.0 0.0.0.0 192.168.99.11
Switch1的配置清單:
<Huawei> system-view
[Huawei]sysname Switch1
[Switch1]vlan batch 100 999
[Switch1]interface Vlanif999
[Switch1-Vlanif999]description Management-vlan
[Switch1-Vlanif999]ip address 192.168.99.31 255.255.255.0
[Switch1-Vlanif999]quit
[Switch1]port-group 123
[Switch1-port-group-123]group-member GigabitEthernet 0/0/1 to g0/0/16
[Switch1-port-group-123]port link-type access
[Switch1-port-group-123]port default vlan 100
[Switch1-port-group-123]quit
[Switch1]undo port-group 123
[Switch1]interface GigabitEthernet0/0/24
[Switch1-GigabitEthernet0/0/24]description To_Switch0
[Switch1-GigabitEthernet0/0/24]port link-type trunk
[Switch1-GigabitEthernet0/0/24]port trunk allow-pass vlan 2 to 4094
[Switch1-GigabitEthernet0/0/24]quit
[Switch1]ip route-static 0.0.0.0 0.0.0.0 192.168.99.11
Switch2的配置清單:
<Huawei> system-view
[Huawei]sysname Switch2
[Switch2]vlan batch 100 200 999
[Switch2]interface Vlanif999
[Switch2-Vlanif999]description Management-vlan
[Switch2-Vlanif999]ip address 192.168.99.32 255.255.255.0
[Switch2-Vlanif999]quit
[Switch2]port-group 123
[Switch2-port-group-123]group-member GigabitEthernet 0/0/1 to g0/0/8
[Switch2-port-group-123]port link-type access
[Switch2-port-group-123]port default vlan 100
[Switch2-port-group-123]quit
[Switch2]undo port-group 123
[Switch2]port-group 456
[Switch2-port-group-456]group-member GigabitEthernet 0/0/9 to g0/0/16
[Switch2-port-group-456]port link-type access
[Switch2-port-group-456]port default vlan 200
[Switch2-port-group-456]quit
[Switch2]undo port-group 456
[Switch2]interface GigabitEthernet0/0/24
[Switch2-GigabitEthernet0/0/24]description To_Switch0
[Switch2-GigabitEthernet0/0/24]port link-type trunk
[Switch2-GigabitEthernet0/0/24]port trunk allow-pass vlan 2 to 4094
[Switch2-GigabitEthernet0/0/24]quit
[Switch2]ip route-static 0.0.0.0 0.0.0.0 192.168.99.11
Switch3的配置清單:
<Huawei> system-view
[Huawei]sysname Switch3
[Switch3]vlan batch 200 300 999
[Switch3]interface Vlanif999
[Switch3-Vlanif999]description Management-vlan
[Switch3-Vlanif999]ip address 192.168.99.23 255.255.255.0
[Switch3-Vlanif999]quit
[Switch3]port-group 123
[Switch3-port-group-123]group-member GigabitEthernet 0/0/1 to g0/0/8
[Switch3-port-group-123]port link-type access
[Switch3-port-group-123]port default vlan 200
[Switch3-port-group-123]quit
[Switch3]undo port-group 123
[Switch3]port-group 456
[Switch3-port-group-456]group-member GigabitEthernet 0/0/9 to g0/0/16
[Switch3-port-group-456]port link-type access
[Switch3-port-group-456]port default vlan 300
[Switch3-port-group-456]quit
[Switch3]undo port-group 456
[Switch3]interface GigabitEthernet0/0/24
[Switch3-GigabitEthernet0/0/24]description To_Router
[Switch3-GigabitEthernet0/0/24]port link-type trunk
[Switch3-GigabitEthernet0/0/24]port trunk allow-pass vlan 2 to 4094
[Switch3-GigabitEthernet0/0/24]quit
[Switch3]ip route-static 0.0.0.0 0.0.0.0 192.168.99.11
uj5u.com熱心網友回復:
還有一個疑問,就是為什么router和DHCPserver之間,只需要配置vlanif888 192.168.88.253/254,兩者就可以通信呢?而不需要把IP地址配置到物理介面上(如router的e0/0/0和DHCPServer的e0/0/0上),這個通信的原理是什么?還請大俠們指點一下,謝謝!uj5u.com熱心網友回復:
請問有大俠指點嗎?uj5u.com熱心網友回復:
這個問題屬于三層交換里面的問題或者查查交換相關的資料,查查資料就可以了
你交換機上所有[Switch0]ip route-static 0.0.0.0 0.0.0.0 192.168.99.11 類似這條的 靜態 都去掉 就正常了 你寫這條不對 就都可以ping通了
uj5u.com熱心網友回復:
你之所以會寫這條ip route-static 0.0.0.0 0.0.0.0 192.168.99.11 就是不知道如果vlan之間啟用了vlanif 配置了地址vlan之間就是可以互通的,而兩個設備之間采用的trunk,那么如果兩個設備上都有相同vlanif介面也會相同 所以不需要寫這個路由。而同一臺sw劃分了vlan 并且在相應vlan啟用了vlanif介面并且配置了地址 那么vlan間的機器是互通的,要想不互通就需要寫acl 用traffic policy呼叫在vlan下 或者sw的全域上面
uj5u.com熱心網友回復:
你這個需求用ACL更簡單。用IF DHCP太復雜了。uj5u.com熱心網友回復:
如果起trunk了, 靜態路由就不需要寫了轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/17036.html
標籤:交換及路由技術
上一篇:用qos完美保證voip下載
