1,安全的网管网络设备
1)enable密钥
a,明文
Router(config)#enable password CISCO
扰乱明文:
Router(config)#service password-encryption
b,MD5(“密文”)
Router(config)#enable secret 123
2)telnet
默认,Login开启
line con 0
line vty 0 4
login
show control-plane host open-ports(查看开放的端口)
3)console
默认,“no login”
正确的配置:
!
Router(config)#line console 0
Router(config-line)#login
% Login disabled on line 0, until 'password' is set
Router(config-line)#pass
Router(config-line)#password 123
!
!
4)设置VTY/console超时时间
Router(config)#line console 0
Router(config-line)#exec-timeout 10--分 0--秒
5
)安全的登录方式:
SSH
(密文)
配置方式:
a
,设备名称
!
hostname R2
!
b
,用户名和密钥
!
username ccie privilege 15 password 0 cisco
!
c
,域名
!
ip domain name xh.edu
!
d
,产生
RSA
非对称密钥
R2(config)#
crypto key generate rsa
The name for the keys will be: R2.xh.edu
Choose the size of the key modulus in the range of 360 to 4096 for your
General Purpose Keys. Choosing a key modulus greater than 512 may take
a few minutes.
How many bits in the modulus [
512
]:
1024
% Generating 1024 bit RSA keys, keys will be non-exportable...
[OK] (elapsed time was 0 seconds)
*Mar 26 15:11:10.509: %SSH-5-ENABLED:
SSH 1.99 has been enabled
***********************************
在
VTY
线下执行:
login local
(使用本地数据库认证)
!
line vty 0 4
login local
----使用本地数据库认证
transport input
ssh
----只接受SSH方式登录
!
***********************************
全局启用
3A:aaa new-mode
R2(config)#aaa new-model
***********************************
6
)
GW
(默认网关)
R1(config)#
no ip routing ---关闭三层设备(router)路由功能
R1(config)#do sh ip route
Default gateway is not set
Host Gateway Last Use Total Uses Interface
ICMP redirect cache is empty
R1(config)#
ip default-gateway 12.1.1.2 ---设置默认网关
R1(config)#
do sh ip route
Default gateway is 12.1.1.2
Host Gateway Last Use Total Uses Interface
ICMP redirect cache is empty
7)访问控制
拓扑:
需求:
a
,各网段以及
IP
地址如拓扑所示
b
,只允许内网主机
R1
(
10.1.1.1
)通过
telnet
来访问
R3
(
10.1.1.10
)
配置:
************************R3*************************
!使用
ACL
匹配流量(
严重提醒:
VTY
线下只能使用
标准
ACL
)
access-list
1
permit 10.1.1.1
access-list
1
deny any log
!
line vty 0 4
access-class
1
in ----在虚拟终端接口下调用ACL
password cisco
login
transport input
telnet
----
只允许
telnet方式登录
!
作业:
1,enable密钥
2,console、VTY保护
3,SSH
4,限制访问(vty)