一、场景说明:
准备调试的防火墙在机房,由于现场配置比较麻烦,所以决定先调测到可以通过核心交换下面的一台跳板机可以访问后在远程调试。
二、拓扑图:
拓扑如下:外网通过箭头1的方向访问到箭头2所指向的跳板机,然后如logo覆盖的箭头3所示在通过跳板机访问与华为9306的互联的H3C防火墙,相关端口、规划IP如图所示。
H3C SecPath F1000-S-AI版本如下:
Comware Software, Version 5.20
注:请忽略拓扑标志都是思科标志,看懂即可。
三、配置过程:
1、开启telnet使能:
System View: return to User View with Ctrl+Z.
[H3C]telnet server enable #开启telnet访问;
2、配置访问连接数和认证方式:
[H3C]user-interface vty 0 4 #进入vty视图;
[H3C-ui-vty0-4]authentication-mode scheme #配置认证方式为用户名、密码访问;
[H3C-ui-vty0-4]quit #退出VTY视图;
3、配置访问用户:
[H3C]local-user admin #进入用户配置视图(也可以创建用户);
[H3C-luser-admin]dis this #查看用户当前配置,如下;
#
local-user admin
password cipher $c$3$owgVrLye7oqSE+DeOvQyxOUxl6eRFdNX
authorization-attribute level 3
service-type telnet
service-type web
#
return
[H3C-luser-admin]password sim (your password) #设置密码;
[H3C-luser-admin]authorization-attribute level 3 #配置使用的命令级别;
[H3C-luser-admin]service-type telnet #配置用户为telnet登录方式;
[H3C-luser-admin]quit #退出用户配置模式;
4、配置访问安全域:
配置的时候这个地方出了点问题,就是加入允许通过的端口时提示错误了,开始以为是链路没有启用的问题结果不是,实际原因下面有讲到。
[H3C]zone name trust #新建安全域名字为trust;
[H3C-zone-trust]import interface GigabitEthernet 0/0 #加入允许的端口;
Error: The interface has been added to another zone. #结果提示出错了;
[H3C-zone-trust]dis this #查看了一下当前配置没问题;
#
zone name Trust id 2
priority 85
ip virtual-reassembly
#
return
[H3C-zone-trust]quit #退出安全域配置视图,先去配置与9306互联的端口;
5、配置管理端口:
因为只是临时配置使用,所以只修改默认的管理端口即可,配置如下:
[H3C]interface GigabitEthernet 0/0 #进入默认管理端口;
[H3C-GigabitEthernet0/0]dis this #查看当前配置;
#
interface GigabitEthernet0/0
port link-mode route
ip address 192.168.0.1 255.255.255.0
#
return
[H3C-GigabitEthernet0/0]ip address 192.168.10.31 255.255.255.0 #修改IP为9306互联的IP;
[H3C-GigabitEthernet0/0]dis this #查看确认修改成功;
#
interface GigabitEthernet0/0
port link-mode route
ip address 192.168.10.31 255.255.255.0
#
return
[H3C-GigabitEthernet0/0]quit #退出端口配置视图;
6、确认链路正常:
去9306上检查与防火墙互联的端口发现shutdown了,取消shutdown,在看防火墙的端口提示互联的端口已经开启了,防火墙自己ping管理端口的IP已经通了。
[H3C]
%Feb 21 08:57:37:922 2017 H3C IFNET/3/LINK_UPDOWN: GigabitEthernet0/0 link status is UP.
%Feb 21 08:57:37:923 2017 H3C IFNET/5/LINEPROTO_UPDOWN: Line protocol on the interface GigabitEthernet0/0 is UP.
[H3C]ping 192.168.10.31
PING 192.168.10.31: 56 data bytes, press CTRL_C to break
Reply from 192.168.10.31: bytes=56 Sequence=0 ttl=255 time=1 ms
Reply from 192.168.10.31: bytes=56 Sequence=1 ttl=255 time=1 ms
Reply from 192.168.10.31: bytes=56 Sequence=2 ttl=255 time=1 ms
Reply from 192.168.10.31: bytes=56 Sequence=3 ttl=255 time=1 ms
Reply from 192.168.10.31: bytes=56 Sequence=4 ttl=255 time=1 ms
--- 192.168.10.31 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 1/1/1 ms
7、继续配置安全域及问题处理:
以为这个时候配置安全域,加入允许通过的端口已经可以了,但是还是提示上面开始配置时的提示;
[H3C]zone name trust
[H3C-zone-trust]import interface GigabitEthernet 0/0
Error: The interface has been added to another zone.
检查配置发现Management的安全域已经配置了通过的端口;
[H3C]dis cur #查看当前所有配置的命令;
zone name Management id 0
priority 100
import interface GigabitEthernet0/0
zone name Local id 1
priority 100
zone name Trust id 2
priority 85
zone name DMZ id 3
priority 50
zone name Untrust id 4
priority 5
进入Management安全域,将配置删掉;
[H3C-zone-trust]zone name Management #进入到安全域;
[H3C-zone-Management]undo import interface GigabitEthernet 0/0 #删除有关0/0端口的配置;
[H3C-zone-Management]dis this #查看确认配置已经删除;
#
zone name Management id 0
priority 100
ip virtual-reassembly
#
return
删除上面的配置后,配置新的安全域允许通过的端口不在提示错误了。
[H3C-zone-Management]zone name trust #进入新建安全域;
[H3C-zone-trust]import interface GigabitEthernet 0/0 #添加配置;
[H3C-zone-trust]quit #退出安全域配置;
8、添加一条到9306的默认路由配置,并检查到9306是否已经互通;
[H3C]ip route-static 0.0.0.0 0.0.0.0 192.168.10.254 #添加到0306的路由配置;
[H3C]ping 192.168.10.254 #检查到9306还是不通;
PING 192.168.10.254: 56 data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
Request time out
--- 192.168.10.254 ping statistics ---
5 packet(s) transmitted
0 packet(s) received
100.00% packet loss
[H3C]interzone policy default by-priority #添加一条域间访问策略;
[H3C]ping 192.168.10.254 #测试访问还是不通;
PING 192.168.10.254: 56 data bytes, press CTRL_C to break
Request time out
Request time out
Request time out
Request time out
Request time out
--- 192.168.10.254 ping statistics ---
5 packet(s) transmitted
0 packet(s) received
100.00% packet loss
9、检查互联端口配置解决问题:
检查一下与9306互联端口的配置发现9306的端口没有配置透传的vlan,9306上给端口添加上vlan,在检查就通了。
[H3C]ping 192.168.10.254
PING 192.168.10.254: 56 data bytes, press CTRL_C to break
Reply from 192.168.10.254: bytes=56 Sequence=0 ttl=255 time=2 ms
Reply from 192.168.10.254: bytes=56 Sequence=1 ttl=255 time=6 ms
Reply from 192.168.10.254: bytes=56 Sequence=2 ttl=255 time=4 ms
Reply from 192.168.10.254: bytes=56 Sequence=3 ttl=255 time=3 ms
Reply from 192.168.10.254: bytes=56 Sequence=4 ttl=255 time=2 ms
--- 192.168.10.254 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 2/3/6 ms
10、退出保存配置:
[H3C]quit #退出配置视图模式;
The current configuration will be written to the device. Are you sure? [Y/N]:y
Please input the file name(*.cfg)[flash0:/startup.cfg]
(To leave the existing filename unchanged, press the enter key):
Validating file. Please wait....
Configuration is saved to device successfully.
11、远程telnet访问确认访问正常;
CRT创建一个telnet会话访问该防火墙,已经可以访问,输入用户名、密码后登录也正常。确认配置完成。
实现后的总结:
本人对网络设备配置基本处于小白状态,所以本次配置其实走了一点弯路好在及时发现问题并解决了问题。通过本次配置发现在配置网络设备之前,对于设备现有的配置做一个了解,做到心中架构清晰,配置起来才能针对问题处理。同时在配置之前确认要实现的目的使用那些命令,有助于在配置过程中事半功倍。
文章为个人配置过程的整理,如有不正之处,敬请指出。