基於eNSP的相關計算機網絡實驗
2019-05-13 11:06:34
更新的下一篇內容:基於eNSP結合實際操作的的計算機網絡實驗(二)
next:實驗(三)
終結篇:實驗(終章)
這個實驗記錄隨着學習進度的進行不斷進行更新,主要爲基於華爲eNSP環境下進行的熟悉計算機網絡的相關實驗,這個實驗主要爲熟悉掌握計算機網絡的結構和工作原理,深入理解交換機、路由器、無限網絡的工作原理,目前這個實驗包括下面幾個內容:
- 單臺PC機聯通交換機的實驗配置
- 單臺交換機上使用VLAN來隔離PC
- 跨交換機實現不同VLAN的通信與隔離
- 不同VLAN間實現通信
實操圖如下 (#_#)
單臺PC機聯通交換機的實驗配置
相關操作如下所示:
- 進入系統視圖
- 交換機接口配置
- 添加交換機虛擬ip
- 嘗試ping
在eNSP上交換機的設置腳本如下所示:
The device is running!
<Huawei>
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname sw1
[sw1]
May 14 2019 10:26:17-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 4, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw1]int e0/0/1
[sw1-Ethernet0/0/1]port link-type access
[sw1-Ethernet0/0/1]
May 14 2019 10:27:07-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 5, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw1-Ethernet0/0/1]interface vlanif1
[sw1-Vlanif1]ip address 10.10.10.6 255.255.255.0
[sw1-Vlanif1]
May 14 2019 10:28:58-08:00 sw1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface Vlanif1 has entered the UP state.
[sw1-Vlanif1]display currn
May 14 2019 10:29:07-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 6, the c
hange loop count is 0, and the maximum number of records is 409
#
sysname sw1
#
cluster enable
ntdp enable
ndp enable
#
drop illegal-mac alarm
#
diffserv domain default
#
drop-profile default
#
aaa
authentication-scheme default
authorization-scheme default
accounting-scheme default
domain default
domain default_admin
local-user admin password simple admin
local-user admin service-type http
#
interface Vlanif1
ip address 10.10.10.6 255.255.255.0
[sw1-Vlanif1] User interface con0 is available
單臺交換機上使用VLAN來隔離PC
相關操作如下所示:
- 在單臺交換機上使用不同的vlan域來對進行PC隔離
- 交換機端口配置
- 配置PC的ip地址
- 劃分vlan區域
在eNSP上交換機的設置腳本如下所示:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname sw1
[sw1]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[sw1]
May 14 2019 10:33:37-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 5, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw1]int e0/0/1
[sw1-Ethernet0/0/1]port link-type access
[sw1-Ethernet0/0/1]port default vlan 10
[sw1-Ethernet0/0/1]
May 14 2019 10:34:07-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 7, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw1-Ethernet0/0/1]int e0/0/2
[sw1-Ethernet0/0/2]port link-type access
[sw1-Ethernet0/0/2]port default vlan 20
[sw1-Ethernet0/0/2]
May 14 2019 10:34:27-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 9, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw1-Ethernet0/0/2]int e0/0/3
[sw1-Ethernet0/0/3]port link-type access
[sw1-Ethernet0/0/3]
May 14 2019 10:34:47-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 10, the
change loop count is 0, and the maximum number of records is 4095.
[sw1-Ethernet0/0/3]port default vlan 10
[sw1-Ethernet0/0/3]
May 14 2019 10:34:53-08:00 sw1 %%01IFNET/4/IF_STATE(l)[0]:Interface Vlanif1 has
turned into DOWN state.
May 14 2019 10:34:57-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 11, the
change loop count is 0, and the maximum number of records is 4095.
[sw1-Ethernet0/0/3] User interface con0 is available
實現效果圖如下所示:
跨交換機實現不同VLAN的通信與隔離
相關操作如下所示:
- 配置兩臺交換機的接口VLAN
- 配置交換機與PC的端口連接
- 配置交換機端口間的連接方式
- 配置PC的ip地址
- 驗證PC機兩兩之間的連通性
在這裏解釋一下兩臺交換機之間進行的trunk,trunk是端口進行匯聚的意思,它允許交換機與交換機、交換機與路由器、主機與交換機或路由器之間通過兩個或多個端口並行進行連接,同時傳輸來提供更高的帶寬、更大的吞吐量,大幅度提高整個網絡能力。VLAN trunk是指設置了多個VLAN之後,想通過一個端口來傳輸我們設置的多個VLAN,我們就需要在交換機這裏設置這個端口爲trunk。trunk技術使得一條物理線路可以傳送多個VLAN的數據,更加具體的細節你想了解的話可以去查查資料。
在eNSP上交換機的設置腳本如下所示:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname sw1
[sw1]
May 14 2019 10:38:37-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 4, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw1]int e0/0/1
[sw1-Ethernet0/0/1]port link-type access
[sw1-Ethernet0/0/1]port default v
May 14 2019 10:39:17-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 5, the c
hange loop count is 0, and the maximum number of records is 4095.
^
Error:Incomplete command found at '^' position.
[sw1-Ethernet0/0/1]q
[sw1]
[sw1]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[sw1]int e0/0/1
[sw1-Ethernet0/0/1]
May 14 2019 10:39:37-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 6, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw1-Ethernet0/0/1]port default vlan 10
[sw1-Ethernet0/0/1]
May 14 2019 10:39:47-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 7, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw1-Ethernet0/0/1]int e0/0/2
[sw1-Ethernet0/0/2]port link-type access
[sw1-Ethernet0/0/2]port defa
May 14 2019 10:40:07-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 8, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw1-port-group-defa]port default vlan 20
[sw1-port-group-defa]q
[sw1]
May 14 2019 10:40:17-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 9, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw1]int e0/0/2
[sw1-Ethernet0/0/2]port default vlan 20
[sw1-Ethernet0/0/2]int e
May 14 2019 10:40:37-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 10, the
change loop count is 0, and the maximum number of records is 4095.
^
Error: Unrecognized command found at '^' position.
[sw1-Ethernet0/0/2]int e0/0/3
[sw1-Ethernet0/0/3]port link-type trunk
[sw1-Ethernet0/0/3]port trunk
May 14 2019 10:43:57-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 11, the
change loop count is 0, and the maximum number of records is 4095.
[sw1-port-group-trunk]port trunk allow-pass
May 14 2019 10:44:07-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 12, the
change loop count is 0, and the maximum number of records is 4095.
^
Error:Incomplete command found at '^' position.
[sw1-port-group-trunk]q
[sw1]int e0/0/3
[sw1-Ethernet0/0/3]port trunk allow-pass vlan 10 20
[sw1-Ethernet0/0/3]
May 14 2019 10:44:37-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 13, the
change loop count is 0, and the maximum number of records is 4095.
另一個交換機的設置也是差不多的,這裏就不展示了
不同VLAN間實現通信
相關操作如下所示:
- 交換機接口配置
- 創建多個VLAN域
- 設置PC的ip地址、網關配置
在eNSP上交換機的設置腳本如下所示:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname sw1
[sw1]
May 14 2019 10:50:47-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 4, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw1]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[sw1]
May 14 2019 10:50:57-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 5, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw1]int e0/0/1
[sw1-Ethernet0/0/1]port link-type access
[sw1-Ethernet0/0/1]
May 14 2019 10:51:17-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 6, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw1-Ethernet0/0/1]port default vlan 10
[sw1-Ethernet0/0/1]int
May 14 2019 10:51:37-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 7, the c
hange loop count is 0, and the maximum number of records is 4095.
^
Error: Unrecognized command found at '^' position.
[sw1-Ethernet0/0/1]int e0/0/2
[sw1-Ethernet0/0/2]port link-type access
[sw1-Ethernet0/0/2]port
May 14 2019 10:51:57-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 8, the c
hange loop count is 0, and the maximum number of records is 4095.
^
Error:Incomplete command found at '^' position.
[sw1-Ethernet0/0/2]port default vlan 20
[sw1-Ethernet0/0/2]
May 14 2019 10:52:06-08:00 sw1 %%01IFNET/4/IF_STATE(l)[0]:Interface Vlanif1 has
turned into DOWN state.
May 14 2019 10:52:07-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 9, the c
hange loop count is 0, and the maximum number of records is 4095.
[sw1-Ethernet0/0/2]int vlanif10
[sw1-Vlanif10]
May 14 2019 10:52:21-08:00 sw1 %%01IFNET/4/IF_STATE(l)[1]:Interface Vlanif10 has
turned into UP state.
[sw1-Vlanif10]ip address 192.168.1.254 24
[sw1-Vlanif10]
May 14 2019 10:53:16-08:00 sw1 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface Vlanif10 has entered the UP state.
May 14 2019 10:53:17-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 10, the
change loop count is 0, and the maximum number of records is 4095.
[sw1-Vlanif10]int vlanif20
[sw1-Vlanif20]
May 14 2019 10:53:28-08:00 sw1 %%01IFNET/4/IF_STATE(l)[3]:Interface Vlanif20 has
turned into UP state.
[sw1-Vlanif20]ip address 192.168.2.254 24
[sw1-Vlanif20]
May 14 2019 10:53:57-08:00 sw1 %%01IFNET/4/LINK_STATE(l)[4]:The line protocol IP
on the interface Vlanif20 has entered the UP state.
May 14 2019 10:53:57-08:00 sw1 DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.25
.191.3.1 configurations have been changed. The current change number is 11, the
change loop count is 0, and the maximum number of records is 4095.
[sw1-Vlanif20]q
[sw1]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 3
The number of interface that is DOWN in Physical is 2
The number of interface that is UP in Protocol is 3
The number of interface that is DOWN in Protocol is 2
Interface IP Address/Mask Physical Protocol
MEth0/0/1 unassigned down down
NULL0 unassigned up up(s)
Vlanif1 unassigned down down
Vlanif10 192.168.1.254/24 up up
Vlanif20 192.168.2.254/24 up up
[sw1]
總結: …等試驗內容更完了再寫