cisco交換機和路由器連線時的設定

2021-05-20 23:06:38 字數 6248 閱讀 2849

1樓:

router>en

router#conf t

enter configuration ***mands, one per line. end with **tl/z.

router(config)#int

router(config)#inte***ce f

router(config)#inte***ce fastether*** 0/0

router(config-if)#

router(config-if)#ip add

router(config-if)#ip address 172.16.10.1 255.255.255.0

router(config-if)#no shu

router(config-if)#no shutdown

switch#conf t

enter configuration ***mands, one per line. end with **tl/z.

switch(config)#int

switch(config)#inte***ce vl

switch(config)#inte***ce vlan

switch(config)#inte***ce vlan ?

<1-1005> vlan inte***ce number

switch(config)#inte***ce vlan 1

switch(config-if)#

switch(config-if)#

switch(config-if)#ip add

switch(config-if)#ip address 172.16.10.2 255.255.255.0

switch(config-if)#no shu

switch(config-if)#no shutdown

2樓:匿名使用者

想pin通。放在一個網段就好了。

估計 是你的交換機管理 ip沒設定對吧

三層交換機與路由器連線設定問題?

3樓:匿名使用者

交換機配置:

switch#vlan database

switch(vlan)#vlan 2 name vlan2

switch(vlan)#vlan 3 name vlan3

switch(vlan)#vlan 4 name vlan4

switch(vlan)#vlan 5 name vlan5

switch(config)#inte***ce f0/2

switch(config-if)#switch mode access

switch(config-if)#switch access vlan 2

switch(config-if)#no shutdown

switch(config)#inte***ce f0/3

switch(config-if)#switch mode access

switch(config-if)#switch access vlan 3

switch(config-if)#no shutdown

switch(config)#inte***ce f0/5

switch(config-if)#switch mode access

switch(config-if)#switch access vlan 4

switch(config-if)#no shutdown

switch(config)#inte***ce f0/7

switch(config-if)#switch mode access

switch(config-if)#switch access vlan 5

switch(config-if)#no shutdown

switch(config)#inte***ce f0/1

switch(config-if)#switchport trunk encapsulation dot1q

switch(config-if)#switch mode trunk

switch(config-if)#no shutdown

路由器配置:

router(config)#inte***ce f0/1

router(config-if)#switch mode access

router(config-if)#switch access vlan 1

router(config-if)#no shutdown

router(config)#inte***ce f0/0

router(config-if)#no shutdown

router(config-if)#exit

router(config)#inte***ce f0/0.1

router(config-subif)#encapsulation dot1q 1 native

router(config-subif)#ip address 192.168.5.1 255.255.255.0

router(config)#inte***ce f0/0.2

router(config-subif)#encapsulation dot1q 2

router(config-subif)#ip address 192.168.1.1 255.255.255.0

router(config)#inte***ce f0/0.3

router(config-subif)#encapsulation dot1q 3

router(config-subif)#ip address 192.168.2.1 255.255.255.0

router(config)#inte***ce f0/0.4

router(config-subif)#encapsulation dot1q 4

router(config-subif)#ip address 192.168.3.1 255.255.255.0

router(config)#inte***ce f0/0.5

router(config-subif)#encapsulation dot1q 5

router(config-subif)#ip address 192.168.4.1 255.255.255.0

第一種解決方法完成!這是典型的單臂路由方式.把交換機充當二層使用.

路由器做vlan間trunk的主要裝置.這樣.就能互相ping通.

也可同時共享.訪問inter***.

第二種解決方法也很簡單.是把三層交換機充當一個二層交換機和三層路由器.先允許特定埠可以連線終端進行訪問.

再直接設定下vlan間trunk即可.然後.路由器一臺終端屬於本身一個vlan.

兩臺裝置之間再開啟rip路由協議即可.或者新增靜態路由.即可互相訪問.

交換機配置:

switch#vlan database

switch(vlan)#vlan 2 name vlan2

switch(vlan)#vlan 3 name vlan3

switch(vlan)#vlan 4 name vlan4

switch(vlan)#vlan 5 name vlan5

switch(config)#inte***ce f0/2

switch(config-if)#switch mode access

switch(config-if)#switch access vlan 2

switch(config-if)#no shutdown

switch(config)#inte***ce f0/3

switch(config-if)#switch mode access

switch(config-if)#switch access vlan 3

switch(config-if)#no shutdown

switch(config)#inte***ce f0/5

switch(config-if)#switch mode access

switch(config-if)#switch access vlan 4

switch(config-if)#no shutdown

switch(config)#inte***ce f0/7

switch(config-if)#switch mode access

switch(config-if)#switch access vlan 5

switch(config-if)#no shutdown

switch(config)#ip routing

switch(config)#ip cef

switch(config)#inte***ce vlan 2

switch(config-if)#ip address 192.168.1.1 255.255.255.0

switch(config-if)#no shutdown

switch(config)#inte***ce vlan 3

switch(config-if)#ip address 192.168.2.1 255.255.255.0

switch(config-if)#no shutdown

switch(config)#inte***ce vlan 4

switch(config-if)#ip address 192.168.3.1 255.255.255.0

switch(config-if)#no shutdown

switch(config)#inte***ce vlan 5

switch(config-if)#ip address 192.168.4.1 255.255.255.0

switch(config-if)#no shutdown

switch(config)#inte***ce f0/1

switch(config-if)#no switchport

switch(config-if)#ip address 192.168.5.3 255.255.255.0

switch(config-if)#no shutdown

switch(config-if)#exit

switch(config)#router rip

switch(config)#version 2

switch(config)#***work 192.168.1.0

switch(config)#***work 192.168.2.0

switch(config)#***work 192.168.3.0

switch(config)#***work 192.168.4.0

switch(config)#***work 192.168.5.0

路由器配置:

router(config)#inte***ce f0/1

router(config-if)#switch mode access

router(config-if)#switch access vlan 1

router(config-if)#no shutdown

router(config)#inte***ce f0/0

router(config-if)#ip address 192.168.5.1 255.255.255.0

router(config-if)#no shutdown

router(config-if)#exit

router(config)#router rip

router(config)#version 2

router(config)#***work 192.168.1.0

router(config)#***work 192.168.2.0

router(config)#***work 192.168.3.0

router(config)#***work 192.168.4.0

電腦ip是192.168.5.2/24的那臺主機.閘道器要設定成192.168.5.3/24.

靜態路由比rip開銷更小.也不佔用cpu在維護路由表時候的功率.靜態路由.是要一條一條新增上去.適合小規模.rip是一種動態路由的協議.適合小中型.

控制列表.全程是acl-訪問控制列表.是cisco首發的一個機制.現在防火牆都是才用這種機制.acl也可以說成是防火牆控制功能.

鏈路匯聚.就是把多條鏈路匯聚到一根虛擬的鏈路.增大頻寬流量.原來多條鏈路每條頻寬為1mb.總共五條.匯聚成一條.頻寬就是5mb.

交換機和路由器怎麼連線,路由器和交換機之間用什麼線連線

如果是8口的路由器,你可以有用做任何設定,將交換機那邊拉出來的網線和各個計算機的網線都連線到路由器的lan口,就可以了,如果是4口的路由器,那就要將交換機過來的網線連線到路由器的wan口,進行相關資料設定,將各個計算機連線到路由器的lan口 從路由器的任一lan口用網線連到交換機的任一口 自動識別正...

cisco路由器交換機的重啟,cisco裝置重啟的命令?

cisco不支援reboot命令,樓上不知道有沒有接觸過cisco裝置.正常命令列下重啟只有reload,至 於reset是用於rommon模式下的 基本上只有進不去系統或者破密碼才會進入此種模式 且配置在儲存好 wr copy run startup 的情況下任何重啟都不會丟失,除非裝置故障。re...

路由器與交換機,路由器和交換機哪個在前?

1 如果你的貓有自動拔號功能,就用交換機,設定貓自動拔號 與設定路由器自動拔號一樣 這樣與更換這前無異。2 如果你的貓沒有自動拔號功能,就有兩個方案 a 你現在已有了交換機,那就從路由器上接出一線,連線到交換機,路由器上也可接電腦,交換機上也可接電腦。b 你現在還沒有交換機,如果是隻有四臺電腦,那就...