华三防火墙作为互联网出口常见配置
1.案例分析
在这里插入图片描述这是一个典型的无DMZ区网络,通常发生在业主仅仅只有上外网需求的情况下。
我的规划是:
1.互联网交换机到内网主机这一块区域使用默认vlan1,以方便业主后期上网主机增多的情况。
2.互联网防火墙到互联网交换机之间使用vlan2,互联地址为172.16.0.1和172.16.0.2
3.互联网防火墙和互联网交换机之间使用2层 access 口互联。
4.互联网交换机搭建dhcp服务器,分配地址段172.16.1.1/24 ,网关为172.16.1.254 ,dns地址为114.114.114.114 和 114.114.114.115,使用一天的租期
5.公网地址为100.1.1.1 和100.1.1.2
规划图如下:
2.实战开始:
2.1.配置互联网交换机
2.1.1互联网交换机DHCP功能
dhcp 配置:
------------------------------------------------------------------------------------------------------------------------------
<H3C>sys
#进入系统视图
[H3C]dhcp enable
#启动DHCP服务
[H3C]dhcp server ip-pool 1
#创建DHCP服务地址池1
[H3C-dhcp-pool-1]network 172.16.1.1 mask 255.255.255.0
# 配置DHCP地址池1使用网段172.16.1.0 使用掩码255.255.255.0
[H3C-dhcp-pool-1]gateway-list 172.16.1.254
# 配置DHCP地址池1使用网关地址 172.16.1.254
[H3C-dhcp-pool-1]dns-list 114.114.114.114 114.114.114.115
#配置DHCP地址池1分配dns地址 114.114.114.114 114.114.114.115
[H3C-dhcp-pool-1]expired day 1
#配置DHCP地址池1分配地址租期为1天
[H3C]interface Vlan-interface 1
#进入三层vlan1口
[H3C-Vlan-interface1]ip address 172.16.1.254 24
#配置三层vlan口1使用IP地址:172.16.1.254 使用掩码24位
[H3C-Vlan-interface1]dhcp select server
#配置三层vlan口1 启用DHCP服务器
[H3C-Vlan-interface1]dhcp server apply ip-pool 1
#配置三层vlan口1分配DHCP服务器分配地址池1
[H3C-Vlan-interface1]quit
#退出三层vlan口1
-------------------------------------------------------------------------------------------------------------------------------
2.1.2 互联网交换机互联地址及路由配置
--------------------------------------------------------------------------------------------------------------------------------
[H3C]vlan 2
#创建vlan2
[H3C-vlan2]quit
#退出vlan2
[H3C]interface Vlan-interface 2
#进入三层vlan2口
[H3C-Vlan-interface2]ip address 172.16.0.2 30
#给三层vlan2口配置IP地址172.16.0.2使用掩码长度30位
[H3C-Vlan-interface2]quit
#推出三层vlan2口
[H3C]interface GigabitEthernet 1/0/1
#进入接口千兆以太网1/0/1
[H3C-GigabitEthernet1/0/1]port link-mode bridge
#配置千兆以太网口1/0/1,端口模式位桥接
[H3C-GigabitEthernet1/0/1]port link-type access
#配置千兆以太网口1/0/1,端口链路类型位access
[H3C-GigabitEthernet1/0/1]port access vlan 2
#配置千兆以太网口1/0/1,access端口使用vlan2
[H3C-GigabitEthernet1/0/1]quit
#推出千兆以太网口1/0/1
[H3C]ip route-static 0.0.0.0 0 172.16.0.1
#配置IP静态路由去往所有网段,所有掩码的下一条地址位172.16.0.1
--------------------------------------------------------------------------------------------------------------------------------
2.2 配置防火墙
提示:华三防火墙默认用户名为:admin 密码为:admin
2.2.1 配置接口地址及路由
---------------------------------------------------------------------------------------------------------------------------------
<H3C>sys
#进入系统视图
[H3C]vlan 2
#创建vlan2
[H3C-vlan2]quit
#退出vlan2
[H3C]interface Vlan-interface 2
#进入三层vlan2口
[H3C-Vlan-interface2]ip address 172.16.0.1 30
#给三层vlan2口配置IP地址172.16.0.1使用掩码长度30位
[H3C-Vlan-interface2]quit
#退出三层vlan2口
[H3C]interface GigabitEthernet 1/0/1
#进入接口千兆以太网1/0/1
[H3C-GigabitEthernet1/0/1]port link-mode bridge
#配置千兆以太网口1/0/1,端口模式位桥接
[H3C-GigabitEthernet1/0/1]port link-type access
#配置千兆以太网口1/0/1,端口链路类型位access
[H3C-GigabitEthernet1/0/1]port access vlan 2
#配置千兆以太网口1/0/1,access端口使用vlan2
[H3C-GigabitEthernet1/0/1]quit
#退出千兆以太网口1/0/1
[H3C]ip route-static 172.16.1.0 24 172.16.0.2
#配置IP静态路由去往网段172.16.1.0,子网掩码为24的网络 的下一条地址位172.16.0.2
[H3C]interface Vlan-interface 1
#进入三层vlan1口
[H3C-Vlan-interface1]ip address100.1.1.2 30
#给三层vlan1口配置IP地址172.16.0.1使用掩码长度30位
[H3C-Vlan-interface1]quit
#退出三层vlan1口
[H3C]interface GigabitEthernet 1/0/0
#进入接口千兆以太网1/0/0
[H3C-GigabitEthernet1/0/0]port link-mode bridge
#配置千兆以太网口1/0/0,端口模式位桥接
[H3C-GigabitEthernet1/0/1]port link-type access
#配置千兆以太网口1/0/0,端口链路类型位access
[H3C-GigabitEthernet1/0/0]quit
#退出千兆以太网口1/0/0
[H3C]ip route-static 0.0.0.0 0 100.1.1.1
#配置IP静态路由去往所有网段,所有掩码的下一条地址为100.1.1.1
---------------------------------------------------------------------------------------------------------------------------
2.2.2 配置安全区域及策略
---------------------------------------------------------------------------------------------------------------------------
[H3C]security-zone name Trust
#进入安全区域Trust区域(信任区域)
[H3C-security-zone-Trust]import interface Vlan-interface 2
#在安全区域Trust区域中引入三层vlan2口
[H3C-security-zone-Trust]quit
#退出安全区域Trust区域
[H3C]security-zone name Untrust
#进入安全区域Untrust区域(非信任区域)
[H3C-security-zone-Untrust]import interface Vlan-interface 1
#在安全区域Untrust区域中引入三层vlan1口
[H3C-security-zone-Untrust]quit
#退出安全区域Untrust区域
[H3C]object-group ip address 1
#创建策略对象ip地址组1
[H3C-obj-grp-ip-1]network subnet 172.16.1.1 24
#配置测了对象组1的网段为172.16.1.1 掩码为24位
[H3C-obj-grp-ip-1]quit
#退出策略对象组1
[H3C]object-policy ip nat
#创建ipv4对象策略nat
[H3C-object-policy-ip-nat]rule pass source-ip 1
#配置ipv4对象策略nat ,规则位允许通过源ip位策略对象组1
[H3C-object-policy-ip-nat]quit
#退出ipv4对象策略nat
[H3C]zone-pair security source Trust destination Untrust
#配置从Trust到UnTrust的区域安全
[H3C-zone-pair-security-Trust-Untrust]object-policy apply ip nat
#配置从Trust到UnTrust的区域安全,应用ipv4对象策略nat
------------------------------------------------------------------------------------------------------------------------
3.代码共享
3.1 互联网交换机配置代码
--------------------------------------------------------------------------------------------------------------------------
sys
dhcp enable
dhcp server ip-pool 1
network 172.16.1.1 mask 255.255.255.0
gateway-list 172.16.1.254
dns-list 114.114.114.114 114.114.114.115
expired day 1
interface Vlan-interface 1
ip address 172.16.1.254 24
dhcp server apply ip-pool 1
dhcp select server
quit
vlan 2
quit
interface Vlan-interface 2
ip address 172.16.0.2 30
quit
interface GigabitEthernet 1/0/1
port link-mode bridge
port link-type access
port access vlan 2
quit
ip route-static 0.0.0.0 0 172.16.0.1
-------------------------------------------------------------------------------------------------------------------------
3.2 互联网防火墙代码
-------------------------------------------------------------------------------------------------------------------------
sys
vlan 2
quit
interface Vlan-interface 2
ip address 172.16.0.1 30
quit
interface GigabitEthernet 1/0/1
port link-mode bridge
port link-type access
port access vlan 2
quit
ip route-static 172.16.1.1 24 172.16.0.2
vlan 1
quit
interface Vlan-interface 1
ip add 100.1.1.2 30
quit
interface GigabitEthernet 1/0/0
port link-mode bridge
port link-type access
quit
ip route-static 0.0.0.0 0 100.1.1.1
security-zone name Trust
import interface Vlan-interface 2
security-zone name Untrust
import interface Vlan-interface 1
object-group ip address 1
network subnet 172.16.1.1 24
quit
object-policy ip nat
rule pass source-ip 1
quit
zone-pair security source Trust destination Untrust
object-policy apply ip nat
acl basic 2000
rule permit source 172.16.1.1 0.0.0.255
quit
interface Vlan-interface 1
nat outbound 2000
--------------------------------------------------------------------------------------------------------------------------
原文链接:https://blog.csdn.net/qq_43017750/article/details/87557118