DCN配置命令.docx_第1页
DCN配置命令.docx_第2页
DCN配置命令.docx_第3页
DCN配置命令.docx_第4页
DCN配置命令.docx_第5页
免费预览已结束,剩余1页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1. 基本配置:开启SSH服务:debug ssh-server设置特权模式密码:enable password 8 注释:8为加密的密码设置退出特权模式超时时间:exec-timeout Switch(config)#exec-timeout 5 30(退出时间为5分30秒)更改主机名:hostname 主机名设置主机名与IP地址的映射关系:Switch(config)#ip host beijing (beijing为主机)开启web配置服务:Switch(config)#ip http serve显示帮户信息的语言类型:language chinese|english使用密码验证:login使用本地用户密码验证:Switch(config)#login local设置用户在 console上进入一般用户配置模式时的口令:Switch(config)#password 8 test热启动交换机:reload加密系统密码:service password-encryption恢复交换机出厂配置:set default保存当前配置:write配置交换机作为 Telnet 服务器允许登录的 Telnet 客户端的安全 IP 地址:Switch(config)#telnet-server securityip 1设置Telnet 客户端的用户名及口令:Switch(config)#telnet-user Antony password 0 switch打开交换机的 SSH服务器功能:Switch(config)#ssh-server enable设置SSH客户端的用户名及口令:Switch(config)#ssh-user switch password 0 switch通过DHCP 方式获取 IP 地址。Switch(config)#interface vlan 1Switch(Config-if-Vlan1)#ip dhcp-client enableSwitch(Config-if-Vlan1)#exit交换机 Switch1 端口 1 同交换机 Switch2 端口 1 用线相连,将该两个端口设置为强制100Mbit/s 速率,半双工模式。Switch1(config)#interface ethernet1/1Switch1(Config-If-Ethernet1/1)#speed-duplex force100-halfSwitch2(config)#interface ethernet1/1Switch2(Config-If-Ethernet1/1)#speed-duplex force100-half配置名称为 test的隔离组。SwitchenableSwitch#configSwitch(config)#isolate-port group test打开LACP调试开关。Switch#debug lacp新建一个 port group,并且采用默认的流量分担方式。Switch (config)#port-group 1删除一个 port groupSwitch (config)#no port-group 1在 Ethernet1/1 端口模式下,将本端口以 active 模式加入port-group 1。Switch (Config-If-Ethernet1/1)#port-group 1 mode active删除端口 1 动态MAC。Switch#clear port-security dynamic interface Ethernet 1/1使能端口 1 的MAC 地址绑定功能。Switch(config)#interface Ethernet 1/1Switch(Config-If-Ethernet1/1)#switchport port-security将端口 1 的MAC地址转化为静态安全 MAC 地址。Switch(config)#interface Ethernet 1/1Switch(Config-If-Ethernet1/1)#switchport port-security convert添加MAC 00-03-0F-FE-2E-D3 到端口 1Switch(config)#interface Ethernet 1/1Switch(Config-If-Ethernet1/1)#switchport port-security mac-address 00-03-0F-FE-2E-D3设置端口 1 安全MAC 地址上限为 4。Switch(config)#interface Ethernet 1/1Switch(Config-If-Ethernet1/1)#switchport port-security maximum 4设置端口 1 的违背模式为 shutdown。Switch(config)#interface Ethernet 1/1Switch(Config-If-Ethernet1/1)#switchport port-security violation shutdown生成树配置:配置VLAN1-10;100-110 与 Instance 1的映射关系。Switch(config)#spanning-tree mst configurationSwitch(Config-Mstp-Region)#instance 1 vlan 1-10;100-110配置修正数值为 2000。Switch(config)#spanning-tree mst configurationSwitch(Config-Mstp-Region)# revision-level 2000开启和关闭生成树Switch(config)#spanning-treeSwitch(config)#interface ethernet 1/2Switch(Config-If-Ethernet1/2)#no spanning-tree设置交换机运行 STP模式。Switch(config)#spanning-tree mode stp在端口 1/2 设置实例 1 的端口优先级为 32。Switch(config)#interface ethernet 1/2Switch(Config-If-Ethernet1/2)#spanning-tree mst 1 port-priority 32配置交换机实例 2 的优先级为 4096。Switch(config)#spanning-tree mst 2 priority 4096访问控制列表配置:使能在 Tuesday到 Saturday内的 9:15:30到 12:30:00时间段内配置生效Switch(config)#time-range dc_timerSwitch(Config-Time-Range-dc_timer)#absolute-periodic tuesday 9:15:30 to saturday 12:30:00使能在 Monday、Wednesday、Friday和 Sunday四天内的 14:30:00到 16:45:00 时间段配置生效Switch (Config-Time-Range-dc_timer)#periodic monday wednesday friday sunday 14:30:00 to16:45:00创建编号为110的数字扩展访问列表。拒绝icmp报文通过,允许目的地址为目的端口为 32 的udp 包通过。Switch(config)#access-list 110 deny icmp any-source any-destinationSwitch(config)#access-list 110 permit udp any-source host-destination d-port 32创建一条编号为 20的数字标准 IP访问列表,允许源地址为 /24 的数据包通过,拒绝其余源地址为 /16 的数据包通过。Switch(config)#access-list 20 permit 55Switch(config)#access-list 20 deny 55允许源 MAC 地址为 00-00-XX-XX-00-01 的数据包通过,拒绝源地址为00-00-00-XX-00-ab 的数据包通过。Switch(config)# access-list 700 permit 00-00-00-00-00-01 00-00-FF-FF-00-00Switch(config)# access-list 700 deny 00-00-00-00-00-ab 00-00-00-FF-00-00允许源地址为 /24 的数据包通过,拒绝其余源地址为 /16 的数据包通过。Switch(config)# ip access-list standard ipFlowSwitch(Config-Std-Nacl-ipFlow)# permit 55Switch(Config-Std-Nacl-ipFlow)# deny 55二层交换机配置:1.基本配置:enable 进入特权模式 config 禁进入全局配置模式 hostname 更改设备名称1.使用TFTP上传文件:show flashcopy startup-config t0/sw1-config012.配置telnet服务:telnet-server enabletelnet-user admin password 0 admintelnet-server secu 指定特定的IP远程登录3.http登录:ip http serverweb-user dcnu password 0 dcnu指定登录用户名和密码4.交换机vlan的配置:vlan 10switchport interface ethernet 0/0/1-105.端口镜像:monitor session 1 source interface ethernet 0/0/1;10;24monitor session 1 destination interface ethernet 0/0/236.端口MAC地址绑定:sw port-securitysw port-security mac-address 00-0B-CD-4A-23-AF查看mac地址表:show mac-address-table7.AM实现端口IP和MAC地址绑定:am enableam mac-ip-pool mac地址 IP地址8.生成树配置:开启和关闭生成树:span no span针对特定端口开启和关闭生成树:int e0/0/1 span/no spanmstp配置:span mstp config name dcnu instance 1 vlan 10 instance 2 vlan 20指定优先级:span mstp 1 priority 4096 span mstp 2 priority 61440指定特定端口的优先级:int e0/0/1 span mstp 1 port-poriority 16 span mstp 2 port-poriority 240三层交换机DHCP和中继的配置:1.DHCP配置:vlan 10 vlan 20 int vlan 10 ip add int vlan 20 ip add service dhcp ip dhcp pool 1 network-address 24 default-router ip dhcp pool 2 network-address 24 default-router 2.DHCP中继:ip forward-protocol udp bootps int vlan 10 ip help ip route 路由器配置:1.ospf路由器配置:router ospf 100network area 0接口权值配置:ip ospf cost 值路由重分发:redistribute ospf 区域号 redistribute rip下面的配置在路由器A和B之间配置一条 virtua link。路由器 A(router-id: )上的配置:!router ospf 100network area 1 area 1 virtual-link 路由器 B(router-id: )上的配置:router ospf 100network area 1 area 1 virtual-link 策略路由配置:创建ACL:ip access-list standard net1 permit 55创建router-map:router-map router-map pbr 10 permit match ip addess net1 set ip next-hop 9绑定在进入的接口上:interface fastethernet 0/0 ip policy route-map pbrRouterA配置:RouterenableRouter#confRouter_config#hostname RouterARouterA_config#username RouterB password 1234 设置账号密码RouterA_config#int s0/1RouterA_config_s0/1#ip address RouterA_config_s0/1#encapsulation ppp 封装PPP协议RouterA_config_s0/1#ppp authentication chap 设置验证方式RouterA_config_s0/1#ppp chap hostname RouterA 设置发给对方验证的账号RouterA_config_s0/1#physical-layer speed 64000 设置DCE时钟频率RouterA_config_s0/1#no shutRouterA_config_s0/1#exitRouterA_config#aaa authentication ppp default local 配置aaa的ppp认证方法表RouterB配置:RouterenableRouter#confRouter_config#hostname RouterBRouterB_config#username RouterA password 1234 设置账号密码RouterB_config#int s0/1RouterB_config_s0/1#ip address RouterB_config_s0/1#encapsulation ppp 封装PPP协议RouterB_config_s0/1#ppp authentication chap 设置验证方式RouterB_config_s0/1#ppp chap hostname RouterB 设置发给对方验证的账号RouterB_config_s0/1#no shutRouterB_config_s0/1#exitRouterB_config#aaa authentication ppp default local 配置aaa的ppp认证方法表注意:接口和协议都必须是UP;如果协议是dow

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论