Switch(config)#login block-for 180 attempts 4 within 120
11.配置vty线路进行SSH访问并要求本地用户配置文件
Switch(config)#line vty 0
Switch(config-line)#transport input ssh
Switch(config-line)#login local
SSH改成版本2
(config)#ip ssh version 2
12.禁用所有未使用的端口
//这是网卡端口
S1(config)#interface range fa0/3-24 //3~24我不用
S1(config-if-range)#shutdown //关闭
//这是高速端口
S1(config-if-range)#interface range gi0/1-2
S1(config-if-range)#shutdown 13. 将接口模式设置为接入模式
S1(config)#interface range fa0/1 - 2
S1(config-if-range)#switchport mode access 14.启用端口安全,使每个端口仅允许两台主机
//这是启用端口安全
S1(config)#interface range fa0/1 - 2
S1(config-if-range)#switchport port-security
//这是每个端口允许两台主机
S1(config)#interface range fa0/1-2
S1(config-if-range)#switchport port-security maximum 2 15.在运行配置中记录 MAC 地址
S1(config)#interface range fa0/1-2
S1(config-if-range)#switchport port-security mac-address sticky 16.确保在发生端口违规时是否禁用端口?
config t
interface GigabitEthernet0/0
no shutdown
interface GigabitEthernet0/0.10
description Sales VLAN
encapsulation dot1Q 10
ip address 172.31.10.1 255.255.255.0
interface GigabitEthernet0/0.20
description Production VLAN
encapsulation dot1Q 20
ip address 172.31.20.1 255.255.255.0
interface GigabitEthernet0/0.30
description Marketing VLAN
encapsulation dot1Q 30
ip address 172.31.30.1 255.255.255.0
interface GigabitEthernet0/0.88
description Management VLAN
encapsulation dot1Q 88
ip address 172.31.88.1 255.255.255.0
interface GigabitEthernet0/0.99
description Native VLAN
encapsulation dot1Q 99 native
ip address 172.31.99.1 255.255.255.0
ip route 0.0.0.0 0.0.0.0 Serial0/0/0
· 在 S1 上配置中继。
en
config t
int g0/1
switchport mode trunk
switchport trunk native vlan 99
· 在 HQ 上配置四个分别通往 VLAN 10、20、30 和 88 的直连静态路由。
· 在 HQ 上配置到达外部主机的直连静态路由。
- 配置通过 Serial 0/1/0 接口的主路径。
- 配置通过 Serial 0/1/1 接口且 AD 为 10 的备份路由。
en
conf t
ip route 172.31.10.0 255.255.255.0 Serial0/0/0
ip route 172.31.20.0 255.255.255.0 Serial0/0/0
ip route 172.31.30.0 255.255.255.0 Serial0/0/0
ip route 172.31.88.0 255.255.255.0 Serial0/0/0
ip route 209.165.200.0 255.255.255.224 Serial0/1/0
ip route 209.165.200.0 255.255.255.224 Serial0/1/1 10
· 在 ISP 上为整个 172.31.0.0/17 地址空间配置直连主总结路由和直连备份总结路由。
- 配置通过 Serial 0/1/1 接口的主路径。
- 配置通过 Serial 0/1/0 接口且 AD 为 25 的备份路由。
en
conf t
ip route 172.31.0.0 255.255.128.0 Serial0/1/1
ip route 172.31.0.0 255.255.128.0 Serial0/1/0 25
服务器第七章
这一章我们学习 配置RIPv2
这一章的图例:
ok,开始咯
第 1 步: 在 R1 上配置 RIPv2。
a. 使用适当的命令在 R1 上创建一条默认路由,使所有 Internet 流量通过 S0/0/1 退出网络。
R1(config)# ip route 0.0.0.0 0.0.0.0 s0/0/1
b. 进入 RIP 协议配置模式。
R1(config)# router rip
c. 使用 RIP 协议的第 2 版并禁用网络总结。
R1(config-router)# version 2
R1(config-router)# no auto-summary
d. 为连接 R1 的网络配置 RIP。
R1(config-router)# network 192.168.1.0
R1(config-router)# network 192.168.2.0
e. 配置不包含路由器的 LAN 端口,以使其不发送任何路由信息。
R1(config-router)# passive-interface gig 0/0
f. 通过其他 RIP 路由器,通告第 1a 步中配置的默认路由。
R1(config-router)# default-information originate
g. 保存配置。
第 2 步: 在 R2 上配置 RIPv2。
a. 进入 RIP 协议配置模式。
R2(config)# router rip
b. 使用 RIP 协议的第 2 版并禁用网络总结。
R2(config-router)# version 2
R2(config-router)# no auto-summary