• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.
Xin chào ! Nếu đây là lần đầu tiên bạn đến với diễn đàn, xin vui lòng danh ra một phút bấm vào đây để đăng kí và tham gia thảo luận cùng VnPro.

Announcement

Collapse
No announcement yet.

step by step : Cấu hình PIX firewall

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • step by step : Cấu hình PIX firewall

    How to Configure PIX Firewall.
    Abstract:

    Please find below a step by step process to configure the PIX Firewall from scratch. A simple scenario is given here where you have a corporate network with a PIX Firewall connected to the Internet through the Outside Interface, Internal Network through the Inside interface and DMZ through the DMZ Network. This paper would assist you in a simple step by step, near complete configuration for a PIX Firewall running a midsized corporate network
    The Outside Network is connected to the internet through a Internet Router. The Inside Network is connected to a switch to the Internal Clients or Inside Hosts. The DMZ network consists of two servers, the Web server and the WEB server.
    Note: An effort has been made to keep this paper as simple as possible for the newbies. Much theory is not covered as you have numerous sites on the internet from where you can read that stuff.. Referral Links are given from time to time for more detailed configuration from Cisco website for Reference purpose.
    A Simple Network Diagram




    The first thing in configuration is getting connected to the pix firewall. You use the console cable to connect the cable to the console port of the pix firewall. The other end goes to the serial port of your computer. You can then use a terminal emulation software to get connected to the prompt. For Windows users, HyperTerminal is a good option.
    The next step is booting the Firewall.
    When a non-configured PIX Firewall boots up, it prompts to preconfigure it through interactive prompts. If you press Enter to accept the default answer of yes, you are presented with a series of prompts that lead you through the basic configuration steps:
    Code:
    Pre-configure PIX Firewall now through
    interactive prompts [yes]? Enable Password []: abc123
     Clock (UTC)
      Year [2002]:
      Month [Aug]:
      Day [2]: 12
      Time [2:45:37]: 12:22:00
    Inside IP address: 10.1.1.1
    Inside network mask: 255.255.255.0
    Host name: pixfirewall
    Domain name: secmanager.com
    IP address of host running
    PIX Device Manager: 101.1.111
    Use this configuration and write to flash? Y
    The above can also be achieved by entering the setup command in privileged mode. The pix Firewall has four modes of Operation as given below:
    • Unprivileged mode: This mode provides a restricted, limited, view of PIX Firewall settings. Example : pixfirewall>
    • Privileged mode: This mode enables you change the current firewall settings. Example: pixfirewall#
    • Configuration mode: This mode enables you to change the system configurations of the firewall. Example pixfirewall(config)#
    • Monitor mode: This mode is used to update the image over the network, perform password recovery or backup the configuration onto the TFTP server
    In case you don’t want to use the setup command for the configuration, you can use the console connection and configure as follows:
    Priveleged mode
    The first step is to enter the privileged mode:
    Code:
    Pixfirewall> en
    Password: (Enter or Cisco, for more information refer to the configuration manuals that came with the firewall)
    Pixfirewall#
    Changing password
    The next step is to change the enable password on the firewall:
    Code:
    Pixfirewall# enable password abc123
    The next step is to enter the configuration mode for changing the system configurations. To enter the config mode, enter the following command:
    Code:
    Pixfirewall# configure terminal (or popularly conf t)
    Pixfirewall (config) #
    Give a Hostname to the firewall.
    You might want to give a hostname to the firewall. You can use the hostname command to do this.
    Code:
    Pixfirewall (config) #hostname CorpFW1
    CorpFW1(config)#
    To save the information, use the write memory command or simply wr mem.
    Code:
    CorpFW1(config)# write memory
    For purposes of this document, we continue to give the firewall the name “Pixfirewall”. So let us change the name back to Pixfirewall
    Code:
    CorpFW1(config)# hostname Pixfirewall
    Pixfirewall (config) # wr mem
    Setup the console timeout:
    Next, you might want to setup the console timeout for security reasons. The default timeout is 0, which means unlimited.
    Code:
    Pixfirewall (config) # console timeout 5
    This means you have setup a console timeout of 5 minutes ( the value can be set from 0-60 minutes) which means after a idle time of 5 minutes, the session will be closed.
    Setup a banner to your Pix firewall.
    You can do this with the banner command:
    Code:
    Pixfirewall (config) # banner exec Unauthorized access will be prosecuted.
    There are also two other commands available:
    Code:
    banner login
    banner motd
    To remove banner you use the no banner or clear banner commands.
    Naming an Interface:
    The first two interfaces would have the default names of inside and outside. While inside interface has a security level of 100, the outside interface has a default security level of 0.
    Let us configure the Ethernet 2 interface as the dmz.
    Code:
    Pixfirewall (config) # nameif ethernet2 dmz sec60
    In this example, we are assigning a security_level of 60 to the DMZ network.
    Configure the Interface:
    Now let us turn the interface on and configure the speeds for these interfaces:
    Code:
    Pixfirewall (config) # interface ethernet0 100full
    Pixfirewall (config) #interface ethernet1 100full
    Pixfirewall (config) #interface ethernet2 100full
    Assign IP Address to the Interface:
    Code:
    Pixfirewall (config) # ip address outside 192.168.1.1 255.255.255.0
    Pixfirewall (config) # ip address inside 10.1.1.1 255.255.255.0
    Pixfirewall (config) #ip address dmz 172.16.16.1 255.255.255.0
    You can use the “show ip” command to view the ip address information and “clear ip” command to remove all assigned IP addresses from all interfaces.
    Route Commands:
    Now let us setup the routing information on the pix firewall.
    This is the default route, where we are configuring the next hop of the default route to the IP address of the Internet Router which is 192.168.1.100
    Code:
    Pixfirewall (config) # route outside 0.0.0.0 0.0.0.0 192.168.1.100 1
     Pixfirewall (config) # route inside 10.0.0.0 255.0.0.0 10.1.1.1 1
     Pixfirewall (config) # route dmz 172.16.17.0 255.255.255.0 172.16.16.1 1
    So using these route commands you are telling the PIX router that route the traffic for 10.0.0.0/8 network to inside, 172.16.17.0/24 network to dmz. The default route is set for outside, which means for all other networks, route the traffic through the outside interface.
    Be continued!!!

    Have fun !!!
    Trần Mỹ Phúc
    tranmyphuc@hotmail.com
    Hãy add nick để có thông tin đề thi mới nhất :tranmyphuc (Hỗ trợ tối đa cho các bạn tự học)

    Cisco Certs : CCNP (Passed TSHOOT 1000/1000)

    Juniper Certs :
    JNCIP-ENT & JNCIP-SEC
    INSTRUCTORS (No Fee) : CISCO (Professional) , JUNIPER (Professional) , Microsoft ...

    [version 4.0] Ôn tập CCNA



  • #2
    Continue pls, thank you. :P

    Have fun!
    Att ~¿ 21°00.00N , HCMC

    Comment


    • #3
      How to Configure Cisco PIX Firewall Part II


      Please find below a step by step process to configure the PIX Firewall from scratch. A simple scenario is given here where you have a corporate network with a PIX Firewall connected to the Internet through the Outside Interface, Internal Network through the Inside interface and DMZ through the DMZ Network. This paper would assist you in a simple step by step, near complete configuration for a PIX Firewall running a midsized corporate network

      This is part II of the How to Configure Pix Firewall, a step by step approach.
      This is in continuation of the Part I of the series
      A Simple Network Diagram




      Network Address Translation:
      Let us take a simple scenario to explain this section. Let us say that all the computers in the inside network want internet access. NAT also allows you to keep your internal IP hidden from the outside network. To achieve this you need to implement address translation. You do this using the “nat” and “global” commands.


      The NAT command:
      Code:
      Pixfirewall (config) # nat (inside) 1 0.0.0.0 0.0.0.0
      In this example, the nat (inside) 1 10.0.0.0 255.255.255.0 command means that all outbound connections from a host within the specified network, 10.1.1.0, can pass through the PIX Firewall (with address translation).


      Global command:
      Code:
      Pixfirewall (config) #global (outside) 1 192.168.1.10-192.168.1.50
      This means that use the IP address from 192.168.1.10 to 192.168.1.50 for NATing the traffic coming from the inside interface.
      There is also another simple way for allowing internet /outside access to the inside network using PAT or port address translation. What this would do is hide all the internal networks behind the outside interface of the PIX firewall and transmit traffic using Port Address Translation. One limitation to this approach is that at a time it can process only less than 64000 client computers. But in most cases, this is more than enough.


      PAT using Global:
      Code:
      Pixfirewall (config) # global (outside) 1 interface
      Now, let us configure the two servers in the dmz network, the webserver and the mailserver. The wish list is to allow traffic from anywhere to reach the webserver on http, https and ftp and traffic from anywhere to reach the mail server on the smtp port.
      To do this we need to setup statics and access-lists.


      Setting up Static’s:
      Code:
      Pixfirewall (config) #static (dmz,outside) 192.168.1.2 172.16.16.2 netmask 255.255.255.255 0 0
       Pixfirewall (config) # static (dmz,outside) 192.168.1.4 172.16.16.4 netmask 255.255.255.255 0 0
      Having configured the statics, now let us move on to configure the object-groups that would be used in configuring the access-list


      Configuring object-groups:
      Code:
      Pixfirewall (config) #object-group service webservices tcp
      Pixfirewall (config-service) # port-object eq http
      Pixfirewall (config-service) # port-object eq https
      Pixfirewall (config-service) # port-object eq ftp
      Pixfirewall (config-service) # exit
       Pixfirewall (config) #
      Now let us configure the access-lists to allow access to the dmz networks from outside and also to the other interfaces:


      Configuring Access-list:
      Code:
      Pixfirewall (config) # access-list external permit tcp any host 192.168.1.2 object-group webservices
       Pixfirewall (config) # access-list external permit tcp any host 192.168.1.4 eq smtp.
       Pixfirewall (config) #access-list external deny ip any any
      (This is a any any drop rule. Place this at the end of the access-lists. This acl won’t allow any other traffic that is not explicitly allowed to get into the firewall. This is often helpful in checking the number of hits on this acl from outside for troubleshooting or analysis purposes.)
      Code:
      Pixfirewall (config) #access-list internal permit ip 172.16.16.0 255.255.255.0 10.1.1.0 255.255.255.0
       Pixfirewall (config) # access-list internal deny ip any any 
       Pixfirewall (config) # access-list dmz permit ip 10.1.1.0 255.255.255.0 172.16.16.0 255.255.255.0
       Pixfirewall (config) #access-list dmz deny ip any any
      Now map these access-lists to access-groups for these access-lists to work properly:


      Configuring Access Groups:
      Code:
      Pixfirewall (config) #access-group external in interface outside
      Pixfirewall (config) # access-group internal in interface inside
      Pixfirewall (config) #access-group dmz in interface ethernet2
      With this we have configured the PIX firewall for a normal office setup.
      These commands will be helpful in checking the configuration of the pix firewall and also in troubleshooting, analysis and fine tuning.
      Useful Commands:
      Code:
      [LEFT][B][COLOR=Red]show config[/COLOR][/B][/LEFT]
      [CENTER] 
      [B][COLOR=Red]show blocks [/COLOR][/B]
       
      [B][COLOR=Red]show checksum[/COLOR][/B]
       
      [B][COLOR=Red]show conn[/COLOR][/B]
       
      [B][COLOR=Red]show cpu usage[/COLOR][/B]
       
      [B][COLOR=Red]show history[/COLOR][/B]
       
      [B][COLOR=Red]show memory[/COLOR][/B]
       
      [B][COLOR=Red]show processes[/COLOR][/B]
       
      [B][COLOR=Red]show routing[/COLOR][/B]
       
      [B][COLOR=Red]show running-config[/COLOR][/B]
       
      [B][COLOR=Red]show startup-config[/COLOR][/B]
       
      [B][COLOR=Red]show tech-support[/COLOR][/B]
       
      [B][COLOR=Red]show tcpstat[/COLOR][/B]
       
      [B][COLOR=Red]show traffic[/COLOR][/B]
       
      [B][COLOR=Red]show uauth/clear uauth[/COLOR][/B]
       
      [B][COLOR=Red]show version[/COLOR][/B]
       
      [B][COLOR=Red]show xlate/clear xlate[/COLOR][/B]
      [B][COLOR=Red][/COLOR][/B][/CENTER]
      Note: There is a lot that you can do with the PIX firewall. This document is just a simple guide for a easy setup. It covers most popular setups. In case you need any further information please refer to Cisco website at http://www.cisco.com


      Further reference:
      You can also refer to the Getting Started document for more detailed information from the Cisco Website:
      Cisco offers a wide range of products and networking solutions designed for enterprises and small businesses across a variety of industries.

      Cisco PIX Firewall Command Reference, version 6.3
      Cisco offers a wide range of products and networking solutions designed for enterprises and small businesses across a variety of industries.


      completed !!!
      Chúc mọi người vui !!!
      Trần Mỹ Phúc
      tranmyphuc@hotmail.com
      Hãy add nick để có thông tin đề thi mới nhất :tranmyphuc (Hỗ trợ tối đa cho các bạn tự học)

      Cisco Certs : CCNP (Passed TSHOOT 1000/1000)

      Juniper Certs :
      JNCIP-ENT & JNCIP-SEC
      INSTRUCTORS (No Fee) : CISCO (Professional) , JUNIPER (Professional) , Microsoft ...

      [version 4.0] Ôn tập CCNA


      Comment


      • #4
        Hi,
        Bạn có thể giải thích câu lệnh 'static(dmz,outside)' và nhiệm vụ các accesslist sau đó không ạ?

        Cảm ơn nhiều.

        Comment


        • #5
          chào 1!!

          3.PIX firewall translation
          PIX firewall có thể được sử dụng để translate tất cả địa chỉ bên trong , khi dữ liệu đi từ inside ra outside hay đi đến một mạng có mức security thấp hơn . Nếu user ở mạng outside cố gắng thực hiện kết nối đến inside , user đó sẽ không thành công . Một session không thể được tạo ra từ Internet với địa chỉ đích là địa chỉ private trừ khi nó được cấu hình cho phép thực hiện điều đó .

          Có hai cách để một mạng ít tin cậy hơn đi vào một mạng có độ tin cậy cao hơn là :
          -Response to Valid Request : Khi user ở inside thành lập một kết nối đến thiết bị ở outside , mặc định response cho request đó được phép qua pix . Tất cả kết nối từ inside đến outside sẽ được update trong bảng translation . Khi một thiết bị outside đáp ứng cho request đó , PIX firewall sẽ kiểm tra bảng translation để xem thử có translation slot nào tồn tại cho request đó hay không ? Nếu nó tồn tại, PIX firewall cho phép response tiếp tục . Sau khi session được tạo ra , idle timer sẽ bắt đầu khởi động , mặc định là 3 giờ .
          -Cấu hình Conduit : Được sử dụng cho việc liên lạc từ outside đến inside . Static translation hoặc là global và nat được cấu hình trước , sau đó cấu hình conduit để định nghĩa địa chỉ , hay là một nhóm địa chỉ , source port hay là destination port được phép đi qua pix .

          a.Static address translation :
          Static address translation được sử dụng nếu một host được translate đến cùng một địa chỉ khi mỗi outbound session được tạo ra qua pix . Tức là nó được dùng để tạo ra một ánh xạ cố định (static translation slot) giữa một địa chỉ local và một địa chỉ global . Khi kết nối đến internet , địa chỉ global phải được phải là địa chỉ thực ( địa chỉ được đăng kí )

          Static address translation được sử dụng bằng câu lệnh sau :
          Static [(internal_if_name , external_if_name)] global_ip local_ip [netmask network_mask] [max_conns [em_limit]] [norandomseq]

          Đối với outbound connection , sử dụng static để chỉ ra một địa chỉ global luôn được sử dụng cho việc translation giữa local host và global host đó . Đối với inbound connection , mặc định là các host ở untrusted network sẽ không được vào trusted network , do đó muốn cho các mạng outside vào inside , ta sẽ phải sử dụng kết hợp cả static command và conduit command để định nghĩa các địa chỉ trong mạng outside .
          Một chú ý quan trọng là :
          oConduit command cho phép kết nối từ interface có mức bảo mật thấp hơn đến interface có mức bảo mật cao hơn .
          oStatic command được sử dụng để tạo ra ánh xạ cố định giữa local host và global ip address .


          From : http://www.chuyenviet.com/html/articles/pix2.html


          CHúc bạn vui !!!
          Trần Mỹ Phúc
          tranmyphuc@hotmail.com
          Hãy add nick để có thông tin đề thi mới nhất :tranmyphuc (Hỗ trợ tối đa cho các bạn tự học)

          Cisco Certs : CCNP (Passed TSHOOT 1000/1000)

          Juniper Certs :
          JNCIP-ENT & JNCIP-SEC
          INSTRUCTORS (No Fee) : CISCO (Professional) , JUNIPER (Professional) , Microsoft ...

          [version 4.0] Ôn tập CCNA


          Comment


          • #6
            Mình sd GNS3 cấu hình xong, mình test mô hình này như thế nào? làm sao để mô phỏng serverWeb, mail, truy cập từ bên ngoài vào các server này để kiểm tra là fw đã cấu hình tốt.
            Cuộc đời như gió như ngàn cơn sóng, khi buồn khi vui.

            Comment


            • #7
              Để mô phỏng web server thì có thể lấy một router, bật chức năng web:

              Router#ip http server

              Để bật HTTPS:

              Router#ip http secure-server

              Router cũng có thể mô phỏng trong GNS3.
              Đặng Quang Minh, CCIEx2#11897 (Enterprise Infrastructure, Wireless), DEVNET, CCSI#31417

              Email : dangquangminh@vnpro.org
              https://www.facebook.com/groups/vietprofessional/

              Comment


              • #8
                các version mới của PIX bây giờ không sử dụng lệnh conduit để cho phép từ outside-->inside, mà chỉ dùng Static NAT và ACL phải không anh????

                Comment


                • #9
                  Trong trường hợp có PIX nối với các Switch L3 thì nhiệm vụ định tuyến giữa các VLAN mình nên để đồng chí nào thực hiện và cấu hình như thế nào nhỉ? Giả sử như mình muốn ngăn một số VLAN không qua được các VLAN khác, số còn lại thì vẫn thông bình thường thì sẽ phải làm thế nào?

                  Comment


                  • #10
                    Minh nghi la
                    - cau hinh truc tiep acl tren swlayer3
                    - hoac co the tren firewall fix
                    ------------###----------------###----------------
                    Nguyễn Mạnh Hùng
                    CCNA, ---> try ..CCNP: .....Please loading
                    Email : sirmanhhung@yahoo.com
                    nmhung@vasc.com.vn

                    Tiền bạc :68: vần đề là bao nhiêu ;)
                    Vật chất :78:

                    Comment


                    • #11
                      Chào các anh chị!

                      Originally posted by tranmyphuc View Post
                      chào 1!!

                      3.PIX firewall translation
                      PIX firewall có thể được sử dụng để translate tất cả địa chỉ bên trong , khi dữ liệu đi từ inside ra outside hay đi đến một mạng có mức security thấp hơn . Nếu user ở mạng outside cố gắng thực hiện kết nối đến inside , user đó sẽ không thành công . Một session không thể được tạo ra từ Internet với địa chỉ đích là địa chỉ private trừ khi nó được cấu hình cho phép thực hiện điều đó .

                      Có hai cách để một mạng ít tin cậy hơn đi vào một mạng có độ tin cậy cao hơn là :
                      -Response to Valid Request : Khi user ở inside thành lập một kết nối đến thiết bị ở outside , mặc định response cho request đó được phép qua pix . Tất cả kết nối từ inside đến outside sẽ được update trong bảng translation . Khi một thiết bị outside đáp ứng cho request đó , PIX firewall sẽ kiểm tra bảng translation để xem thử có translation slot nào tồn tại cho request đó hay không ? Nếu nó tồn tại, PIX firewall cho phép response tiếp tục . Sau khi session được tạo ra , idle timer sẽ bắt đầu khởi động , mặc định là 3 giờ .
                      -Cấu hình Conduit : Được sử dụng cho việc liên lạc từ outside đến inside . Static translation hoặc là global và nat được cấu hình trước , sau đó cấu hình conduit để định nghĩa địa chỉ , hay là một nhóm địa chỉ , source port hay là destination port được phép đi qua pix .

                      a.Static address translation :
                      Static address translation được sử dụng nếu một host được translate đến cùng một địa chỉ khi mỗi outbound session được tạo ra qua pix . Tức là nó được dùng để tạo ra một ánh xạ cố định (static translation slot) giữa một địa chỉ local và một địa chỉ global . Khi kết nối đến internet , địa chỉ global phải được phải là địa chỉ thực ( địa chỉ được đăng kí )

                      Static address translation được sử dụng bằng câu lệnh sau :
                      Static [(internal_if_name , external_if_name)] global_ip local_ip [netmask network_mask] [max_conns [em_limit]] [norandomseq]

                      Đối với outbound connection , sử dụng static để chỉ ra một địa chỉ global luôn được sử dụng cho việc translation giữa local host và global host đó . Đối với inbound connection , mặc định là các host ở untrusted network sẽ không được vào trusted network , do đó muốn cho các mạng outside vào inside , ta sẽ phải sử dụng kết hợp cả static command và conduit command để định nghĩa các địa chỉ trong mạng outside .
                      Một chú ý quan trọng là :
                      oConduit command cho phép kết nối từ interface có mức bảo mật thấp hơn đến interface có mức bảo mật cao hơn .
                      oStatic command được sử dụng để tạo ra ánh xạ cố định giữa local host và global ip address .


                      From : http://www.chuyenviet.com/html/articles/pix2.html


                      CHúc bạn vui !!!
                      em có mô hình mạng thế này mong các bác chỉ giúp

                      Click image for larger version

Name:	mang.jpg
Views:	1
Size:	43.5 KB
ID:	205779
                      Nhờ các bác chỉ giúp cho câu lệnh public mail và web ra ngoài internet. Mong các cao thủ giúp đỡ

                      Comment


                      • #12
                        Cho mình hỏi cách copy running-config để thay thế startup-config, trong cisco router thông thường thì cho phép lệnh này còn trong Cisco Pix 506 thì ko thể thực hiện nó

                        Comment

                        Working...
                        X