快速搭建展示型網(wǎng)站b2b電子商務(wù)平臺(tái)網(wǎng)站
實(shí)驗(yàn)4.1 靜態(tài)路由的配置
- 一、任務(wù)描述
- 二、任務(wù)分析
- 三、具體要求
- 四、實(shí)驗(yàn)拓?fù)?/li>
- 五、任務(wù)實(shí)施
- 1.設(shè)置交換機(jī)和路由器的基本配置。
- 2.使用display ip interface brief命令查看接口配置信息。
- 3.配置靜態(tài)路由,實(shí)現(xiàn)全網(wǎng)互通。
- 六、任務(wù)驗(yàn)收
- 七、任務(wù)小結(jié)
一、任務(wù)描述
某公司剛剛成立,規(guī)模較小。該公司的網(wǎng)絡(luò)管理員經(jīng)過(guò)考慮,決定在公司的路由器、交換機(jī)與運(yùn)營(yíng)商路由器之間使用靜態(tài)路由,實(shí)現(xiàn)網(wǎng)絡(luò)的互聯(lián)。
二、任務(wù)分析
靜態(tài)路由一般適用于比較簡(jiǎn)單的網(wǎng)絡(luò)環(huán)境。在這樣的環(huán)境中,網(wǎng)絡(luò)管理員應(yīng)非常清楚地了解網(wǎng)絡(luò)的拓?fù)浣Y(jié)構(gòu),以便于設(shè)置正確的路由信息。由于該網(wǎng)絡(luò)規(guī)模較小且不經(jīng)常變動(dòng),因此使用靜態(tài)路由比較合適。
三、具體要求
(1)添加3臺(tái)計(jì)算機(jī),將標(biāo)簽分別更改為PC1、PC2和PC3。
(2)添加兩臺(tái)型號(hào)為AR2220的路由器,標(biāo)簽名分別為RA和RB,將路由器的名稱分別設(shè)置為RA和RB。
(3)為RA和RB添加2SA模塊,并添加在S 1/0/0接口位置。
(4)添加1臺(tái)型號(hào)為S5700-28C-HI的交換機(jī),標(biāo)簽名為SW3A,將交換機(jī)的名稱設(shè)置為SW3A。
(5)PC1連接SW3A的GE 0/0/1接口,PC2連接SW3A的GE 0/0/2接口,PC3連接RB的GE 0/0/0接口,SW3A的GE 0/0/24接口連接RA的GE 0/0/0接口,RA的S 1/0/0
接口連接RB的S 1/0/0接口。
(6)開(kāi)啟所有交換機(jī)和計(jì)算機(jī)。
(7)路由器和交換機(jī)的接口及IP地址等,如下表所示。
(8)根據(jù)拓?fù)鋱D,使用直通線連接好所有計(jì)算機(jī)。設(shè)置每臺(tái)計(jì)算機(jī)的IP地址、子網(wǎng)掩碼和網(wǎng)關(guān),如下表所示。
(9)在2臺(tái)路由器和1臺(tái)交換機(jī)之間添加靜態(tài)路由實(shí)現(xiàn)全網(wǎng)互通。
四、實(shí)驗(yàn)拓?fù)?/h2>
五、任務(wù)實(shí)施
1.設(shè)置交換機(jī)和路由器的基本配置。
(1)SW3A的基本配置。
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys SW3A
[SW3A]un in e
Info: Information center is disabled.
[SW3A]v b 10 20 100
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW3A]int g0/0/1
[SW3A-GigabitEthernet0/0/1]p l a
[SW3A-GigabitEthernet0/0/1]p d v 10
[SW3A-GigabitEthernet0/0/1]int g0/0/2
[SW3A-GigabitEthernet0/0/2]p l a
[SW3A-GigabitEthernet0/0/2]p d v 20
[SW3A-GigabitEthernet0/0/2]int g0/0/24
[SW3A-GigabitEthernet0/0/24]p l a
[SW3A-GigabitEthernet0/0/24]p d v 100
[SW3A-GigabitEthernet0/0/24]quit
[SW3A]
(2)在SW3A上創(chuàng)建VLANIF接口,在接口視圖下配置IP地址。
[SW3A]int vlan 10
[SW3A-Vlanif10]ip add 192.168.10.254 24
[SW3A-Vlanif10]int vlan 20
[SW3A-Vlanif20]ip add 192.168.20.254 24
[SW3A-Vlanif20]int vlan 100
[SW3A-Vlanif100]ip add 192.168.1.1 24
[SW3A-Vlanif100]quit
[SW3A]
(3)RA的基本配置。
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys RA
[RA]int g0/0/0
[RA-GigabitEthernet0/0/0]ip add 192.168.1.2 24
Dec 8 2023 09:33:37-08:00 RA %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[RA-GigabitEthernet0/0/0]quit
[RA]int s1/0/0
[RA-Serial1/0/0]ip add 192.168.2.1 24
[RA-Serial1/0/0]quit
[RA]
(4)RB的基本配置。
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys RB
[RB]int s1/0/0
[RB-Serial1/0/0]ip add 192.168.2.2 24
[RB-Serial1/0/0]
Dec 8 2023 09:34:40-08:00 RB %%01IFNET/4/LINK_STATE(l)[0]:The line protocol PPP
IPCP on the interface Serial1/0/0 has entered the UP state.
[RB-Serial1/0/0]int g0/0/0
[RB-GigabitEthernet0/0/0]ip add 192.168.30.254 24
Dec 8 2023 09:35:01-08:00 RB %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[RB-GigabitEthernet0/0/0]quit
[RB]
當(dāng)做好以上配置時(shí)可以發(fā)現(xiàn),PC1和PC2之間已經(jīng)可以互相ping通,不是全網(wǎng)互通。要實(shí)現(xiàn)全網(wǎng)互通,需要建立相應(yīng)的路由表。本實(shí)驗(yàn)時(shí)通過(guò)靜態(tài)路由來(lái)實(shí)現(xiàn)全網(wǎng)互通的。
2.使用display ip interface brief命令查看接口配置信息。
[SW3A]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 2Interface IP Address/Mask Physical Protocol
MEth0/0/1 unassigned down down
NULL0 unassigned up up(s)
Vlanif1 unassigned down down
Vlanif10 192.168.10.254/24 up up
Vlanif20 192.168.20.254/24 up up
Vlanif100 192.168.1.1/24 up up
[SW3A]
3.配置靜態(tài)路由,實(shí)現(xiàn)全網(wǎng)互通。
(1)SW3A不能直接到達(dá)的網(wǎng)絡(luò)都需要添加靜態(tài)路由,分別有192.168.2.0和192.168.30.0這兩個(gè)網(wǎng)絡(luò),而SW3A到達(dá)這兩個(gè)網(wǎng)絡(luò)都要通過(guò)RA的GE0/0/0接口進(jìn)行轉(zhuǎn)發(fā),那么GE0/0/0接口的IP的地址就是靜態(tài)路由的下一跳地址,于是在SW3A上添加的靜態(tài)路由如下。
[SW3A]ip route-static 192.168.2.0 255.255.255.0 192.168.1.2
[SW3A]ip route-static 192.168.30.0 255.255.255.0 192.168.1.2
(2)RA不能直接到達(dá)的網(wǎng)絡(luò)都需要添加靜態(tài)路由,分別有192.168.10.0、192.168.20.0、192.168.30.0這三個(gè)網(wǎng)絡(luò),而RA到達(dá)192.168.10.0和192.168.20.0這兩個(gè)網(wǎng)絡(luò)都要通過(guò)SW3A的GE0/0/24接口進(jìn)行轉(zhuǎn)發(fā),到達(dá)192.168.30.0這個(gè)網(wǎng)絡(luò)要通過(guò)RB的Series1/0/0接口,于是在RA上添加的靜態(tài)路由如下。
[RA]ip route-static 192.168.10.0 255.255.255.0 192.168.1.1
[RA]ip route-static 192.168.20.0 255.255.255.0 192.168.1.1
[RA]ip route-static 192.168.30.0 255.255.255.0 192.168.2.2
(3)RB不能直接到達(dá)的網(wǎng)絡(luò)都需要添加靜態(tài)路由,分別有192.168.1.0、192.168.10.0、192.168.20.0這三個(gè)網(wǎng)絡(luò),而RB到達(dá)這3個(gè)網(wǎng)絡(luò)都要通過(guò)RA的Series1/0/0接口進(jìn)行轉(zhuǎn)發(fā),那么Series1/0/0接口的IP的地址就是靜態(tài)路由的下一跳地址,于是在RB上添加的靜態(tài)路由如下。
[RB]ip route-static 192.168.10.0 255.255.255.0 192.168.2.1
[RB]ip route-static 192.168.20.0 255.255.255.0 192.168.2.1
[RB]ip route-static 192.168.1.0 255.255.255.0 192.168.2.1
六、任務(wù)驗(yàn)收
(1)在RA上,使用display ip routing-table命令查看路由表。
(2)使用PC1測(cè)試到PC2和PC3的連通性,可以看到是連通的。
七、任務(wù)小結(jié)
(1)添加靜態(tài)路由時(shí)對(duì)非直連的網(wǎng)段都要進(jìn)行配置。
(2)在小規(guī)模的網(wǎng)絡(luò)環(huán)境中,靜態(tài)路由是一個(gè)不錯(cuò)的選擇,但對(duì)于大型網(wǎng)絡(luò),添加靜態(tài)路由的工作量就很大。
(3)靜態(tài)路由開(kāi)銷小,但不靈活,只適用于相對(duì)穩(wěn)定的網(wǎng)絡(luò)。
注:此為記錄筆記,如有不足,還望海涵,可留言斧正