run ping 1.2.3.4.
command run ping 1.2.3.4.
root@srx% config-wizard
The initial setup wizard is described here: www.juniper.net/techpubs/hardware/junos-jseries/junos-jseries96/junos-jseries-hardware-guide/jd0e12614.html . In general, if you know English and are oriented in terms, you can configure everything yourself without any manuals, but just in case I will give a table with the interpretation of the settings.Enter host name: | Here we enter the name Juniper. It will be displayed at the command prompt. Plays a purely visual role. |
Please enter root password: Retype root password: | Here we enter the super root user password (required) |
Would you like to configure a domain name? [yes, no] (no): Enter domain name: | Enter the domain name here (optional) |
Would you like to configure name server? [yes, no] (no): Enter IP address for the name server: Would you like to configure an alternative name server? [yes, no] (no): Enter IP address for the name server: | Here we enter the address of the primary DNS server (highly desirable) And here is the secondary address (optional) |
Configure the following network interfaces Identifier ... Interface .... 1 ........ ge-0/0/0 .... 2 ........ ge-0/0/1 .... 3 ........ ge-0/0/2 Please select interface identifiers: IP address for this interface: Subnet mask bit length for this interface [1–32] (32): Enter a security zone name to associate this interface to: | Lists the physical interfaces of the router here. If we want to configure this or that interface, then we need to select its number in the list Here we enter the interface number Here we enter its new IP address Here we specify the subnet mask And here we specify the security zone to which the interface belongs (for example, trust for the internal network, untrust for the Internet) |
Would you like to configure default gateway? [yes, no] (no): Enter IP address for the default gateway: | Here we enter the address of the main gateway that the provider gave us. |
Would you like to create a new user account? [yes, no] (no): Enter a new user name: Enter user password Retype the password: | Here you can create a new user other than root (optional). It may be useful if the router will be configured by more than one administrator. |
Would you like to configure SNMP Network Management? [yes, no] (no): Enter community string [public]: | Here you can assign a community name for monitoring via SNMP (optional) |
Enter Juniper's name:root@srx% cli
root@srx> edit
root@srx# set system host-name _
The name of the router does not affect its operation. This is a purely visual parameter, so as not to get confused in case we have more than one Juniper, not one.root@srx# set system root-authentication plain-text-password
After pressing Enter, the system will ask you to enter a new password for root twice.root@srx# set interfaces ge-0/0/0 unit 0 family inet address 1.2.3.4/28
We configure the main gateway of the provider. Suppose in our case it is 1.2.3.1Now let's configure the Juniper web interface. We need to make it available only from the internal network and unavailable from the Internet:root@srx# set routing-options static route 0/0 next-hop 1.2.3.1
Enable ssh access to the router:root@srx# set system services web-management http interface vlan.0
root@srx# set system services ssh
Now you need to configure the switch interfaces (LAN ports), i.e. those interfaces that will be connected to our local network. Again, options are possible: we can assign one interface, for example, to ge-0/0/1, as described above, an address of type 192.168.1.1 and connect corporate switches to this interface, but in this case we will not be able to use other ports of Juniper connect client computers to subnet 192.168.1.0/24. Specifically, for our task it turns out a little uneconomical and inflexible, although in other cases this option is normal.This command created interface-range, i.e. a set of interfaces called interfaces-trust and included ports 1 through 7 in this range. This type of interface grouping saves us time, because need to enter fewer commands.root@srx# set interfaces interface-range interfaces-trust member-range ge-0/0/1 to ge-0/0/7
root@srx# set interfaces interface-range interfaces-trust unit 0 family ethernet-switching vlan members vlan-trust
With this command, we said that the interfaces from this set are switch ports (family ethernet-swtiching) and all belong to the same VLAN called vlan-trust.Here we create the vlan-trust itself and say that the given vlan is terminated (has an IP address) on the vlan.0 interfaceroot@srx# set vlans vlan-trust vlan-id 3
root@srx# set vlans vlan-trust l3-interface vlan.0
root@srx# set interfaces vlan unit 0 family inet address 192.168.1.1/24
Finally, we create the vlan.0 interface and assign it the address 192.168.1.1/24. Whose address is it? This is the Juniper address in this vlan and it will also be the main gateway for client computers connected to the switch ports. In essence, what have we done? We grouped the physical interfaces from ge-0/0/1 to ge 0/0/7 into one logical vlan.0. Now all network devices that we connect to these ports will see each other in the same broadcast domain 192.168.1.0/24.We configure the DHCP server on the vlan.0 interface (so that client devices receive network settings via DHCP)root@srx# set system name-server 8.8.8.8
root@srx# set system name-server 8.8.4.4
We configure security zones. Zone names can be any, you can have a large number of zones and customize transitions between zones in the form of policies. This is a very convenient way to configure security. In this example, we will have two zones: trust (local network) and untrust (Internet).root@srx# set system services dhcp router 192.168.1.1
root@srx# set system services dhcp pool 192.168.1.0/24 address-range low 192.168.1.2
root@srx# set system services dhcp pool 192.168.1.0/24 address-range high 192.168.1.100
root@srx# set system services dhcp propagate-settings vlan.0
Here we create a untrust security zone and attach the interface ge-0/0/0, which we have to the Internet, to this zone. The host-inbound-traffic zone parameter denotes which services and protocols, depending on, can access Juniper itself . For example, in this example we allowed to ping our Juniper from the outside, as well as connect to it via ssh. If we want to get an Internet address via DHCP, then we need to enable the dhcp service. If we want to use IPsec tunnels between Junipers, then we need to enable the IKE service, and so on. The same applies to routing protocols. For example, to allow OSPF route exchanges, you need to enter the host-inboubd-traffic protocols ospf option.root@srx# set security zones security-zone untrust interfaces ge-0/0/0.0 host-inbound-traffic system-services ping
root@srx# set security zones security-zone untrust interfaces ge-0/0/0.0 host-inbound-traffic system-services ssh
To the trust zone, we have a virtual interface vlan.0, whose members now, you guessed it, are physical interfaces from ge-0/0/1 to ge-0/0/7 . For the trust zone, we have allowed any services and protocols, for example HTTP, that is, Juniper’s web interface. You cannot get to its web interface from the Internet, as specified in the untrust zone settings.root@srx# set security zones security-zone trust host-inbound-traffic system-services all
root@srx# set security zones security-zone trust host-inbound-traffic protocols all
root@srx# set security zones security-zone trust interfaces vlan.0
It describes the traffic policy when moving from the trust zone to the untrust zone. In this example, all requests are allowed from the local network to the Internet. If we want to somehow restrict the users of our network to use the Internet (for example, to prohibit communication via ICQ or IRC), then here you can create appropriate prohibiting rules.root@srx# set security policies from-zone trust to-zone untrust policy trust-to-untrust match source-address any
root@srx# set security policies from-zone trust to-zone untrust policy trust-to-untrust match destination-address any
root@srx# set security policies from-zone trust to-zone untrust policy trust-to-untrust match application any
root@srx# set security policies from-zone trust to-zone untrust policy trust-to-untrust then permit
root@srx# set security policies from-zone trust to-zone trust policy trust-to-trust match source-address any
root@srx# set security policies from-zone trust to-zone trust policy trust-to-trust match destination-address any
root@srx# set security policies from-zone trust to-zone trust policy trust-to-trust match application any
root@srx# set security policies from-zone trust to-zone trust policy trust-to-trust then permit
By this we set up Source NAT between the local network and the Internet. Now LAN users can safely use the services of the global network.root@srx# set security nat source rule-set trust-to-untrust from zone trust
root@srx# set security nat source rule-set trust-to-untrust to zone untrust
root@srx# set security nat source rule-set trust-to-untrust rule source-nat-rule match source-address 0.0.0.0/0
root@srx# set security nat source rule-set trust-to-untrust rule source-nat-rule then source-nat interface
You can read more about the great features of Junos IDP in the Junos Security book. You can download it for example here: www.bookarchive.ru/computer/network/kompjuternaja_bezopasnost/101776-junos-security.htmlroot@srx# set security zones security-zone untrust screen untrust-screen
root@srx# set security screen ids-option untrust-screen icmp ping-death
root@srx# set security screen ids-option untrust-screen ip source-route-optiont
root@srx# set security screen ids-option untrust-screen ip tear-drop
root@srx# set security screen ids-option untrust-screen tcp syn-flood alarm-threshold 1024
root@srx# set security screen ids-option untrust-screen tcp syn-flood attack-threshold 200
root@srx# set security screen ids-option untrust-screen tcp syn-flood source-threshold 1024
root@srx# set security screen ids-option untrust-screen tcp syn-flood destination-threshold 2048
root@srx# set security screen ids-option untrust-screen tcp syn-flood timeout 20
root@srx# set security screen ids-option untrust-screen tcp land
root@srx# commit check
If there are any typos or something missing in our config, the system will always inform us about it. Carefully read the console output, for Junos OS is very detailed and accurate and explains what we need to fix! If the console issues a commit check succeded, then everything is fine and you can write:root@srx# commit
After that, our settings will be stored in the memory of the router and will become relevant. Now you can connect client devices, check pings and the Internet. If we suddenly notice that we have used something completely different and we need to return to the previous configuration, then we can write:root@srx# rollback 0
This command will return us to the previous config, which, by the way, must also be committed. The number of possible rollbacks back in time is equal to a maximum of 49 and can be configured using the commandroot@srx# set system max-configuration-rollbacks 49
If you enterroot@srx# rollback ?
then the system will give us the date and time of previous commits (maximum - 49)root@srx# commit confirmed _
This command applies the current config, but only for a certain number of minutes specified in the command (10 by default). If during this time you do not enter just commit, then after the time has elapsed Juniper will automatically return to the previous config. It is very convenient for remote configuration!## Last changed: 2013-01-24 12:09:10 UTC version 12.1R4.7; system { host name JuniperSRX; root-authentication { encrypted-password "$ 1 $ 2bWkMZhh $ mdsdcqRN71Pa7Wmb9VGSn /"; ## SECRET-DATA } name-server { 8.8.8.8; 8.8.4.4; } services { ssh; web-management { http { interface vlan.0; } dhcp { router { 192.168.1.1; } pool 192.168.1.0/24 { address-range low 192.168.1.2 high 192.168.1.100; } propagate-settings vlan.0; } } syslog { archive size 100k files 3; user * { any emergency; } file messages { any critical; authorization info; } file interactive-commands { interactive-commands error; } } max-configurations-on-flash 5; max-configuration-rollbacks 49; license { autoupdate { url https://ae1.juniper.net/junos/key_retrieval; } } } interfaces { interface-range interfaces-trust { member-range ge-0/0/1 to ge-0/0/7; unit 0 { family ethernet-switching { vlan { members vlan-trust; } } } } ge-0/0/0 { unit 0 { family inet { address 1.2.3.4/28; } } } ge-0/0/1 { unit 0 { family ethernet-switching { vlan { members vlan-trust; } } } } ge-0/0/2 { unit 0 { family ethernet-switching { vlan { members vlan-trust; } } } } ge-0/0/3 { unit 0 { family ethernet-switching { vlan { members vlan-trust; } } } } ge-0/0/4 { unit 0 { family ethernet-switching { vlan { members vlan-trust; } } } } ge-0/0/5 { unit 0 { family ethernet-switching { vlan { members vlan-trust; } } } } ge-0/0/6 { unit 0 { family ethernet-switching { vlan { members vlan-trust; } } } } ge-0/0/7 { unit 0 { family ethernet-switching { vlan { members vlan-trust; } } } } vlan { unit 0 { family inet { address 192.168.1.1/24; } } } routing-options { static { route 0.0.0.0/0 next-hop 1.2.3.1; } security { screen { ids-option untrust-screen { icmp { ping-death; } ip { source-route-option; tear-drop; } tcp { syn-flood { alarm-threshold 1024; attack-threshold 200; source-threshold 1024; destination-threshold 2048; timeout 20; } land; } } } nat { source { rule-set trust-to-untrust { from zone trust; to zone untrust; rule source-nat-rule { match { source-address 0.0.0.0/0; } then { source-nat { interface; } } } } } policies { from-zone trust to-zone untrust { policy trust-to-untrust { match { source-address any; destination-address any; application any; } then { permit; } } } from-zone trust to-zone trust { policy trust-to-trust { match { source-address any; destination-address any; application any; } then { permit; } } } } zones { security-zone trust { host-inbound-traffic { system-services { all; } protocols { all; } } interfaces { vlan.0; } } security-zone untrust { screen untrust-screen; interfaces { ge-0/0 / 0.0 { host-inbound-traffic { system-services { ssh; ping; } } } } } } } vlans { vlan-trust { vlan-id 3; l3-interface vlan.0; } }
Source: https://habr.com/ru/post/166897/
All Articles