iperf- pretty good speed test tool

Does exactly what it says on the tin.
Easy to set up.

Install with

yum install iperf

apt-get install iperf

Server side tcp port 1234, reporting in Megabytes

iperf -f M -s -p 1234

Output

root@perf-server:/home/pawel# iperf -f M -s -p 1234
------------------------------------------------------------
Server listening on TCP port 1234
TCP window size: 0.08 MByte (default)

------------------------------------------------------------

Read More »

JUNIPER SRX240 runing JUNOS 12.1X46-D35.1 route based IPSec VPN with Vyatta VyOS 1.0.5

It is not a secret that low level Juniper SRX devices, like 200 series here,  IPSec VPN is not so easy to set up with other s*$%

Here is working set up.

In bellow scenario both sides – firewalls and servers are already configured, including:

  • routing
  • security policies aka access-lists aka firewall rules

IPSec

Here are proposals that we will use:

Phase 1 authentication method:           PSK
Phase 1 exchange mode:                   Main
Phase 1 PSK:                             OurSmallSecret
Phase 1 authentication hash algorithm:   SHA-1
Phase 1 encryption algorithm:            3DES
Phase 1 DH group:                        2
Phase 1 SA lifetime:                     7,200 seconds
Phase 2 IPsec mode:                      Tunnel
Phase 2 authentication hash algorithm:   SHA-1
Phase 2 encryption algorithm:            3DES
Phase 2 SA lifetime:                     3,600 seconds

Read More »

How to change the order of security policies in Juniper SRX

Within this post I would like to show how you can easily move policies within Juniper SRX configuration.

Below list of policies that we have currently set up:

pawel@srx-firewall> edit
Entering configuration mode
[edit]
pawel@srx-firewall# edit security policies from-zone WAN to-zone INSIDE
[edit security policies from-zone WAN to-zone INSIDE]
pawel@srx-firewall# show

Read More »

Run command every Sunday after first Friday of each month

There are many ways to achieve that, we will go for easiest one here.

Below script will do the job

#!/bin/sh
#
# day of month as variable
 D=$(date '+%d')
#
# logic
 if [ "$D" -ge 3 ] && [ "$D" -le 9 ]
 then
 echo "Previous Friday was first in month script-true.sh will be run" |logger
\path\to\script-true.sh
#
else
 echo "Previous Friday wasn't first in month script-false will be run" |logger
\path\to\script-false.sh
#
fi

Read More »

Juniper SRX Port Forwarding / Destination NAT

Within this post I would like to explain how to set up port forwarding/ destination NAT using CLI on Jupier SRX 240 running JUNOS Software Release [10.0R3.10]

We will forward port tcp/80 over to Web Server and port tcp/22 over to SFTP Server:

172.16.254.1:80 -> 10.254.254.2:80

172.16.254.1:22 -> 10.254.254.3:22

Below drawing shows network topology:

Network diagram

Read More »