设为首页 收藏本站
查看: 1847|回复: 0

[经验分享] H3C 基础配置

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2016-4-25 09:45:13 | 显示全部楼层 |阅读模式
info-center enable    开启日志系统
undo info-center enable  关闭日志系统
info-center synchronous 打开命令行输入回显功能
copyright-info enable    显示版权信息
ip ttl-expires enable    开启ICMP超时报文发送功能
ip unreachables enable   开启ICMP目的不可达报文发送功能

远程登录配置(telnet ,ssh)
telnet server enable  开启telnet                  
public-key local create rsa   配置rsa  密钥对
password-control enable
ssh server enable    开启ssh服务                        
ssh user admin service-type stelnet authentication-type  配置用户admin的服务类型为stelnet 认证方式为
ip ssh version 2     默认是1.99版本

local-user admin  建立本地用户
password simple 123    设置密码
authorization-attribute level 3  拥有的权限
service-type telnet  服务类型       telnet下的用户
service-type web                       web下的用户
service-type ssh
service-type terminal level 3   有时候需要开启console登陆密码模式
user-interface vty 0 4
authentication-mode scheme       调用本地认证
protocol inbound SSH   启用ssh登录
acl 3000 inbound     允许进来的acl条目
acl number 3000      acl条目
rule 0 permit tcp    允许tcp访问
rule 5 permit tcp source host 192.168.1.1 any destination-port eq 22     允许192.168.1.1 访问任何的22端口
user-interface aux 0   进入console口
authentication-mode password    配置密码
无操作自动断开连接:
user-interface vty 0 4
idle-timeout 1 30      设置超时时间为1分钟30秒。
idle-timeout minutes 10                10分钟无操作自动断开连接
idle-timeout seconds 10                10秒钟无操作自动断开连接
idle-timeout         超时时间默认为10分钟
escape-key a                                  按a终结ping
activation-key s                              按s进入console配置界面
auto-execute command telnet 192.168.1.2       192.168.1.2 登录不需要密码可以直接登录

password-control enable
password-control login-attempt 3 exceed lock-time 1       登录尝试次数三次 则等1分钟在登录

ip http enable                               开启http
ip http port 8080                            开启http8080端口
ip http acl 2000                             配置HTTP服务与ACL 2000关联   
free web-users命令用来强制在线Web用户下线


STP配置
stp enable 开启stp
stp region-configuration                                      
region-name vrrp     命名
instance 1 vlan 10    将vlan10 加入到实例1中
instance 2 vlan 20    将vlan10 加入到实例1中
active region-configuration   激活stp
quit
stp instance 1 root primary  实例1为主根
stp instance 2 root secondary 实例2为备根
stp开启默认是mstp,同时在instance 0 中 若需求要负载那就必须激活stp 要规范它怎么走
ospf与stp不能在核心上用,一个是二层的协议,一个是三层的协议 (二层与三层的应用要考虑清楚)
stp config-digest-snooping  与其它厂商对接

interface range g1/1 to g1/24   
stp edged-port  连接终端的端口改为边缘端口

VRRP配置
vlan 2 创建vlan
interface vlan 2   vlan接口下     
description link-XXX   描述
default   恢复默认接口(只要是接口都可以使用)
ip address 2.2.2.2 255.255.255.0    配置IP地址
ip address 3.3.3.3 255.255.255.0 sub     配置从地址
undo shutdown   激活vlan接口
ospf cost 100    修改ospf的开销值
vrrp vrid 2 virtual-ip 2.2.2.1  建立虚拟网关
vrrp vrid 2 priority 120   设置优先级
vrrp vrid 2 track 1 reduced 30   追踪上链口减少
track 1 interface Vlan-interface2  追踪vlan2
track 1 interface GigabitEthernet1/0/1 追踪GigabitEthernet1/0/1接口
vrrp的主备没起来是没进行通讯,当都是master的时候,那就要检查协议之间的连通性

单隔离组
interface GigabitEthernet 1/0/2
port-isolate enable

创建隔离组2
port-isolate group 2   将端口GigabitEthernet4/0/2加入隔离组2
interface GigabitEthernet 4/0/2
port-isolate enable group 2

interface GigabitEthernet 4/0/1 配置端口GigabitEthernet4/0/1为隔离组2的上行端口
port-isolate uplink-port group 2
二层链路聚合配置
interface Bridge-Aggregation2  建立聚合组
interface range GigabitEthernet0/0/1 to GigabitEthernet0/0/2    进入接口
port link-aggregation group 2   把聚合组加到接口下

interface Bridge-Aggregation2    进入聚合组
port link-type trunk            启用trunk模式,或启用access
port trunk permit vlan all      允许所有vlan通过,或仅允许一个vlan通过

interface route-aggregation 2   三层聚合
ip address 192.168.1.1 255.255.255.252
link-aggregation global load-sharing mode destination-ip   ip地址进行负载分担
link-aggregation mode dynamic    动态聚合模式
interface range g0/0/0 to g0/0/1
lacp mode passive
port link-aggregatio group 2


DHCP配置

dhcp enable 开启dhcp
dhcp server ip-pool pool  建立dhcp名称
network 172.16.18.0 mask 255.255.255.0  地址段
gateway-list 172.16.18.1  网关
dns-list 202.106.0.20  DNS
expired day 8  租用天数
option 43 hex 800B0000 02AC1267 03AC1267 04    十六进制    (无线用的)
dhcp server forbidden-ip 172.16.18.1  排除地址
dhcp server forbidden-ip 172.16.18.254

NAT配置

interface GigabitEthernet1/1
description link to S5500
ip address 172.16.18.1 255.255.255.0 内网地址

interface GigabitEthernet1/0   外网口
ip address 106.120.223.242 255.255.255.0 公网地址
nat outbound 2000 address-group 1
nat server protocol tcp global 106.120.223.254 9900 inside 172.16.18.100 9900  端口映射
nat server protocol udp global 106.120.223.254 9904 inside 172.16.18.100 9904
nat static enable


nat static outbound 172.16.18.100 106.120.205.100

nat address-group 1 106.120.205.24 106.120.205.24  用户NAT的地址池

nat log enable                   开启nat日志
display nat all                  显示所有nat配置信息
reset  nat session               清除nat缓存

静态路由配置
ip route-static 172.16.0.0  255.255.0.0 172.16.2.1    静态路由
ip route-static 0.0.0.0 0.0.0.0 2.2.2.254      缺省路由
delete static-routes all   删除所有静态路由
display ip routing-table   查看路由表

OSPF配置
ospf 110 router-id 1.1.1.1 建立进程号 router-id
peer 10.1.1.2   配置邻居
import-route static   重分布静态
import-route direct   重分布直连路由
default-route-advertise  下放默认路由
asbr-summary 10.1.0.0 255.255.252.0    ASBR地址汇总
area 0     区域零
network 2.2.2.0 0.0.0.255    宣告网段
area 1
abr-summary 10.1.0.0 255.255.252.0   ABR地址汇总

当网络中出现两台核心时,ospf的cost一定要做修改,不然路径等价负载会出现丢包现象。修改cost值不在ospf进程打 bandwidth-reference 不然你改cost的值就会出现麻烦
display ospf error       查看ospf报错信心
reset ospf 110 process    重启ospf110 进程


NTP配置
clock timezone bj add 8   配置时区
ntp-service source-interface LoopBack0  ntp的更新源
ntp-service refclock-master
                        
clock timezone bj add 8   配置时区
ntp-service unicast-server 8.8.8.8   ntp服务单播地址8.8.8.8


SNMP配置
snmp-agent 开启snmp协议
snmp-agent community read 111  只读密码111
snmp-agent sys-info version all 支持版本


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-208522-1-1.html 上篇帖子: H3C RIP 下篇帖子: 华为交换机配置ssh登陆
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表