一、向安全域中添加外网接口
security-zone name Untrust 向安全域中添加外网接口 (security-zone安全区 untrust外网)
import interface gigabitethernet1/0/1
import interface gigabitethernet1/0/4
interface gigabitethernet1/0/1
port link-mode route
ip address 147.124.136.55 255.255.255.128
nat outbound 命令用来配置出方向动态地址转换
interface gigabitethernet1/0/4
port link-mode route 将接口定义为路由模式
description guidewan interface (description描述,guide指导,引导,interface界面,接口,连接)
bandwidth 1000000 (bandwidth宽带 聚合后的端口宽带)
ip address 136.142.78.65 255.255.255.252
dns server 114.114.114.114
dns server 8.8.8.8
nat outbound description guidenat (nat outbound(向外出) 命令用来配置出方向动态地址转换guide指导nat)
二、向安全域中添加局域网
security-zone name Trust 向安全域中添加局域网(security安全zone区trust信任,相信 )(Trust区域指的就是可信任的接口,是局域网的接口,这个接口外网和DMZ是没有办法访问的)
import interface GigabitEthernet1/0/3 (import进口)千兆以太网导入接口
import interface GigabitEthernet1/0/7 千兆以太网导入接口
ipterface gigabitethernet1/0/3
port link-mode route 将接口定义为路由模式
ip address 10.10.10.1 255.255.255.252
interface gigabitethernet1/0/7
port link-mode route
description GuideLan Interface (description描述,局域网)
undo dhcp select server 开启dhcp选择服务
三、向安全域中添加management管理
security-zone name Management 向安全域中添加management管理
import interface gigabitethernet1/0/0
import interface gigabitethernet1/0/2
interface GigabitEthernet1/0/0
port link-mode route
ip address 192.168.0.1 255.255.255.0
interface gigabitethernet1/0/2
port link-mode route
ip address 192.168.1.1 255.255.255.0
四、向安全域中添加DMZ
security-zone name DMZ 向安全域中添加DMZ(security安全zone区DMZ非安全系统与安全系统之间的缓冲区)
ip https enable 开启HTTPS服务
undo dhcp select server 开启dhcp选择服务
五、配置静态路由
ip route-static 172.16.100.0 23 10.10.10.2
ip route-static 172.16.100.0 24 10.10.10.2
ip route-static 172.16.200.0 24 10.10.10.2
ip route-static 0.0.0.0 0 147.124.136.1 静态路由
ip route-static 0.0.0.0 0 GigabitEthernet1/0/4 136.142.78.65 静态路由转到以太网口
指定相关相关访问只走联通路线
ip route-static 55.66.0.0 16 147.124.136.1 preference 50 优先级50(preference偏爱,优先) (优先级高 ,因为静态路由的优先级默认是60)
ip route-static 153.142.0.0 147.124.136.1 preference 50 优先级50(preference偏爱,优先) (优先级高 ,因为静态路由的优先级默认是60)
六、端口映射
nat server protocol tcp global 147.124.136.55 7896 inside 10.10.10.1 443 rule ServerRule_4
当访问147.124.136.55 7896 tcp时,实际上访问的是内网10.10.10.1的 443端口。规则:服务器规则4
(protocol 协议 ;global 全球的 ;inside 在…内 ;ServerRule 服务器规则)
nat server protocol tcp global 147.124.136.55 4562 inside 172.16.100.254 443 rule ServerRule_3
服务规则3:当访问147.124.136.55:4562 tcp时,实际上访问的是内网172.16.100.254的443端口。