需求:想通過pix做snat使內(nèi)網(wǎng)用戶上網(wǎng),再做dnat使訪問本公網(wǎng)IP的http服務(wù)、ssh服務(wù)轉(zhuǎn)換為192.168.4.2的http服務(wù)、ssh服務(wù),對192.168.4.2開放本pix的telnet服務(wù)
pix515防火墻配置策略實例
#轉(zhuǎn)換特權(quán)用戶
pixfirewall>ena
pixfirewall#
#進(jìn)入全局配置模式
pixfirewall# conf t
#激活內(nèi)外端口
interface ethernet0 auto
interface ethernet1 auto
#下面兩句配置內(nèi)外端口的安全級別
nameif ethernet0 outside security0
nameif ethernet1 inside security100
#配置防火墻的用戶信息
enable password pix515
hostname pix515
domain-name domain
#下面幾句配置內(nèi)外網(wǎng)卡的IP地址
ip address inside 192.168.4.1 255.255.255.0
ip address outside 公網(wǎng)IP 公網(wǎng)IP子網(wǎng)掩碼
global (outside) 1 interface
nat (inside) 1 192.168.4.0 255.255.255.0 0 0
#下面兩句將定義轉(zhuǎn)發(fā)公網(wǎng)IP的ssh和www服務(wù)到192.168.4.2
static (inside,outside) tcp 公網(wǎng)IP www 192.168.4.2 www netmask 255.255.255.255 0 0
static (inside,outside) tcp 公網(wǎng)IP ssh 192.168.4.2 ssh netmask 255.255.255.255 0 0
#下面兩句將定義外部允許訪問內(nèi)部主機(jī)的服務(wù)
conduit permit tcp host 公網(wǎng)IP eq www any
conduit permit tcp host 公網(wǎng)IP eq ssh 信任IP 255.255.255.255
#允許內(nèi)部服務(wù)器telnet pix
telnet 192.168.4.2 255.255.255.0 inside
#下面這句允許ping
conduit permit icmp any any
#下面這句路由網(wǎng)關(guān)
route outside 0.0.0.0 0.0.0.0 公網(wǎng)IP網(wǎng)關(guān) 1
#保存配置
write memory


