赞
踩
目录
——————————————————————————————————————————————————
- <Huawei>system-view //进入配置模式
- [Huawei]sysname r3 //定义主机名
- [Huawei]display current-configuration //查看当前配置 show run
- [Huawei]display ip routing-table //查看路由表 show ip route
- [Huawei]display interface brief //查看接口UP/DOWN show int brief
- [Huawei]display interface e0/0/0 //查看具体接口状态信息
- [Huawei]display arp all //查看ARP映射 show ip arp
- [sw]display mac-address VLAN 100 //查看当前交换机MAC地址表(可以跟上具体vlan)
- [sw]display vlan //查看VLAN数据库
- [sw3]display ip interface brief //相当于 show ip int brief
- interface Ethernet0/0/0
- description to fw-g0/0/4 //接口描述
- undo portswitch //二层接口变成三层接口
- ip address 10.1.1.1 255.255.255.0 //配置接口IP地址
- undo shut //激活接口
- int g0/0/0
- undo shutdown
- quit
- interface GigabitEthernet0/0/0.10 //进入子接口
- vlan-type dot1q 10 //封装trunk,制定VLAN ID为VLAN10
- ip address 10.1.1.10 255.255.255.0 //配置IP地址
- undo shut
- [~HUAWEI]vlan 10
- [*HUAWEI-vlan10]description caiwu //针对vlan做一个描述
- [*HUAWEI-vlan10]vlan 20
- [*HUAWEI-vlan20]quit
- [*HUAWEI]commit //(commit)CE系列交换机,需要打commit配置才会生效
- [~HUAWEI]display vlan //查看vlan
- [~HUAWEI]int g1/0/0
- [~HUAWEI-GE1/0/0]port link-type access
- [~HUAWEI-GE1/0/0]port default vlan 10
- [*HUAWEI-GE1/0/0]undo shut
- [*HUAWEI-GE1/0/0]quit
- [*HUAWEI]int g1/0/2
- [~HUAWEI-GE1/0/2]undo shutdown
- [*HUAWEI-GE1/0/2]port link-type trunk
- [*HUAWEI-GE1/0/2]port trunk allow-pass vlan all //思科trunk允许所有vlan穿越,华为的默认不允许所有vlan穿越,修改一下
- [*HUAWEI-GE1/0/2]quit
- [*HUAWEI]commit //写入所配置的命令(如果没有打这个命令,默认不会生效)
- [*HUAWEI]display current-configuration //相当于sh run
- [~HUAWEI]display interface brief //查看接口up情况
- [~HUAWEI]int g1/0/1
- [~HUAWEI-GE1/0/1]undo portswitch
- [*HUAWEI-GE1/0/1]q
- [*HUAWEI]commit
- <HUAWEI>save //保存配置,相当于write
- [*HUAWEI]int vlanif 40
- [*HUAWEI-Vlanif40]ip add 192.168.40.254 255.255.255.0
- [*HUAWEI-Vlanif40]un sh
- [*HUAWEI-Vlanif40]q
- [*HUAWEI]commit
- [sw1]int Eth-Trunk 1 //创建一个捆绑接口(int port-channel 1)
- [sw1-Eth-Trunk1]quit
- [sw1]int g0/0/4
- [sw1-GigabitEthernet0/0/4]eth-trunk 1
- [sw1-GigabitEthernet0/0/4]q
- [sw1]int g0/0/3
- [sw1-GigabitEthernet0/0/3]eth-trunk 1
- [sw1-GigabitEthernet0/0/3]q
- [sw1]int Eth-Trunk 1
- [sw1-Eth-Trunk1]port link-type trunk
- [sw1-Eth-Trunk1]port trunk allow-pass vlan all
- [sw1-Eth-Trunk1]q
- [Quidway] dhcp enable //开启地址池
- [Quidway] ip pool 1 //配置地址池名称
- [Quidway-ip-pool-1] network 10.1.1.0 mask 255.255.255.128 //地址池范围
- [Quidway-ip-pool-1] dns-list 10.1.1.2 8.8.8.8 //DNS地址
- [Quidway-ip-pool-1] gateway-list 10.1.1.126 //网关
- [Quidway-ip-pool-1] excluded-ip-address 10.1.1.2
- [Quidway-ip-pool-1] excluded-ip-address 10.1.1.4
- [Quidway-ip-pool-1] lease day 10
- [Quidway-ip-pool-1] quit
- [Quidway] interface vlanif 10
- [Quidway-Vlanif10] dhcp select global //开启DHCP功能
- [Quidway-Vlanif10] quit
- [sw1]int Vlanif 100
- [sw1-Vlanif100]vrrp vrid 100 virtual-ip 192.168.100.110
- [sw1-Vlanif100]vrrp vrid 100 priority 101
- [sw1-Vlanif100]vrrp vrid 100 track interface g0/0/1 reduced 50
- [sw1-Vlanif100]vrrp vrid 100 preempt-mode timer delay 0 //开启抢占,延迟时间为0
- display vrrp brief //查看
- 相同的域,相同的实列
- ----定义MSTP:
- stp region-configuration //进入到MSTP配置模式里面
- region-name RG1 //定义域名,四台交换机必须相同
- instance 1 vlan 2 to 100 //创建实列1,包含vlan 2到vlan 100
- ( instance 1 vlan 5 7 12 )
- instance 1 vlan 6
- active region-configuration //把MSTP的功能激活
- quit
- stp instance 1 root primary
- stp instance 2 root sec
- [Huawei]ip route-static 0.0.0.0 0.0.0.0 172.16.1.1 preference 1
- //去往任意地方下一跳为10.1.1.10.并且这个静态路由管理距离为1,
- 华为静态路由默认管理距离为60,越小越优先
- ospf 100 router-id 1.1.1.1
- default-route-advertise always //强制通告默认路由
- silent-interface vlanif 10 //把vlan 10的网段通告出去,但是这个接口只发不受hello包
- area 0
- network 192.168.1.0 0.0.0.255
- network 192.168.2.0 0.0.0.255
- [Huawei]display ospf peer brief //查看邻居
- 华为域内,域间路由 管理距离:10 , 重分发的为150
——————————————————————————————————————————————————————
- [FW3]firewall zone trust //g0/0/0接口默认被防火墙放进了trust,则把它从trust区域拿出来
- [FW3-zone-trust]undo add int g0/0/0
- [FW3-zone-trust]q
接口默认被划进了VPN实例,可以给它删除undo
放行接口相关服务(防火墙默认不放行):
- [FW3]int g1/0/1
- [FW3-GigabitEthernet1/0/1]service-manage all permit //放行所有
- [FW3-GigabitEthernet1/0/1]
防火墙zone配置
- [SRG]firewall zone name outside //创建一个新的ZONE
- firewall zone outside //进入到zone
- set priority 1
- add inter GigabitEthernet0/0/0
注意:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。