ensp三层交换机和VLANIF配置

#作业六:#

##实验一:三层交换机和VLANIF配置#

实验环境

实验思路

  • 1.规划并配置IP
    1. 创建VLAN
    1. 配置VLANIF接口
    1. 向VLAN中加入对应终端
    1. 动态配置
    1. 检查连通性

具体实施

规划并配置IP

PC1:

PC2:

PC3:

PC4:

IP:192.168.40.1
子网掩码:255.255.255.0
网关:192.168.40.254

创建VLAN

SW1:
[SW1]vlan batch 10 20 40
SW2:
[SW2]vlan batch 10 30 40

配置VLANIF接口

SW1:
[SW1]interface Vlanif 10
[SW1-Vlanif10]ip add 192.168.10.254 24
[SW1]interface Vlanif 20
[SW1-Vlanif20]ip add 192.168.20.254 24
[SW1]interface Vlanif 40
[SW1-Vlanif30]ip add 192.168.50.1 24
SW2:
[SW2]interface Vlanif 30
[SW2-Vlanif30]ip add 192.168.40.254 24
[SW2-Vlanif20]interface Vlanif 10
[SW2-Vlanif10]ip add 192.168.30.254 24
[SW1]interface Vlanif 40
[SW1-Vlanif30]ip add 192.168.50.2 24

向VLAN中加入对应终端

SW1:
[SW1]int g0/0/2
[SW1-GigabitEthernet0/0/2]port link-type access
[SW1-GigabitEthernet0/0/2]port default  vlan 10
[SW1-GigabitEthernet0/0/2]int g0/0/3
[SW1-GigabitEthernet0/0/3]port link-type access
[SW1-GigabitEthernet0/0/3]port default  vlan 20
[SW1-Vlanif20]int g0/0/1
[SW1-GigabitEthernet0/0/1]port link-type access 
SW2:
[SW2]int g0/0/2
[SW2-GigabitEthernet0/0/2]port link-type access
[SW2-GigabitEthernet0/0/2]port default  vlan 10
[SW2-GigabitEthernet0/0/2]int g0/0/3
[SW2-GigabitEthernet0/0/3]port link-type access
[SW2-GigabitEthernet0/0/3]port default  vlan 30
[SW2-Vlanif30]int g0/0/1
[SW2-GigabitEthernet0/0/1]port link-type access 

动态配置

client:
[SW1]int lo 0
[SW1t-LoopBack0]ip add 1.1.1.1 32
[SW1-LoopBack0]ospf router-id 1.1.1.1
[SW1-ospf-1]area 1
[SW1-ospf-1-area-0.0.0.1]network 1.1.1.1 0.0.0.0
[SW1-ospf-1-area-0.0.0.1]network 192.168.10.254 0.0.0.0
[SW1-ospf-1-area-0.0.0.1]network 192.168.20.254 0.0.0.0
[SW1-ospf-1-area-0.0.0.1]network 192.168.50.1 0.0.0.0
ftp server:
[SW2]int lo 0
[SW2-LoopBack0]ip add 2.2.2.2 32
[SW2-LoopBack0]ospf router-id 2.2.2.2
[SW2-ospf-1]area 1
[SW2-ospf-1-area-0.0.0.1]network 2.2.2.2 0.0.0.0
[SW2-ospf-1-area-0.0.0.1]network 192.168.30.254 0.0.0.0
[SW2-ospf-1-area-0.0.0.1]network 192.168.40.254 0.0.0.0
[SW2-ospf-1-area-0.0.0.1]network 192.168.50.2 0.0.0.0

检查连通性

PC1 ping PC3
PC>ping 192.168.10.2

Ping 192.168.10.2: 32 data bytes, Press Ctrl_C to break
From 192.168.10.2: bytes=32 seq=1 ttl=128 time=78 ms
From 192.168.10.2: bytes=32 seq=2 ttl=128 time=47 ms
From 192.168.10.2: bytes=32 seq=3 ttl=128 time=78 ms
From 192.168.10.2: bytes=32 seq=4 ttl=128 time=78 ms
From 192.168.10.2: bytes=32 seq=5 ttl=128 time=63 ms

  --- 192.168.10.2 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 47/68/78 ms
PC1 ping PC4
PC>ping 192.168.40.1

Ping 192.168.40.1: 32 data bytes, Press Ctrl_C to break
From 192.168.40.1: bytes=32 seq=1 ttl=127 time=63 ms
From 192.168.40.1: bytes=32 seq=2 ttl=127 time=78 ms
From 192.168.40.1: bytes=32 seq=3 ttl=127 time=63 ms
From 192.168.40.1: bytes=32 seq=4 ttl=127 time=94 ms
From 192.168.40.1: bytes=32 seq=5 ttl=127 time=47 ms

   --- 192.168.40.1 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 47/69/94 ms
PC2 ping PC3
PC>ping 192.168.10.2

Ping 192.168.10.2: 32 data bytes, Press Ctrl_C to break
From 192.168.10.2: bytes=32 seq=1 ttl=127 time=140 ms
From 192.168.10.2: bytes=32 seq=2 ttl=127 time=93 ms
From 192.168.10.2: bytes=32 seq=3 ttl=127 time=62 ms
From 192.168.10.2: bytes=32 seq=4 ttl=127 time=47 ms
From 192.168.10.2: bytes=32 seq=5 ttl=127 time=63 ms

  --- 192.168.10.2 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 47/81/140 ms
PC2 ping PC4
PC>ping 192.168.40.1

Ping 192.168.40.1: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.40.1: bytes=32 seq=2 ttl=127 time=63 ms
From 192.168.40.1: bytes=32 seq=3 ttl=127 time=94 ms
From 192.168.40.1: bytes=32 seq=4 ttl=127 time=94 ms
From 192.168.40.1: bytes=32 seq=5 ttl=127 time=62 ms

  --- 192.168.40.1 ping statistics ---
  5 packet(s) transmitted
  4 packet(s) received
  20.00% packet loss
  round-trip min/avg/max = 0/78/94 ms
PC2 ping PC1
PC>ping 192.168.10.1

Ping 192.168.10.1: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 192.168.10.1: bytes=32 seq=2 ttl=127 time=140 ms
From 192.168.10.1: bytes=32 seq=3 ttl=127 time=62 ms
From 192.168.10.1: bytes=32 seq=4 ttl=127 time=78 ms
From 192.168.10.1: bytes=32 seq=5 ttl=127 time=78 ms

  --- 192.168.10.1 ping statistics ---
  5 packet(s) transmitted
  4 packet(s) received
  20.00% packet loss
  round-trip min/avg/max = 0/89/140 ms

##实验二:FTP配置#

实验环境

实验思路

    1. 规划并配置IP
    1. 在服务器对用户进行数据录入
    1. 动态配置
    1. 在客户端登录并进行文件操作
    1. 检查操作是否成功

具体实施

规划并配置IP

client:
[client]int g0/0/0
[client-GigabitEthernet0/0/0]ip add 192.168.1.1 24
AR2:
[AR2]int g0/0/0
[AR2-GigabitEthernet0/0/0]ip add 192.168.1.2 24
[AR2-GigabitEthernet0/0/0]int g0/0/1
[AR2-GigabitEthernet0/0/1]ip add 192.168.2.3 24
ftp server:
[ftp server]int g0/0/0
[ftp server-GigabitEthernet0/0/0]ip add 192.168.2.4 24

在服务器对用户进行数据录入

ftp server:
[ftp server]ftp server enable
[ftp server]aaa
[ftp server-aaa]local-user ftp password  cipher  huawei
[ftp server-aaa]local-user ftp service-type ftp 
[ftp server-aaa]local-user ftp privilege  level  3
[ftp server-aaa]local-user ftp ftp-directory flash:/

动态配置

client:
[client]int lo 0
[client-LoopBack0]ip add 1.1.1.1 32
[client-LoopBack0]ospf router-id 1.1.1.1
[client-ospf-1]area 1
[client-ospf-1-area-0.0.0.1]network 1.1.1.1 0.0.0.0
[client-ospf-1-area-0.0.0.1]network 192.168.1.1 0.0.0.0
AR2:
[AR2-ospf-1-area-0.0.0.1]int lo 0
[AR2-LoopBack0]ip add 2.2.2.2 32
[AR2-LoopBack0]ospf router-id 2.2.2.2
[AR2-ospf-1]area 1
[AR2-ospf-1-area-0.0.0.1]network 2.2.2.2 0.0.0.0
[AR2-ospf-1-area-0.0.0.1]network 192.168.1.2 0.0.0.0
[AR2-ospf-1-area-0.0.0.1]network 192.168.2.1 0.0.0.0
ftp server:
[ftp server-ospf-1-area-0.0.0.1]int lo 0
[ftp server-LoopBack0]ip add 3.3.3.3 32
[ftp server-LoopBack0]ospf router-id 3.3.3.3
[ftp server-ospf-1-area-0.0.0.1]network 3.3.3.3 0.0.0.0
[ftp server-ospf-1-area-0.0.0.1]network 192.168.2.4 0.0.0.0

在客户端登录并进行文件操作

client:
<client>ftp 3.3.3.3    //访问服务器并登陆用户ftp
Trying 3.3.3.3 ...

Press CTRL+K to abort
Connected to 3.3.3.3.
220 FTP service ready.
User(3.3.3.3:(none)):ftp
331 Password required for ftp.
Enter password:
230 User logged in.

[client-ftp]dir   //查看文件
200 Port command okay.
150 Opening ASCII mode data connection for *.
drwxrwxrwx   1 noonenogroup 0 Mar 15 07:30 dhcp
 -rwxrwxrwx   1 noonenogroup121802 May 26  2014  portalpage.zip
 -rwxrwxrwx   1 noonenogroup  2263 Mar 15 07:30 statemach.efs
 -rwxrwxrwx   1 noonenogroup828482 May 26  2014 sslvpn.zip
drwxrwxrwx   1 noonenogroup 0 Mar 15 07:30 .
226 Transfer complete.
FTP: 327 byte(s) received in 0.180 second(s) 1.81Kbyte(s)/sec.

[client-ftp]get sslvpn.zip a.zip    //保存文件sslvpn.zip到本地并命名为a.zip

检查操作是否成功

client
[client-ftp]q
221 Server closing.

<client>dir
Directory of flash:/

  Idx  Attr Size(Byte)  DateTime(LMT)  FileName 
0  drw-  -  Mar 15 2021 07:30:16   dhcp
1  -rw-121,802  May 26 2014 09:20:58   portalpage.zip
2  -rw-828,482  Mar 15 2021 08:31:52   a.zip    //可看到文件a.zip已保存
3  -rw-  2,263  Mar 15 2021 07:30:04   statemach.efs
4  -rw-828,482  May 26 2014 09:20:58   sslvpn.zip        

##实验三:Telent配置#

实验环境

password认证模式

实验思路

* 1. 对服务器进行客户数据录入 * 2. 在客户端对服务器进行操作 * 3. 查看服务器上配置是否更改

具体实施

对服务器进行客户数据录入

telnet server:
[telnet server]user-interface vty 0 4
[telnet server-ui-vty0-4]authentication-mode password
Please configure the login password (maximum length 16):huawei
[telnet server-ui-vty0-4]user privilege level 3

在客户端对服务器进行操作

client:
[telnet server]int lo 0    //修改环回口地址
[telnet server-LoopBack0]ip add 4.4.4.4 32

查看服务器上配置是否更改

查看服务器上的接口IP:
<telnet server>dis ip int 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  
GigabitEthernet0/0/0  192.168.2.4/24   up up
GigabitEthernet0/0/1  unassigned   down   down  
GigabitEthernet0/0/2  unassigned   down   down  
LoopBack0 3.3.3.3/32   up up(s) 
NULL0 unassigned   up up(s) 
修改环回口地址后:
[telnet server]dis ip int 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  
GigabitEthernet0/0/0  192.168.2.4/24   up up
GigabitEthernet0/0/1  unassigned   down   down  
GigabitEthernet0/0/2  unassigned   down   down  
LoopBack0 4.4.4.4/32   up up(s) 
NULL0 unassigned   up up(s) 

aaa认证模式

    1. 对服务器进行客户数据录入
    1. 在客户端对服务器进行操作
    1. 查看服务器上配置是否更改

具体实施

对服务器进行客户数据录入

telnet server:
[telnet server]undo ftp server
Info: Succeeded in closing the FTP server.
[telnet server]aaa
[telnet server-aaa]local-user tenlnet password cipher huawei
Info: Add a new user.
[telnet server-aaa]local-user telnet privilege  level  3

在客户端对服务器进行操作

client:
Password:
<telnet server>
<client>telnet 3.3.3.3
  Press CTRL_] to quit telnet mode
  Trying 3.3.3.3 ...
  Connected to 3.3.3.3 ...

Login authentication


Login authentication
Username:tenlnet
Password:
<telnet server>sy
Enter system view, return user view with Ctrl+Z.
[telnet server]sy R3   //修改telnet server的名字为R3

查看服务器上配置是否更改

更改名字前:
<telnet server>sy
Enter system view, return user view with Ctrl+Z.
更改名字后:
<R3>sy
Enter system view, return user view with Ctrl+Z.
[R3]

实验总结

本次实验介绍了三层交换机的VLANIF配置,FTP配置以及Telent配置。

  • VLAN可以满足同网段之间的网络互访,但无法实现不同VLAN之间的互访,而VLANIF接口是一种三层接口,可以实现路由转发功能,支持VLAN Tag的剥离和添加,故可通过VLANIF接口实现VLAN间的通信。VLANIF接口编号与VLAN ID相同,直接配置网关IP。
  • FTP是用来传送文件的协议,用FTP实现远程文件传输。需要设置客户端与服务器间建立控制连接与数据连接。先在服务器录入用户信息和权限来达到控制目的,再通过动态配置连通网络,此时便可以实现文件传输和下载。
  • Telnet用于对另一个网络中的设备进行远程控制和管理,基于TCP连接来使客户端和服务器能传输指令。本次实验中也用到了两种认证模式:AAA模式以及Password模式。前者需要用户名和密码,后者只需要密码。先在服务器录入用户信息和权限,再对连通的网络进行对目的设备的管理。

实验总结

本次实验介绍了三层交换机的VLANIF配置,FTP配置以及Telent配置。

  • VLAN可以满足同网段之间的网络互访,但无法实现不同VLAN之间的互访,而VLANIF接口是一种三层接口,可以实现路由转发功能,支持VLAN Tag的剥离和添加,故可通过VLANIF接口实现VLAN间的通信。VLANIF接口编号与VLAN ID相同,直接配置网关IP。
  • FTP是用来传送文件的协议,用FTP实现远程文件传输。需要设置客户端与服务器间建立控制连接与数据连接。先在服务器录入用户信息和权限来达到控制目的,再通过动态配置连通网络,此时便可以实现文件传输和下载。
  • Telnet用于对另一个网络中的设备进行远程控制和管理,基于TCP连接来使客户端和服务器能传输指令。本次实验中也用到了两种认证模式:AAA模式以及Password模式。前者需要用户名和密码,后者只需要密码。先在服务器录入用户信息和权限,再对连通的网络进行对目的设备的管理。
评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值