各位先進好, 我有一個問題想請教, 我在Packet Tracer中設定了一個L3交換器切VLAN並搭配DHCP Server的環境, 設定好之後這個DHCP會負責發送IP給各VLAN. 但當我要把這組環境改用GNS3模擬環境來實做時, 各VLAN卻無法成功拿到IP, 想請問可能是什麼原因!?
1841充當DHCP Server的設定節錄
ip dhcp excluded-address 192.168.1.1 192.168.1.51
ip dhcp excluded-address 192.168.1.240 192.168.1.254
ip dhcp excluded-address 192.168.4.1 192.168.4.49
ip dhcp excluded-address 192.168.4.200 192.168.4.254
ip dhcp excluded-address 192.168.10.1 192.168.10.159
ip dhcp excluded-address 192.168.10.230 192.168.10.254
ip dhcp excluded-address 192.168.11.1 192.168.11.49
ip dhcp excluded-address 192.168.11.200 192.168.11.254
ip dhcp excluded-address 192.168.12.1 192.168.12.49
ip dhcp excluded-address 192.168.12.200 192.168.12.254
!
ip dhcp pool pool_1
network 192.168.1.0 255.255.255.0
default-router 192.168.1.254
dns-server 192.168.1.5
ip dhcp pool pool_104
network 192.168.4.0 255.255.255.0
default-router 192.168.4.3
dns-server 192.168.1.5
ip dhcp pool pool_110
network 192.168.10.0 255.255.255.0
default-router 192.168.10.3
dns-server 192.168.1.5
ip dhcp pool pool_111
network 192.168.11.0 255.255.255.0
default-router 192.168.11.3
dns-server 192.168.1.5
ip dhcp pool pool_112
network 192.168.12.0 255.255.255.0
default-router 192.168.12.3
dns-server 192.168.1.5
!
interface FastEthernet0/0
ip address 192.168.1.254 255.255.255.0
duplex auto
speed auto
!
ip route 192.168.4.0 255.255.255.0 192.168.1.3
ip route 192.168.10.0 255.255.255.0 192.168.1.3
ip route 192.168.11.0 255.255.255.0 192.168.1.3
ip route 192.168.12.0 255.255.255.0 192.168.1.3
L3 Switch的設定節錄
ip routing
!
interface FastEthernet0/1
switchport trunk encapsulation dot1q
switchport mode access
interface FastEthernet0/2
switchport mode access
interface FastEthernet0/9
switchport access vlan 104
switchport mode access
interface FastEthernet0/13
switchport access vlan 110
switchport mode access
interface FastEthernet0/17
switchport access vlan 111
switchport mode access
interface FastEthernet0/21
switchport access vlan 112
switchport mode access
interface Vlan1
ip address 192.168.1.3 255.255.255.0
interface Vlan104
ip address 192.168.4.3 255.255.255.0
ip helper-address 192.168.1.254
interface Vlan110
ip address 192.168.10.3 255.255.255.0
ip helper-address 192.168.1.254
interface Vlan111
ip address 192.168.11.3 255.255.255.0
ip helper-address 192.168.1.254
interface Vlan112
ip address 192.168.12.3 255.255.255.0
ip helper-address 192.168.1.254
!
interface Vlan1
ip address 192.168.1.3 255.255.255.0
!
interface Vlan104
ip address 192.168.4.3 255.255.255.0
ip helper-address 192.168.1.254
!
interface Vlan110
ip address 192.168.10.3 255.255.255.0
ip helper-address 192.168.1.254
!
interface Vlan111
ip address 192.168.11.3 255.255.255.0
ip helper-address 192.168.1.254
!
interface Vlan112
ip address 192.168.12.3 255.255.255.0
ip helper-address 192.168.1.254
試著將你的指令放入 Packet Tracer 跑了一次,發現將指令貼在 L3 交換器時,interface Vlan1 不會自己 UP,要進介面 no shutdown 才會 UP,所以在猜 GNS3 會不會也是這個問題?
interface Vlan1 UP 之後後面的 PC 都有正常拿到 IP,所以指令基本上都是 OK 的。
小小提醒 L3 交換器這裡
interface FastEthernet0/1
switchport trunk encapsulation dot1q
switchport mode access <= 雖然是模擬環境,但這個 interface 是 trunk 的話,是不是就不需要下這個指令了?