PIX515防火牆配置策略實例(二)

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

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章