Pages

Showing posts with label Juniper. Show all posts
Showing posts with label Juniper. Show all posts

Firewall Filter (ACL)

Creating a Firewall filter

 - Enter into firewall filter mode by creating a filter with name filter1
 - Configure the match-condition that permit traffic from address 192.168.10.5, and block all other traffic by creating a term by name term1.
- Create term by name term2 that blocks only the single IP address 196.145.25.5
- Create a term by name term3 that allows traffic from any ip address.

user@R1>configure
[edit]
user@R1#edit firewall family inet filter filter1
[edit firewall family inet filter filter1]
user@R1#set term term1 from source-address 192.168.10.5/24
[edit firewall family inet filter filter1]
user@R1#set term term1 then accept
[edit firewall family inet filter filter1]
user@R1#set term term2 from source-address 196.145.25.5/24
[edit firewall family inet filter filter1]
user@R1#set term term2 then reject
[edit firewall family inet filter filter1]
user@R1#set term term3 then accept
[edit firewall family inet filter filter1]
user@R1#exit
[edit]

Applying firewall filter to an interface


user@R1#edit interfaces so-0/0/0 unit 0 family inet
[edit interfaces so-0/0/0 unit 0 family inet]
user@R1#set filter input filter1
[edit interfaces so-0/0/0 unit 0 family inet]
user@R1#exit
[edit]
user@R1#show

Configuring static routes

Configure a static route with destination sub-network number as 172.16.1.0, subnet mask as 24 and IP address of the next-hop router in the destination path to 172.16.2.1.

user@R1>configure
[edit]
user@R1#edit routing-options
[edit routing-options]
user@R1#edit static route 172.16.1.0/24
[edit routing-options static route 172.16.1.0/24]
user@R1#set next-hop 172.16.2.1
[edit routing-options static route 172.16.1.0/24]
user@R1#exit
[edit routing-options]
user@R1#exit
[edit]
user@R1#

Basic command on router juniper (Lệnh cơ bản Juniper)

          1.      Entering configuration mode on a Router, and exit

           user@R1>configure
           [edit]
           user@R1#exit
           user@R1>

          2.      Setting host name
user@R1>configure
[edit]
user@R1#edit system
[edit system]
user@R1#set host-name juniper1
[edit system]
user@R1#exit
[edit]
user@R1#exit

           3.      Configuring the Root Password (encrypted password)
            user@R1>configure
           [edit]
           user@R1#edit system root-authentication
           [edit system root-authentication ]
           user@R1#set encrypted-password 24adr3e
           [edit system root-authentication ]
           user@R1#exit
           [edit]
           user@R1#

4.      Configuring DNS Name Server

user@R1>configure
[edit]
user@R1#edit system
[edit system]
user@R1#set name-server 192.168.1.11
[edit system]
user@R1#exit
[edit]
user@R1#

5.      Configuring Backup Router

user@R1>configure
[edit]
user@R1#edit system
[edit system]
user@R1#set backup-router 172.16.1.2
[edit system]
user@R1#exit
[edit]
user@R1#

6.      Router Interface Address Configuration

user@R1>configure
[edit]
user@R1#edit interfaces so-1/1/0
[edit interfaces so-1/1/0]
user@R1#edit unit 0 family inet
[edit interfaces so-1/1/0 unit 0 family inet]
user@R1#set address192.168.2.1 /24
[edit interfaces so-1/1/0 unit 0 family inet]
user@R1#exit
[edit interfaces so-1/1/0]
user@R1#exit
[edit]
user@R1#

7.      Shutdown an interface

user@R1>configure
[edit]
user@R1#edit interfaces so-0/0/0
[edit interfaces so-0/0/0]
user@R1#set disable
[edit interfaces so-0/0/0]
user@R1#exit
[edit]
user@R1#

8.      Set interface description

user@R1>configure
[edit]
user@R1#edit interfaces so-0/0/0
[edit interfaces so-0/0/0]
user@R1#set description "interface-so-0/0/0"
[edit interfaces so-0/0/0]
user@R1#exit
[edit]
user@R1#

9.      Configuring the Encapsulation on a Physical Interface

user@R1>configure
[edit]
user@R1#edit interfaces so-0/0/0
[edit interfaces so-0/0/0]
user@R1#set encapsulation ppp
[edit interfaces so-0/0/0]
user@R1#exit
[edit]
user@R1#

10.  Setting bandwidth on an interface

Set bandwidth of so-0/0/0 unit 0 as 1000k

 

 

 



Setting up IDP on the Juniper SRX

Trước khi thực hiện: SRX cần ra được Internet, cấu hình DNS


Intrusion Detection Prevention (IDP); or sometimes known as IPS, is a feature of the Juniper SRX range. IDP is available on the branch SRX’s all the way through to the datacentre versions and is a fantastic item under the IT Services feature set. IDP is particularly useful as another layer of security to inspect data transmissions between client and server and perform an actions upon it, a good example is IDP’s ability to detect known Shell code buffer overflow exploits that are out there in the wild and stop them in their tracks AND also block that IP for set period of time, like 1 hour, 1 day or a week! These buffer overflow style attacks are typically launched at a server once traditional enumeration steps have been performed by the remote attacker. To thwart the enumeration attacks juniper makes use of SCREENS, but that is a discussion for another time.
so how do we configure an SRX for IDP?
Step by Step IDP configuration
The first thing you do is tell the Juniper were to get the latest packages for the IDP updates from

root@iLab.SRX#set security idp security-package url https://services.netscreen.com/cgi-bin/index.cgi
root@iLab.SRX#commit
Next we download the packages to the device, first checking that the we can see the update server, the actually downloading the packages
root@iLab.SRX> request security idp security-package download check-server
Download is already in progress..

root@iLab.SRX> request security idp security-package download
Download is already in progress..
you can monitor the status of the IDP package download with the following command, just keep checking the status until you get the completed notification
root@iLab.SRX> request security idp security-package download status    
In progress: Downloading ..

Check again;
root@iLab.SRX> request security idp security-package download status   
Done;Successfully downloaded from(https://services.netscreen.com/cgi-bin/index.cgi).
Version info:2946(Thu Jul  6 01:10:33 2017 UTC, Detector=12.6.130170603)

Once the download of the IDP definitions is complete we install those definitions

root@iLab.SRX> request security idp security-package install
Will be processed in async mode. Check the status using the status checking CLI

check status: 
root@iLab.SRX> request security idp security-package install status
In progress:performing DB update for an xml (SignatureUpdate.xml)

check again;
root@iLab.SRX> request security idp security-package install status   
Done;Attack DB update : successful - [UpdateNumber=2946,ExportDate=Thu Jul  6 01:10:33 2017 UTC,Detector=12.6.130170603]
     Updating control-plane with new detector : successful
     Updating data-plane with new attack or detector : not performed
      due to no active policy configured.

Get policy templates;
root@iLab.SRX> request security idp security-package download policy-templates
Will be processed in async mode. Check the status using the status checking CLI

root@iLab.SRX> request security idp security-package download status 
Done;Successfully downloaded from(https://services.netscreen.com/cgi-bin/index.cgi).
Version info:2946

Install policy templates

root@iLab.SRX>request security idp security-package install policy-templates                    
Will be processed in async mode. Check the status using the status checking CLI

root@iLab.SRX> request security idp security-package install status 
Done;policy-templates has been successfully updated into internal repository
     (=>/var/db/scripts/commit/templates.xsl)!

Here is the results
root@iLab.SRX# set security idp idp-policy ?
Possible completions:
  <policy-name>        IDP policy name
  Client-And-Server-Protection  IDP policy name
  Client-And-Server-Protection-1G  IDP policy name
  Client-Protection    IDP policy name
  Client-Protection-1G  IDP policy name
  DMZ_Services         IDP policy name
  DNS_Service          IDP policy name
  File_Server          IDP policy name
  Getting_Started      IDP policy name
  IDP_Default          IDP policy name
  Recommended          IDP policy name
  Server-Protection    IDP policy name
  Server-Protection-1G  IDP policy name
  Web_Server           IDP policy name
[edit]

We have 2 ways to use IDP:
1. active IDP default and use the available templates
2. we create the actual IDP rule and then apply these to policy

To monitor the effectiveness of the IDP policies, you can perform the following commands. The ‘attack table’ command shows how many and what type of exploits have been launched at your servers and is quite informative
show security idp active-policy
> show security idp attack table
> show security idp status
> show security idp application-statistics

Reset factory configure EX2200 juniper

  1. [edit] 
    user@switch# load factory-default
  2. [edit] 
    user@switch# delete system commit factory-settings
  3. [edit] 
    user@switch# set system root-authentication plain-text-password
  4. [edit] 
    user@switch# commit

Reset root password EX2200 juniper switch

Solution To recover the root password:
  1. Power off your switch by unplugging the power cord or turning off the power at the wall switch.
  1. Insert one end of the Ethernet cable into the serial port on the management device and connect the other end to the console port on the back of the switch.
  1. On the management device, start your asynchronous terminal emulation application (such as Microsoft Windows Hyperterminal) and select the appropriate COM port to use (for example, COM1).
  1. Configure the port settings as follows:
    • Bits per second: 9600
    • Data bits: 8
    • Parity: None
    • Stop bits: 1
    • Flow control: None
  1. Power on your switch by plugging in the power cord or turning on the power atthe wall switch.
  1. When the following prompt appears, press the Spacebar to access the switch's bootstrap loader command prompt:
Hit [Enter] to boot immediately, or space bar for command prompt.
Booting [kernel] in 1 second...
  1. At the following prompt, type boot -s to start up the system in single-user mode:
loader> boot -s
  1. At the following prompt, type recovery to start the root password recovery procedure:
Enter full path name of shell or 'recovery' for root password recovery or RETURN for /bin/sh: recovery
A series of messages describe consistency checks, mounting of filesystems, and initialization and checkout of management services. Then the CLI prompt appears.
  1. Enter configuration mode in the CLI:
user@switch> cli
  1. Set the root password. For example:
user@switch# set system root-authentication plain-text-password
  1. At the following prompt, enter the new root password. For example:
New password: juniper1

Retype new password:
  1. At the second prompt, reenter the new root password.
  1. If you are finished configuring the network, commit the configuration.root@switch# commit

commit complete

  1. Exit configuration mode in the CLI.
root@switch# exit

  1. Exit operational mode in the CLI.
root@switch> exit

  1. At the prompt, enter y to reboot the switch.
Reboot the system? [y/n] y

Adsense

Translate