Cisco Router and switch 配置命令(三)

一、静态路由协议设置
router(config)#ip route network submask(要到达的网络号掩码)ip address(下一跳或出口ip地址)

router(config)#ip route 0.0.0.0 s0(出口端口或下一跳IP地址)


二、rip设置

router(config)#router rip

router(config-router)#network network-number

router#show ip protocol查看RIP信息

router#show ip route 查看路由表

router#debug ip rip查看RIP更新信息

router(config-router)#passive-interface e0(阻止发出作息)

router(config-router)#ip rip receive version 1 2接收1、2RIP版本信息

 

三、igrp设置
router(config)#router igrp as number

router(config-router)#network network number

router#show ip route 查看路由表

router#debug ip igrp events 查看IGRP路由更新大概信息

router#debug ip igrp transaction 查看IGRP路由更新详细信息

Router(config-router)#variance multiplier 控制 IGRP load balancing

Router(config-router)#traffic-share {balanced | min}控制load-balanced traffic 的分布

四、eigrp设置
router(config)#router eigrp as number

router(config-router)#network network number

router(config)#no auto-summry 关闭自动汇总

router(config)# auto-summry 打开自动汇总(默认是打开的)
router#show ip route eigrp 显示当前的路由表里的EIGRP条目

router#show ip protocol 显示活动的路由协议进程的参数和当前的状态

router#show ip eigrp neighbors 显示被EIGRP发现的邻居

router#show ip eigrp traffic 显示发出和收到的IP EIGRP 包的数量

router#show ip eigrp topology 显示IP EIGRP的拓扑表

   Router#debug ip eigrp

 

五、ospf设置
1. Router(config)#router ospf process-id

 

Router(config-router)#network address(可以是网络号也可以是Ip地址 mask(通配掩码 )area area-id

Router(config-if)# ip ospf priority numbe 配置OSPF的优先级
Router#show ip protocols 验证OSPF的配置

Router#show ip route 显示路由器学到的所有路由

Router#show ip ospf interface type number 显示 area-ID 和邻接信息

Router#show ip ospf neighbor 基于每接口显示OSPF邻居信息

Router#debug ip ospf events

Router#debug ip ospf packet
2. Router(config)# interface loopback number(lookback回路配置)

Router(config-if)# ip address ip-address subnet-mask
Router(config-if)# ip ospf cost cost-numbe 修改OSPF 的Cost数值

Router(config-if)# ip ospf authentication-key key 配置明文口令

Router(config-if)# ip ospf messge-digest-key keyid md5 key 配置MD5口令

(keyid和key必须配对一致,两邻居才可以通信)

Router(config-route)# area area-id authentication [message-digest]

message-digest为可选 项,使用后路由器只传送口令消息的摘要(或散列) 配置OSPF区域的验证:
3. Router(config-if)# ip ospf hello-interval seconds 配置hello间隔:

Router(config-if)# ip ospf dead-interval seconds配置down机判断间隔

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
为了防止用户私设IP地址,可以在网络中采取如下措施: 1. 使用DHCP自动分配IP地址:使用DHCP可以自动分配IP地址,从而避免用户私设IP地址。DHCP服务器会为每个客户端分配唯一的IP地址,并记录在DHCP服务器的地址池中。 2. 使用IP地址绑定:在交换机或路由器配置IP地址绑定,可以将IP地址和MAC地址进行绑定,从而防止用户私设IP地址。当用户尝试使用非法IP地址时,交换机或路由器会将其拒绝。 3. 启用端口安全:在交换机上启用端口安全特性,可以限制每个端口所允许的MAC地址数量。这样可以防止用户通过私设IP地址来攻击网络。 以下是Cisco交换机上的一些命令示例: 使用DHCP自动分配IP地址: ``` switch(config)# ip dhcp pool mypool switch(config-dhcp)# network 192.168.1.0 255.255.255.0 switch(config-dhcp)# default-router 192.168.1.1 switch(config-dhcp)# dns-server 192.168.1.2 switch(config-dhcp)# lease 7 switch(config)# interface gigabitethernet 1/0/1 switch(config-if)# switchport mode access switch(config-if)# switchport access vlan 10 switch(config-if)# ip dhcp snooping trust ``` 使用IP地址绑定: ``` switch(config)# arp access-list myarp switch(config-arp-nacl)# permit ip host 192.168.1.10 mac host 0011.2233.4455 switch(config)# interface gigabitethernet 1/0/1 switch(config-if)# arp access-group myarp in ``` 启用端口安全: ``` switch(config)# interface gigabitethernet 1/0/1 switch(config-if)# switchport port-security switch(config-if)# switchport port-security maximum 2 switch(config-if)# switchport port-security violation restrict ```

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值