部落格實驗六

2021-09-23 21:02:26 字數 3926 閱讀 7884

掌握單臂路由器配置方法;

通過單臂路由器實現不同vlan之間互相通訊;

某企業有兩個主要部門,技術部和銷售部,分處於不同的辦公室,為了安全和便於管理對兩個部門的主機進行了vlan的劃分,技術部和銷售部分處於不同的vlan。現由於業務的需求需要銷售部和技術部的主機能夠相互訪問,獲得相應的資源,兩個部門的交換機通過一台路由器進行了連線。

技術原理

單臂路由:是為實現vlan間通訊的三層網路裝置路由器,它只需要乙個乙太網,通過建立子介面可以承擔所有vlan的閘道器,而在不同的vlan間**資料。

新建packer tracer拓撲圖

當交換機設定兩個vlan時,邏輯上已經成為兩個網路,廣播被隔離了。兩個vlan的網路要通訊,必須通過路由器,如果接入路由器的乙個物理埠,則必須有兩個子介面分別與兩個vlan對應,同時還要求與路由器相連的交換機的埠fa 0/1要設定為trunk,因為這個介面要通過兩個vlan的資料報。

檢查設定情況,應該能夠正確的看到vlan和trunk資訊。

計算機的閘道器分別指向路由器的子介面。

配置子介面,開啟路由器物理介面。

預設封裝dot1q協議。

配置路由器子介面ip位址。

pc 2臺;router_2811 1臺;switch_2960 1臺

指令

switch>en

switch#conf t

enter configuration commands, one per line. end with cntl/z.

switch(config)#vlan 2

switch(config-vlan)#exit

switch(config)#vlan 3

switch(config-vlan)#exit

switch(config)#int fa0/2

switch(config-if)#switchport access vlan 2

switch(config-if)#no shutdown

switch(config-if)#exit

switch(config)#int fa0/3

switch(config-if)#switchport access vlan 3

switch(config-if)#no shutdown

switch(config-if)#exit

switch(config)#int fa0/1

switch(config-if)#switchport mode trunk

switch(config-if)#end

router0指令:

router>rn

translating "rn"...domain server (255.255.255.255) % name lookup aborted

router>en

router#conf t

enter configuration commands, one per line. end with cntl/z.

router(config)#int fa0/0

router(config-if)#no shut down

router(config-if)#

%link-5-changed: inte***ce fastethernet0/0, changed state to up

%lineproto-5-updown: line protocol on inte***ce fastethernet0/0, changed state to up

router(config-if)#no shutdown

router(config-if)#exit

router(config)#int fa0/0.1

router(config-subif)#

%link-5-changed: inte***ce fastethernet0/0.1, changed state to up

%lineproto-5-updown: line protocol on inte***ce fastethernet0/0.1, changed state to up

router(config-subif)#encapsulation dot1q 2

router(config-subif)#ip address 192.168.1.1 255.255.255.0

router(config-subif)#exit

router(config)#int fa0/0.2

router(config-subif)#

%link-5-changed: inte***ce fastethernet0/0.2, changed state to up

%lineproto-5-updown: line protocol on inte***ce fastethernet0/0.2, changed state to up

router(config-subif)#encapsulation dot1q 3

router(config-subif)#ip address 192.168.2.1 255.255.255.0

router(config-subif)#end

router#

%sys-5-config_i: configured from console by console

router#show ip route

codes: c - connected, s - static, i - igrp, 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, e - egp

i - is-is, 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

c 192.168.1.0/24 is directly connected, fastethernet0/0.1

c 192.168.2.0/24 is directly connected, fastethernet0/0.2

pc0能夠順利ping同pc1

部落格實驗五

實驗目標 掌握路由器幾種常用配置方法 掌握採用console線纜配置路由器的方法 掌握採用telnet方式配置路由器的方法 熟悉路由器不同的命令列操作模式以及各種模式之間的切換 掌握路由器的基本配置命令 實驗背景 你是某公司新進的網管,公司要求你熟悉網路產品,首先要求你登入路由器,了解 掌握路由器的...

實驗六實驗報告

實驗結論 part1 結構體型別及程式設計應用 1.補足程式 include const int n 5 定義結構體型別struct student,並定義stu為其別名 typedef struct student stu 函式宣告 void input stu s,int n int findm...

實驗六 按鍵防抖動實驗

若要使用開發板上面的四個sw按鍵來做計數輸入,就需要知道一共按了幾下按鍵。在這種情況下不能像以前設計電路中,簡單地使用輸入時鐘的上公升沿來檢測按鍵是否按 下。因為,如果分頻以後的時鐘頻率是10hz,按鍵一下按了1 秒鐘,那麼如果簡單地 以時鐘的上公升沿來檢測按鍵,程式就會認為實際一共按了十下按鍵。我...