• 2

GNS3 模擬 cisco switch 做vlan lab 無法互 ping 問題

大家好
我在GNS3上練習vlan 的lab,但發生交換機與交換機之間trank線路無法互ping
這三台交換機是路由器裝L2 switch模組模擬出來的,trank 線路連接是l2 swutch
介面乙太網對連的,ip目前都是綁在vlan id上面的,請熟cisco網路設備大大看
一下我是哪邊設定錯誤了

附上架構圖及設定檔
GNS3 模擬 cisco switch 做vlan lab 無法互 ping 問題

GNS3 模擬 cisco switch 做vlan lab 無法互 ping 問題

GNS3 模擬 cisco switch 做vlan lab 無法互 ping 問題


每一台run-start 設定

S1 設定部份

S1#sh running-config
Building configuration...

Current configuration : 1428 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname S1
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
no ip icmp rate-limit unreachable
ip cef
!
!
!
!
no ip domain lookup
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns 3
!
!
ip tcp synwait-time 5
!
!
interface Ethernet0/0
no ip address
shutdown
half-duplex
!
interface FastEthernet1/0
switchport access vlan 10
switchport mode trunk
!
interface FastEthernet1/1
!
interface FastEthernet1/2
!
interface FastEthernet1/3
!
interface FastEthernet1/4
!
interface FastEthernet1/5
!
interface FastEthernet1/6
!
interface FastEthernet1/7
!
interface FastEthernet1/8
!
interface FastEthernet1/9
!
interface FastEthernet1/10
!
interface FastEthernet1/11
!
interface FastEthernet1/12
!
interface FastEthernet1/13
!
interface FastEthernet1/14
!
interface FastEthernet1/15
switchport access vlan 10
!
interface Vlan1
no ip address
!
interface Vlan10
ip address 10.10.10.253 255.255.255.0
!
ip forward-protocol nd
ip route 0.0.0.0 0.0.0.0 10.10.10.254
!
!
no ip http server
no ip http secure-server
!
no cdp log mismatch duplex
!
!
control-plane
!

line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
line vty 0 4
login
!
!
end

S2 設定部份

S2#sh running-config
Building configuration...

Current configuration : 2090 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname S2
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
no ip icmp rate-limit unreachable
ip cef
!
!
no ip domain lookup
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns 3
!
ip tcp synwait-time 5
!
!
interface FastEthernet0/0
no ip address
shutdown
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface FastEthernet1/0
switchport access vlan 10
switchport mode trunk
!
interface FastEthernet1/1
switchport access vlan 20
switchport mode trunk
!
interface FastEthernet1/2
!
interface FastEthernet1/3
!
interface FastEthernet1/4
!
interface FastEthernet1/5
!
interface FastEthernet1/6
!
interface FastEthernet1/7
!
interface FastEthernet1/8
!
interface FastEthernet1/9
!
interface FastEthernet1/10
!
interface FastEthernet1/11
!
interface FastEthernet1/12
!
interface FastEthernet1/13
!
interface FastEthernet1/14
!
interface FastEthernet1/15
!
interface FastEthernet2/0
!
interface FastEthernet2/1
!
interface FastEthernet2/2
!
interface FastEthernet2/3
!
interface FastEthernet2/4
!
interface FastEthernet2/5
!
interface FastEthernet2/6
!
interface FastEthernet2/7
!
interface FastEthernet2/8
!
interface FastEthernet2/9
!
interface FastEthernet2/10
!
interface FastEthernet2/11
!
interface FastEthernet2/12
!
interface FastEthernet2/13
!
interface FastEthernet2/14
!
interface FastEthernet2/15
!
interface Vlan1
no ip address
!
interface Vlan10
ip address 10.10.10.254 255.255.255.0
!
interface Vlan20
ip address 10.10.20.254 255.255.255.0
vlan-id dot1q 20
exit-vlan-config
!
ip forward-protocol nd
!
!
no ip http server
no ip http secure-server
!
no cdp log mismatch duplex
no cdp run
!
!
control-plane
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
line vty 0 4
login
!
!
end

S2 show ip route 設定部份

S2#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

10.0.0.0/24 is subnetted, 2 subnets
C 10.10.10.0 is directly connected, Vlan10
C 10.10.20.0 is directly connected, Vlan20
S2#


S3 設定部份

S3#sh running-config
Building configuration...

Current configuration : 1439 bytes
!
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname S3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
no ip icmp rate-limit unreachable
ip cef
!
!
no ip domain lookup
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns 3
!
!
ip tcp synwait-time 5
!
!
interface Ethernet0/0
no ip address
shutdown
half-duplex
!
interface FastEthernet1/0
switchport access vlan 20
switchport mode trunk
!
interface FastEthernet1/1
!
interface FastEthernet1/2
!
interface FastEthernet1/3
!
interface FastEthernet1/4
!
interface FastEthernet1/5
!
interface FastEthernet1/6
!
interface FastEthernet1/7
!
interface FastEthernet1/8
!
interface FastEthernet1/9
!
interface FastEthernet1/10
!
interface FastEthernet1/11
!
interface FastEthernet1/12
!
interface FastEthernet1/13
!
interface FastEthernet1/14
!
interface FastEthernet1/15
switchport access vlan 20
!
interface Vlan1
no ip address
!
interface Vlan20
ip address 10.10.20.253 255.255.255.0
!
ip forward-protocol nd
ip route 0.0.0.0 0.0.0.0 10.10.20.254
!
!
no ip http server
no ip http secure-server
!
no cdp log mismatch duplex
no cdp run
!
!
control-plane
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
line vty 0 4
login
!
!
end
2018-07-03 18:04 發佈
去買 真機吧 現在cisco switch 二、三千 就有了 很便宜
2筆layer 2 vlan,沒有layer 3誰幫你routing?
謝謝你得建議,實體機有買,後來要用就壞掉了,還沒買新的進來所以用GNS3

lienyu wrote:
2筆layer 2...(恕刪)


有想過這個問題,但是目前狀況S1和S2是互連又同一個網段就ping不到
印象中介面兩個互連因該不需要routing

算需要我也有設一筆靜態路由也不行

謝謝你的回答
看你用的IOS是哪型號,一般29XX的是L2,38XX的是L3
L2設備綁的IP並無完整的L3功能,一般是用來做管理的,除非是L3 Switch

真正要互測的對象應由PC1跟2來測會較實際
兩網段的匣道要綁在S2上,並指定給相異的VLAN上
S1與S3則指定給相異的兩VLAN,PC1跟2則分別指定相異VLAN的匣道
然後從兩PC去ping匣道,有通了就前置作業完成
後面要做如ACL或相異兩VLAN不可通的LAB就比較簡單了

tsengleoo wrote:
看你用的IOS是哪...(恕刪)


謝謝你,目前狀況也是PC1無法連PC2,所以逐步測試
pc1去ping s1是沒問題,但pc1去ping s2就不通囉
所以問題點就是s1到s2的trank上有問題,從s1去
ping s2也不通,因GNS3本身無法模擬真正cisco
switch IOS所以都是路由器裝L2 switch模組達成的
實際上因該可以把它看成L3 switch只是模組是L2的
而已,目前就不清楚是不是模擬器問題,下圖為S2 S1和
S3版本資訊





你全設錯了

實體機 不貴,在露天有專門在賣cisco 二手設備的

一台cisco 3750 也才二千多,


s1 的 1/0 trunk 指令不對 設trunk 不需要設定 vlan

再來是 s1 不要設 vlan10
也不要設 vlan10 的ip


s2 的問題也一樣 f1/0 f1/1 要設trunk 就不指定vlan
我不知這部份是不是模擬器上的關係

實體機上cisco 的trunk 預設就能通行所有的vlan
所以設trunk 是不用設vlan的

cisco 的 L3 預設是能路由VLAN 之間的路由..
如果要啟動 靜態/動態路由 要下指令 ip routing


我覺的你用虛擬的,有些指令可能是錯的,但是虛擬器 似乎不會告知
trunk port 定switch mode trunk 不用設定access vlan 多少,trunk port 的access vlan 拿掉

往下接PC的除了設定access vlan 之外,還要設定switch mode access,補上看看

兩台PC先ping 自己gateway,就是S2 上兩個VLAN IP,有通表示你L2 是打通沒問題,再來去看路由

沒通表示你L2 打通有問題,去查VLAN 打通的設定

以上~
如果你的s2是 L3 SW,那你F1/0、F1/1用的TRUNK指令就錯了,對接的S1、S3只要下對應的TRUNK指令、接PC的PORT才要指定vlan,基本上l3上的defaul route就能通了,所以你的設定基本上全是錯的,不通很正常。詳細指令就請google吧
  • 2
內文搜尋
X
評分
評分
複製連結
Mobile01提醒您
您目前瀏覽的是行動版網頁
是否切換到電腦版網頁呢?