PC0和PC1是同一VLAN 10,PC2是VLAN 20,要實現PC0 ping通PC2,這些裝置應該怎麼設定

2021-05-05 07:54:54 字數 9996 閱讀 6727

1樓:

你用單臂路由或著用一臺三層交換機就可以解決。

2樓:大爺是我是大爺

我把交換機和路由器的配置列出來給你

交換機f0/1 f0/2 都再vlan10 下 f0/3 在vlan20 下 f0/4 配置為trunk

路由器f0/0 用單臂路由技術

下面是配置

switch#sho run

building configuration...

current configuration : 1185 bytes

!version 12.2

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!hostname switch!!

!inte***ce fastethernet0/1

switchport access vlan 10

switchport mode access

!inte***ce fastethernet0/2

switchport access vlan 10

switchport mode access

!inte***ce fastethernet0/3

switchport access vlan 20

switchport mode access

!inte***ce fastethernet0/4

switchport mode trunk

!inte***ce fastethernet0/5

!inte***ce fastethernet0/6

!inte***ce fastethernet0/7

!inte***ce fastethernet0/8

!inte***ce fastethernet0/9

!inte***ce fastethernet0/10

!inte***ce fastethernet0/11

!inte***ce fastethernet0/12

!inte***ce fastethernet0/13

!inte***ce fastethernet0/14

!inte***ce fastethernet0/15

!inte***ce fastethernet0/16

!inte***ce fastethernet0/17

!inte***ce fastethernet0/18

!inte***ce fastethernet0/19

!inte***ce fastethernet0/20

!inte***ce fastethernet0/21

!inte***ce fastethernet0/22

!inte***ce fastethernet0/23

!inte***ce fastethernet0/24

!inte***ce gigabitethernet1/1

!inte***ce gigabitethernet1/2

!inte***ce vlan1

no ip address

shutdown!!

line con 0

!line vty 0 4

login

line vty 5 15

login!!

endswitch#

路由器router#show run

building configuration...

current configuration : 628 bytes

!version 12.4

no service timestamps log datetime msec

no service timestamps debug datetime msec

no service password-encryption

!hostname router!!

!!!!

!!!!

!!!!

!!!!

inte***ce fastethernet0/0

no ip address

duplex auto

speed auto

!inte***ce fastethernet0/0.10

encapsulation dot1q 10

ip address 192.168.10.1 255.255.255.0

!inte***ce fastethernet0/0.20

encapsulation dot1q 20

ip address 192.168.20.1 255.255.255.0

!inte***ce fastethernet0/1

no ip address

duplex auto

speed auto

shutdown

!inte***ce vlan1

no ip address

shutdown

!ip classless!!

!!!!

!line con 0

line vty 0 4

login!!

!end

router#

樓主 給分

pc0和pc2屬vlan 10,pc1屬vlan 20,怎樣才能相互ping通??求大神幫助!求大神把全部**貼出來

3樓:匿名使用者

大神也不行,vlan間需要路由,你需要加一臺路由器做單臂路由,或者把其中一臺交換換做三層的啟用iprouting

4樓:匿名使用者

= =. 用三層交換機 . 設定svi介面就行了請給分

兩個不同vlan間怎麼才能互相ping通,不要解釋,需要配置命令!要**!!!pc0和pc1是一個

5樓:匿名使用者

這裡,核心的一口接sw0的一口;sw0 的一口接sw1上網一口;sw1的二口接pc0,三口接pc1,四口接pc2,五口接pc3;pc0和pc1網段是192.168.1.

0網段,掩碼是255.255.255.

0,閘道器地址是192.168.1.

1;pc2和pc3網段是192.168.2.

0網段,子網掩碼四255.255.255.

0,閘道器地址是192.168.2.

1,四臺電腦都可以自動獲取地址

核心配置:

vlan 10

vlan 20

inte***ce vlan10

ip address 192.168.1.1 255.255.255.0

no shutdown

inte***ce vlan20

ip address 192.168.2.1 255.255.255.0

no shutdown

ip dhcp pool 10

network 192.168.1.0 255.255.255.0

default-router 192.168.1.1

dns-server 8.8.8.8

ip dhcp pool 20

network 192.168.2.0 255.255.255.0

default-router 192.168.2.1

dns-server 8.8.8.8

iprouting

inte***ce fastethernet0/1

switchport trunk encapsulation dot1q

switchport mode trunk

sw0配置:

vlan 10

vlan 20

inte***ce fastethernet0/1

switchport mode trunk

inte***ce fastethernet0/2

switchport mode trunk

sw1配置:

vlan 10

vlan 20

inte***ce fastethernet0/1

switchport mode trunk

inte***ce fastethernet0/2

switchport access vlan 10

switchport mode access

inte***ce fastethernet0/3

switchport access vlan 10

switchport mode access

inte***ce fastethernet0/4

switchport access vlan 20

switchport mode access

inte***ce fastethernet0/5

switchport access vlan 2

switchport mode access

如圖,pc0和pc2屬於vlan1,pc1和pc3屬於vlan2,如何實現pc0和pc2通訊?

6樓:

在2個交換機中間加3層交換機 閘道器都在3層 2層就是透傳vlan 直接就通了 路由器也是一樣

思科3層交換機自動分配ip給pc,2臺3層做鏈路聚合,pc0和pc2在vlan10中,pc1,3在vlan20 中 求配置詳情

7樓:軒_燦爛

樓主,你好

配置如下,手打

l3 sw1:

ip dhcp excluded-address 192.168.10.1

ip dhcp excluded-address 192.168.20.1

ip dhcp excluded-address 192.168.10.2

ip dhcp excluded-address 192.168.20.2

ip dhcp pool 10

network 192.168.10.0 255.255.255.0

default-router 192.168.10.1 

dns-server 202.103.24.68 202.103.44.150 

!

ip dhcp pool 20

network 192.168.20.0 255.255.255.0

default-router 192.168.20.2 

dns-server 202.103.24.68 202.103.44.150 

spanning-tree vlan 10 priority 8192

spanning-tree vlan 20 priority 16384

inte***ce port-channel1

switchport mode trunk

!

inte***ce fastethernet0/1

switchport mode trunk

!

inte***ce fastethernet0/2

switchport mode trunk

!

inte***ce fastethernet0/3

switchport mode trunk

channel-group 1 mode on

!

inte***ce fastethernet0/4

switchport mode trunk

channel-group 1 mode on

inte***ce vlan10

ip address 192.168.10.1 255.255.255.0

!

inte***ce vlan20

ip address 192.168.20.1 255.255.255.0

ip ospf cost 65535

spanning-tree vlan 10 priority 8192

spanning-tree vlan 20 priority 16384

inte***ce port-channel1

switchport mode trunk

!

inte***ce fastethernet0/1

switchport mode trunk

!

inte***ce fastethernet0/2

switchport mode trunk

!

inte***ce fastethernet0/3

switchport mode trunk

channel-group 1 mode on

!

inte***ce fastethernet0/4

switchport mode trunk

channel-group 1 mode on

inte***ce vlan10

ip address 192.168.10.1 255.255.255.0

!

inte***ce vlan20

ip address 192.168.20.1 255.255.255.0

ip ospf cost 65535

l3 sw 2:

spanning-tree vlan 10 priority 16384

spanning-tree vlan 20 priority 8192

inte***ce port-channel1

switchport mode trunk

!

inte***ce fastethernet1/1

switchport mode trunk

!

inte***ce fastethernet1/2

switchport mode trunk

!

inte***ce fastethernet0/3

switchport mode trunk

channel-group 1 mode on

!

inte***ce fastethernet0/4

switchport mode trunk

channel-group 1 mode on

inte***ce vlan10

ip address 192.168.10.2 255.255.255.0

ip ospf cost 65535

!

inte***ce vlan20

ip address 192.168.20.2 255.255.255.0

l2 sw 1:

inter f0/3

no shutdown

sw mode trunk

inter f0/4

no shutdown

sw mode trunk

inter f0/1

sw mode access

sw access vlan 10

inter f0/2

sw mode access

sw access vlan 20

l2  sw2:

inter f0/3

no shutdown

sw mode trunk

inter f0/4

no shutdown

sw mode trunk

inter f0/1

no shutdown 

sw mode access

sw access vlan 10

inter f0/2

no shutdown 

sw mode access

sw access vlan 20

pc 自動獲取ip即可。

在下圖中,pc0的ip為1721641,pc1的ip為

rou rip ve 2 no au w 172.16.4.0 24 w 172.16.5.0 24 w 172.16.1.0 24 red con 謝謝請給分這是完整的rip命令 直接開啟rip 然後記得 work 172.16.0.0 255.255.0.0 ip地址為172.16.0.2 30...

ABS,PVC材料有什麼區別,PC和PVC是什麼材料,它們之間有什麼區別?

abs,pvc材料區別如下 1 化學名稱及組成不同 pvc材料,化工領域指化合物聚氯乙烯。英文名polyvinyl chlorid,英文縮寫pvc abs 塑料是丙烯腈 a 丁二烯 b 苯乙烯 s 三種單體的三元共聚物,a代表丙烯腈,b代表丁二烯,s代表苯乙烯。三種單體相對含量可任意變化,製成各種樹...

PC生化危機 啟示錄1和2的雙人分屏遊戲問題

確保你下的最新版的,然後可以在劇情模式和突襲模式中採用本地分屏模式,只需進遊戲後用第二個手柄按下start鍵啟用即可。pc正版生化危機啟示錄2怎麼本地分屏雙人合作遊戲?我是用steam的 steam 版本聯機沒那麼麻煩,插兩個手柄就行 再看看別人怎麼說的。生化危機啟示錄2怎麼才能本地雙人分屏玩?首先...