實驗內容:
1、華爲路由器交換機基本命令(修改系統名、配置VLAN和接口的IP地址)
2、如何設置telnet實現交換機的遠程管理
實驗需求:
PC1、PC2、PC3、PC4之間可以互相通信,SW1、SW2、R1三臺設備之間可以互相telnet遠程管理
拓撲圖:
實驗步驟:
1、 配置PC1、PC2、SW1之間的網絡
配置PC1、PC2的IP地址:
配置SW1的IP地址、網關:
<Huawei>SY [Huawei]SYS sw1 [sw1]int vlan 1 [sw1-Vlanif1]ip add 192.168.1.200 255.255.255.0 [sw1-Vlanif1]qu [sw1]ip route-static 0.0.0.0 0.0.0.0 192.168.1.254 [sw1]
配置R1的e0/0/0接口ip:
<Huawei>sy Enter system view, return user view with Ctrl+Z. [Huawei]sys R2 [R2] [R2]int e 0/0/0 [R2-Ethernet0/0/0]ip add 192.168.1.254 24
此時,由於PC1與PC2和它們的網關192.168.1.254處於同一網段,所以PC1、PC2分別可以互相通信並可以正常和自己的網關通信。
測試:用PC1 ping PC2
2、 配置PC3、SW2之間的網絡
配置PC3的ip地址:
配置SW2的ip地址、網關:
<Huawei>sy [Huawei]sys SW2 [SW2]int vlan 1 [SW2-Vlanif1]ip add 172.16.0.200 255.255.0.0 [SW2-Vlanif1]qu [SW2]ip route-static 0.0.0.0 0.0.0.0 172.16.0.254
配置R1的e0/0/1接口ip地址:
<R2>sy Enter system view, return user view with Ctrl+Z. [R2]int e 0/0/1 [R2-Ethernet0/0/1]ip add 172.16.0.254 255.255.0.0 [R2-Ethernet0/0/1]
至此,全網已經互通,接下來進行測試。因爲PC1和PC2屬於同一網段192.168.1.0/24,用PC3和PC4屬於同一網段172.16.0.0/16,所以PC3 ping PC1 如果能通就說明整個網絡互通沒問題
測試結果:
3、 分別配置SW1、SW2、R1三臺設備上的telnet功能
SW1:
[sw1]user-interface vty 0 4 [sw1-ui-vty0-4]authentication-mode password [sw1-ui-vty0-4]set authentication password simple huawei [sw1-ui-vty0-4]user privilege level 3 [sw1-ui-vty0-4]
SW2:
[SW2]user-interface vty 0 4 [SW2-ui-vty0-4]authentication-mode password [SW2-ui-vty0-4]set authentication password simple huawei [SW2-ui-vty0-4]user privilege level 3 [SW2-ui-vty0-4]
R1:
<R2>sy Enter system view, return user view with Ctrl+Z. [R2]user-interface vty 0 4 [R2-ui-vty0-4]authentication-mode password [R2-ui-vty0-4]set authentication password simple huawei [R2-ui-vty0-4]user privilege level 3 [R2-ui-vty0-4]
至此,telnet配置完畢,三臺設備均可以被telnet遠程管理。
測試:由於ensp的PC命令行裏並沒有telnet功能,所以我們只能使用路由器、交換機設備本身裏的telnet功能進行測試
SW1:
telnet 192.168.1.200
SW2:
telnet 172.16.0.200
R1:
telnet 192.168.1.254
實驗結束