交換機路由器配置

2021-08-18 22:34:42 字數 3597 閱讀 7303

之前一直打算寫部落格,總是沒有開好頭,最近總算有了乙個方向,於是決定把以前有的資料整理一下,一是形成習慣,二是做個備份。此次更新是第一次更新,內容包括計算機網路管理的基礎內容。

交換機路由器配置,通過配置實現兩邊路由器到pc連通,同時,通過配置靜態路由實現左邊與右邊區域互相通訊。網路拓撲圖如下:

pc0、pc2屬於vlan1,pc1、pc3屬於vlan2,首先通過基礎配置,實現同一vlan間相互通訊,再在三層交換機配置ip routing,實現vlan1和vlan2通訊,再在三層交換機和路由器上配置路由表(ospf、rip、靜態路由其中一種),實現pc到路由器的通訊,右邊區域同理,最後在r0和r1上配置靜態路由,實現兩個區域的通訊。

**:##基礎配置

#ms0

en

conf t

vlan 10

vlan 20

int vlan 10

ip add 192.168.10.1 255.255.255.0

int vlan 20

ip add 192.168.20.1 255.255.255.0

exit

vtp mode server

vtp domain abin

vtp password 123

int f0/1

switchport trunk encapsulation dot1q

swi mo tr

int f0/2

switchport trunk encapsulation dot1q

swi mo tr

exit

ip routing

int f0/3

no switchport

ip add 172.168.10.1 255.255.255.0

no shut

exit

router ospf 1

network 192.168.10.0 0.0.0.255 area 1

network 192.168.20.0 0.0.0.255 area 1

network 172.168.10.0 0.0.0.255 area 1

exit

ip route 0.0.0.0 0.0.0.0 172.168.10.2

#s0

en

conf t

vtp mode client

vtp domain abin

vtp password 123

int f0/1

sw mo ac

sw ac v 10

int f0/2

sw mo ac

sw ac v 20

int f0/3

sw mo tr

#s1

en

conf t

vtp mode client

vtp domain abin

vtp password 123

int f0/1

sw mo ac

sw ac v 10

int f0/2

sw mo ac

sw ac v 20

int f0/3

sw mo tr

#r0

en

conf t

int f0/0

ip add 172.168.10.2 255.255.255.0

no shut

int s0/0/0

ip add 10.1.1.1 255.255.255.0

no shut

exit

router ospf 1

network 172.168.10.0 0.0.0.255 area 1

exit

ip route 0.0.0.0 0.0.0.0 10.1.1.2

#ms1

en

conf t

vlan 30

vlan 40

int vlan 30

ip add 192.168.30.1 255.255.255.0

int vlan 40

ip add 192.168.40.1 255.255.255.0

exit

vtp mode server

vtp domain abin

vtp password 123

int f0/1

switchport trunk encapsulation dot1q

swi mo tr

int f0/2

switchport trunk encapsulation dot1q

swi mo tr

exit

ip routing

int f0/3

no switchport

ip add 172.168.20.1 255.255.255.0

no shut

exit

router ospf 1

network 192.168.30.0 0.0.0.255 area 1

network 192.168.40.0 0.0.0.255 area 1

network 172.168.20.0 0.0.0.255 area 1

exit

ip route 0.0.0.0 0.0.0.0 172.168.20.2

#s2

en

conf t

vtp mode client

vtp domain abin

vtp password 123

int f0/1

sw mo ac

sw ac v 30

int f0/2

sw mo ac

sw ac v 40

int f0/3

sw mo tr

#s3

en

conf t

vtp mode client

vtp domain abin

vtp password 123

int f0/1

sw mo ac

sw ac v 30

int f0/2

sw mo ac

sw ac v 40

int f0/3

sw mo tr

#r1

en

conf t

int f0/0

ip add 172.168.20.2 255.255.255.0

no shut

int s0/0/0

ip add 10.1.1.2 255.255.255.0

no shut

exit

router ospf 1

network 172.168.20.0 0.0.0.255 area 1

exit

ip route 0.0.0.0 0.0.0.0 10.1.1.1

結果檢測:

使用ping命令通過pc0向pc6傳送icmp資料報:

路由器 交換機

1 路由器工作原理 2 資料交換方式 3 網路型別區分 1 路由器的工作原理,3層裝置 當資料報進入路由器時,路由器先檢視資料報中的目標mac位址 1.廣播 解封裝到3層 2 組播 每乙個組播位址均存在自己的mac位址 基於目標mac就可以判斷本地是否。需要解封裝 若本地加入了該組將解包,否則直接丟...

交換機與路由器

交換機與路由器 交換機是構建區域網不可或缺的集線裝置,它的主要功能包括 1 連線裝置 所謂區域網路,簡單來說就是若干計算機的集合。這些計算機是借助於交換機相互連線在一起的。交換機擁有數量眾多的埠,它的主要功能是連線計算機伺服器,網路印表機,網路攝像頭等終端裝置,並且實現與其他交換機,無線接入點,路由...

交換機和路由器

交換機 二層 資料鏈路層 交換機,基於埠mac對映表,傳送資料 資料傳送端發動資料 源mac位址 目的mac位址 資料 交換機將源mac位址及對應埠記錄到對映表中,並查詢對映表是否存在目的mac位址與埠的對映 如果存在,就直接根據對映 到目的端 如果不存在,需要向除源埠以外的埠 泛洪 並根據回應確定...