远程管理路由与交换
7.1 问题
本例要求配置好交换机与路由器支持telnet远程管理,相关说明如下:
实现Router1远管理Switch1、Switch2
实现Switch1、Switch2远程管理Router1
7.2 方案
路由器与交换机远程管理,如图-13所示。
图-13
7.3 步骤
实现此案例需要按照如下步骤进行。
步骤一:配置路由器接口IP
配置路由器
Router1 G0/0/1接口IP为192.168.1.254,G0/0/2接口IP为192.168.2.254
<HuaWei>system-view
[HuaWei]sysname Router1
[Router1]
[Router1]interface g0/0/1 //进接口 g0/0/1
[Router1-GigabitEthernet0/0/0] ip address 192.168.1.254 24 //配IP地址
[Router1]interface g0/0/2 //进接口 g0/0/2
[Router1-GigabitEthernet0/0/0] ip address 192.168.2.254 24 //配IP地址
步骤二:为路由器配置AAA认证
1)启用AAA认证登录
[Router1] user-interface vty 0 4 //进远程登录配置视图
[Router1-ui-vty0-4]user privilege level 3 //设置用户登录级别
[Router1-ui-vty0-4] authentication-mode aaa //启用AAA认证
2)配置用户及控制方式
[Router1] aaa //进AAA配置视图
[Router1-aaa] local-user ntdadm password cipher Taren1 //添加用户ntdadm
Info: Add a new user.
[Router1-aaa] local-user ntdadm service-type telnet //选择控制方式telnet
步骤三:配置Switch1的vlan1 IP地址为 192.168.1.100,掩码24位
<Huawei> system-view //进系统视图
[Huawei]sysname Switch1
[Switch1] interface vlan1 //进虚接口vlan1配置
[Switch1-Vlanif1]ip address 192.168.1.100 24 //设置IP地址
.. .. The line protocol IP on the interface Vlanif1 has entered the UP state.
步骤四:配置Switch2的vlan1 IP地址为 192.168.2.100,掩码24位
<Huawei> system-view //进系统视图
[Huawei]sysname Switch2
[Switch2] interface vlan1 //进虚接口vlan1配置
[Switch2-Vlanif1]ip address 192.168.2.100 24 //设置IP地址
.. .. The line protocol IP on the interface Vlanif1 has entered the UP state.
步骤五:为交换机Switch1配置AAA认证
1)启用AAA认证登录
[Switch1] user-interface vty 0 4 //进远程登录配置视图
[Switch1-ui-vty0-4]user privilege level 3 //设置用户登录级别
[Switch1-ui-vty0-4] authentication-mode aaa //启用AAA认证
2)配置用户及控制方式
[Switch1] aaa //进AAA配置视图
[Switch1-aaa] local-user ntdadm password cipher Taren1 //添加用户ntdadm
Info: Add a new user.
[Switch1-aaa] local-user ntdadm service-type telnet //选择控制方式telnet
步骤六:为交换机Switch2配置AAA认证
1)启用AAA认证登录
[Switch2] user-interface vty 0 4 //进远程登录配置视图
[Switch2-ui-vty0-4]user privilege level 3 //设置用户登录级别
[Switch2-ui-vty0-4] authentication-mode aaa //启用AAA认证
2)配置用户及控制方式
[Switch2] aaa //进AAA配置视图
[Switch2-aaa] local-user ntdadm password cipher Taren1 //添加用户ntdadm
Info: Add a new user.
[Switch2-aaa] local-user ntdadm service-type telnet //选择控制方式telnet
步骤七:在路由器Router1上操作,使用自带的 telnet 命令连接交换机Switch1
需要正确输入用户名、密码才能连入:
<Router1> telnet 192.168.1.100 //连接交换机IP地址
Press CTRL_] to quit telnet mode
Trying 192.168.1.100 ...
Connected to 192.168.1.100 ...
Login authentication
Username:ntdadm //输入正确用户名
Password: //输入正确密码
Info: The max number of VTY users is 5, and the number
of current VTY users on line is 1.
The current login time is 2018-07-25 13:40:15.
<Switch1>//成功连入
步骤八:在路由器Router1上操作,使用自带的 telnet 命令连接交换机Switch2
需要正确输入用户名、密码才能连入:
<Router1> telnet 192.168.2.100 //连接交换机IP地址
Press CTRL_] to quit telnet mode
Trying 192.168.2.100 ...
Connected to 192.168.2.100 ...
Login authentication
Username:ntdadm //输入正确用户名
Password: //输入正确密码
Info: The max number of VTY users is 5, and the number
of current VTY users on line is 1.
The current login time is 2018-07-25 13:40:15.
<Switch2> //成功连入
步骤九:在交换机Switch1上操作,使用自带的 telnet 命令连接Router1
需要正确输入用户名、密码才能连入:
<Switch1> telnet 192.168.1.254 //连接路由器的IP地址
Press CTRL_] to quit telnet mode
Trying 192.168.1.254 ...
Connected to 192.168.1.254 ...
Login authentication
Username:ntdadm //输入正确用户名
Password: //输入正确密码
Info: The max number of VTY users is 5, and the number
of current VTY users on line is 1.
The current login time is 2018-07-25 13:40:15.
<Router1> //成功连入
步骤十:在交换机Switch2上操作,使用自带的 telnet 命令连接Router1
需要正确输入用户名、密码才能连入:
<Switch2> telnet 192.168.2.254 //连接路由器的IP地址
Press CTRL_] to quit telnet mode
Trying 192.168.2.254 ...
Connected to 192.168.2.254 ...
Login authentication
Username:ntdadm //输入正确用户名
Password: //输入正确密码
Info: The max number of VTY users is 5, and the number
of current VTY users on line is 1.
The current login time is 2018-07-25 13:40:15.
<Router1> //成功连入