435421 发表于 2016-4-25 09:45:13

H3C 基础配置

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.20DNS
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配置信息
resetnat session               清除nat缓存

静态路由配置
ip route-static 172.16.0.0255.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 LoopBack0ntp的更新源
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]
查看完整版本: H3C 基础配置