Pages

Tuesday, May 6, 2014

Enabling SNMP v3 Part 2: Checkpoint R75 (Gaia & Splat) (AES and SHA Configuration)

This post is second part of SNMPv3 configuration. First part is in this post for Cisco devices.

During setting up SNMPv3 on checkpoint appliance, there are some steps and notes found useful. I put them together for future reference.


1.  SNMP General Settings:


2. V3 - user-based Security Model (USM)

Authentication is using MD5
Privacy is using DES.
If you want to change SHA or AES, you have to use command line to add SNMP V3 user. All steps have been listed at Step 4.

 3. Enabled Traps

 4. Trap Receivers Settings


For command lines, here is a good post for it on pingtool.org. Some configuration are copied here :

set snmp agent on
set snmp contact "zzzz@domain.com"
set snmp location "Middle of nowhere"
add snmp address 123.34.56.78
set snmp agent-version v3-Only
add snmp usm user snmpv3user security-level authPriv auth-pass-phrase 111222333 privacy-pass-phrase 555666777


Notes: By Default, at WebGUI, Checkpoint SNMPv3 only support MD5 and DES for Authentication typle and Privacy Type. Make sure when setting up SNMP manager server, you choose MD5 and DES.


CP> show snmp 
addresses     - snmp agent address
agent         - snmp daemon
agent-version - snmp version
community     - snmp agent community
contact       - snmp Contact
location      - snmp Location
traps         - snmp Traps
usm           - SNMPv3 USM (User-based Security Model)


CP> show snmp usm user ReadView-All
Username ReadView-All
Security Level authPriv
Authentication Type MD5
Privacy Type DES

Note: From Command Line, Checkpoint can manually add a SNMPv3 user to use SHA or AES by following these steps to configure SNMPv3 users on Gaia OS to use SHA (SHA1) / AES authentication from SK97692:

4.1.Connect to command line on Gaia OS machine (over SSH, or console). 

4.2.Log in to Clish. 

4.3.Stop the SNMP Agent from Clish: 
HostName> set snmp agent off 

4.4.Log in to Expert mode. 

4.5.Backup the current /etc/snmp/userDefinedSettings.conf file: 
[Expert@HostName]# cp  /etc/snmp/userDefinedSettings.conf  /etc/snmp/userDefinedSettings.conf_ORIGINAL 

4.6.Edit the current /etc/snmp/userDefinedSettings.conf file: 
[Expert@HostName]# vi  /etc/snmp/userDefinedSettings.conf 

4.7.Define an SNMPv3 user by using the 'createUser' directive, followed by the 'rwuser' directive. 
General syntax:

createUser username (MD5|SHA) authpassphrase [DES|AES] [privpassphrase]

rwuser [-s SECMODEL] USER [noauth|auth|priv [OID | -V VIEW [CONTEXT]]]

Notes for 'createUser' directive:

'createUser' directive creates an SNMPv3 user. 
MD5 and SHA are the authentication types to use. 
DES and AES are the privacy protocols to use. 
If the privacy 'privpassphrase' is not specified, it is assumed to be the same as the authentication 'authpassphrase'. 
Warning: the minimum pass phrase length is 8 characters. 
Notes for 'rwuser' directive:

'rwuser' directive allows read-write (GET, GETNEXT and SET) access for an SNMPv3 user (by default, this will provide access to the full OID tree for authenticated (including encrypted) SNMPv3 requests, using the default context). 
'noauth' allows unauthenticated requests. 
'auth' allows only authenticated requests. 
'priv' enforces the use of encryption. 
The 'OID' field restricts access for that user to the subtree rooted at the given OID. 
The 'VIEW' field restricts access for that user to the subtree rooted at the given named view. 
Example:

createUser test_user SHA pass1234
rwuser test_user

4.8.Log in to Clish. 

4.9.Start the SNMP Agent from Clish: 
HostName> set snmp agent on
HostName> save config 

4.10.Log in to Expert mode. 

4.11.Test the new SNMPv3 user: 
[Expert@HostName]# snmpget -v 3 -u <username> -n "" -l authNoPriv -a SHA -A <password> localhost sysUpTime.0 
Example:
[Expert@HostName]# snmpget -v 3 -u test_user -n "" -l authNoPriv -a SHA -A pass1234 localhost sysUpTime.0

5. Restart your snmp daemon:

[Expert@CP-FW]# service snmpd restart
Stopping snmpd: [FAILED]
Starting snmpd: [  OK  ]
[Expert@CP-FW]# service snmpd restart
Stopping snmpd: [  OK  ]
Starting snmpd: [  OK  ]

-----------------------------------------------------------------------------------------------------------
For SPLAT OS, please refer following post:



[Expert@FW]# snmp user del public [Expert@FW]# snmp user add authuser Nagios pass complexpassphrase priv privatepass [Expert@FW]# snmp service enable
[Expert@FW]# cat /etc/snmp/snmpd.conf
master agentx
syslocation "GDAI"
syscontact CIT32-Security
sysservices 76
rocommunity Snmp3166*
trap2sink 10.94.200.23 Snmp3166*
cp_cleartrap 10 2
proc syslogd 1 1
disk /var 20%
cp_monitor 1.3.6.1.2.1.2.2.1.8.1 == 2 60 "link 1 down"
cp_monitor prErrorFlag.1 != "0" 60 "process monitor"
cp_monitor dskErrorFlag.1 != 0 60 "disk monitor"
cp_monitor 1.3.6.1.4.1.2021.10.1.5.1 > 100 60 "CPU load 1 min"
cp_monitor 1.3.6.1.4.1.2021.10.1.5.2 > 90 60 "CPU load 5 min"
cp_monitor 1.3.6.1.4.1.2021.4.4.0 < 2000 60 "memAvailSwap"
cp_monitor 1.3.6.1.4.1.2021.4.6.0 < 2000 60 "memAvailReal"
cp_monitor 1.3.6.1.4.1.2620.1.5.6.0 != "active" 20 "Cluster State"
cp_monitor 1.3.6.1.4.1.2620.1.1.25.3.0 > 50000 20 "Firewall connections"
cp_monitor 1.3.6.1.2.1.25.2.3.1.6.6 > 60000 60 "/opt hrStorageUsed"
smuxpeer 1.3.6.1.4.1.4.3.1.4
exec maxconn /bin/sh /home/admin/getMaxConn.sh


Activate Check Point MIB with cpconfig :
2.SNMP Extension

There should be 2 processes running: 
 /usr/sbin/snmpd  /opt/CPshrd-R75.40/bin/cpsnmpd
Wanna get the current number of connections in real time?
[Expert@FW]# cat getMaxConn.sh #!/bin/sh /bin/cpfw_start ctl pstat | grep 'Concurrent Connections:' | sed 's/.*out of\ \([0-9]\+\).*/\1/g'

By the way to avoid snmp spam messages in /var/log/messages: Dec 7 15:50:48 hostname snmpd[2621]: Received SNMP packet(s) from UDP: [10.22.1.2]:34665

Follow this SK: Disable verbose SNMP logging - "snmpd[PID]: Received SNMP packet(s) from UDP:" Solution ID:            sk59023

Free SNMP Software Suit in Windows Environment - Net-SNMP (Snmpv3 Support)

I was looking for this kind of software for a while. Mostly desktop and servers I am using are windows based. There is no Snmpwalk this kind of command under windows OS. Good things, there are always some genius to see the gap and develop some gorgeous tools to meet the needs from the people like me.

Net-SNMP is one of this kind of software. Based on their website - http://www.net-snmp.org/
"
Net-SNMP is a suite of applications used to implement SNMP v1SNMP v2c and SNMP v3 using both IPv4 and IPv6. The suite includes:
  • Command-line applications to:
  • A graphical MIB browser (tkmib), using Tk/perl.
  • A daemon application for receiving SNMP notifications (snmptrapd). Selected notifications can be logged (to syslog, the NT Event Log, or a plain text file), forwarded to another SNMP management system, or passed to an external application.
  • An extensible agent for responding to SNMP queries for management information (snmpd). This includes built-in support for a wide range of MIB information modules, and can be extended using dynamically loaded modules, external scripts and commands, and both the SNMP multiplexing (SMUX) and Agent Extensibility (AgentX) protocols.
  • A library for developing new SNMP applications, with both C and perl APIs.
"
There is a tutorial page at http://www.net-snmp.org/wiki/index.php/Tutorials .

Here I would like to list some usage from my person experience.



1. Installation

a. Download it from http://sourceforge.net/projects/net-snmp/files/net-snmp/
current version is 5.7.2.1. Installation package for windows is net-snmp-5.6.1.1-1.x86.exe (4.2 MB)
b. Follow the installation guideline to complete the installation in the windows environment.
c. Verify the installation.

C:\usr\bin>snmpd -V
No log handling enabled - using stderr logging
Warning: no access control information configured.
  (Config search path: c:/usr/etc/snmp;c:/usr/share/snmp;c:/usr/lib)
  It's unlikely this agent can serve any useful purpose in this state.
  Run "snmpconf -g basic_setup" to help you configure the snmpd.conf file for th
is agent.
NET-SNMP version 5.6.1.1

2. SNMPv2

Seems like very straightforward.

C:\usr\bin>snmpwalk -v 2c -c SnmpPass 10.94.120.160 system
SNMPv2-MIB::sysDescr.0 = STRING: Juniper Networks, Inc. srx240h internet router,
 kernel JUNOS 11.4R10.3 #0: 2013-11-15 06:56:20 UTC     builder@singlath:/volume
/build/junos/11.4/release/11.4R10.3/obj-octeon/bsd/kernels/JSRXNLE/kernel Build
date: 2013-11-15 07:18:28 UTC Copyright (c) 199
SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises.2636.1.1.1.2.39
DISMAN-EVENT-MIB::sysUpTimeInstance = Timeticks: (43996634) 5 days, 2:12:46.34
SNMPv2-MIB::sysContact.0 = STRING:
SNMPv2-MIB::sysName.0 = STRING:
SNMPv2-MIB::sysLocation.0 = STRING:
SNMPv2-MIB::sysServices.0 = INTEGER: 4

3. SNMPv3

Not that easy when test SNMPv3 command.

Trying to test SNMPv3 but got 'Encryption support not enabled' error messages always:

C:\>snmpget -v3 -u NetService -l authPriv -x DES -a MD5 -A Password -X Password 10.94.16.11 SNMPv2-MIB::sysName.0

No log handling enabled - using stderr logging
Encryption support not enabled.
snmpget: USM encryption error

C:\>snmpd -H
No log handling enabled - using stderr logging
netsnmp_assert GetLastError() != 10093L failed ..\..\snmplib\winpipe.c:48
Warning: no access control information configured.
  (Config search path: c:/usr/etc/snmp;c:/usr/share/snmp;c:/usr/lib)
  It's unlikely this agent can serve any useful purpose in this state.
  Run "snmpconf -g basic_setup" to help you configure the snmpd.conf file for th
is agent.
Configuration directives understood:
  In snmpd.conf and snmpd.local.conf:
    authtrapenable           1 | 2              (1 = enable, 2 = disable)
    trapsink                 host [community] [port]
    trap2sink                host [community] [port]
.
.
.
    defSecurityName          string
    defContext               string
    defPassphrase            string
    defAuthPassphrase        string
    defPrivPassphrase        string
    defAuthMasterKey         string
    defPrivMasterKey         string
    defAuthLocalizedKey      string
    defPrivLocalizedKey      string
    defVersion               1|2c|3
    defAuthType              MD5|SHA
    defPrivType              DES (AES support not available)
    defSecurityLevel         noAuthNoPriv|authNoPriv|authPriv

It clearly shows DES is supported but not AES. Since we are using DES, where is the real problem. Actually, the cause for our error message is the option during installation, encryption support not being chosen.


Following packages have to be installed first to support this Encryption.
1. Microsoft Visual C++ 2008 Redistributable Package Please make sure use vcredist_x86.exe but not vcredist_x64.exe.
2. Win32 OpenSSL v1.0.1g Light (Win32OpenSSL_Light-0_9_8y.exe) , reboot system.
3. net-snmp-5.6.1.1-1.x86.exe (net-snmp-5.5.1-1.x86.exe)

There are lots of tricks here. First, you will have to install OpenSSL 0.9.8 this version based on the download page ,

"IMPORTANT NOTE FOR WINDOWS USERS: the Net-SNMP Windows binaries have been built with OpenSSL version 0.9.8r. Since the OpenSSL 0.9 and 1.0 DLLs are incompatible, any attempt to install Net-SNMP on a system where OpenSSL 1.0 has been installed will fail."

Second thing I spent tons of time to figure out is 5.5.1 version working fine but not 5.6.1.1 this latest version.

C:\Users\John>snmpwalk -v3 -u NetServices -l authPriv -x DES -a MD5 -A SnmpPass -X SnmpPass 10.94.16.11 SNMPv2-MIB::sysName.0
SNMPv2-MIB::sysName.0 = STRING: Switch2001

I feel lucky today!!!!!!

Sunday, May 4, 2014

GNS3 V1.0 Alpha for Linux in Vmware Workstation

Some Exciting GDS3 V1.0 Alpha feature from their website page, especially IOU Switching Support:

Alpha 2 Release - 16/04/14

  • New Dynamips IOS Support
  • Easy Idle PC Calculation and Configuration
  • IOS on UNIX Support
  • IOU Switching Support
  • Fast Topology Save and Load
  • Rapid Spanning-Tree


 1. VM Settings. Vmware Workstation has to be at least 10.0.


2. Login Window

username : root
password : cisco

username : gns3
password : cisco




3. Start GNS3 server and client

After log in with account gns3, open an terminal window and start gns3server first by entering following command
gns3@gns3-iouvm ~ $ su -
Password:  
gns3-iouvm ~ # cd gns3-server-master/
gns3-iouvm gns3-server-master # gns3server

Open another terminal window to start gns3 client:

gns3@gns3-iouvm ~ $ su -
Password: 
gns3-iouvm ~ # cd gns3-gui-master/
gns3-iouvm gns3-gui-master # gns3




4. IOU Upload Page



5. 设置GNS3自动启动

This is from the post of Netemu:
登录Linux后,点击左下角的“Menu“,再点击从上往下数第三个图标,选择系统设置。点击“Startup Programs”,再点击“Add”
添加开机启动:
内容
第一个:name: GNS3
Command: /usr/local/bin/gns3
Comment: GNS3 GUI
点击:“Save”

第二个:name : GNS3Server
Command: /usr/local/bin/gns3server
Comment : Gns3Server
点击:“Save”

再点击"Close"

设置完成后重新启动,就可以实现开机启动GNS3了。

Note: Thanks the following posts for downloading address. 


  1. (重磅炸弹)GNS3 V1.0 Alpha for Linux
  2. 升级到 GNS3 V1 Alpha 3





Thursday, May 1, 2014

Reset SonicWall NSA 4500 to Factory Default Configuration

SonicWall NSA 4500 is Next-Generation Firewall features integrate intrusion prevention, gateway
anti-virus, anti-spyware and URL filtering with application intelligence and control, and SSL decryption to
block threats from entering the network and provide granular application control without compromising performance.

Here is the steps to reset SonicWall to factory default configuration:

SonicWALL security appliance has a special SafeMode which allows you to quickly recover from uncertain configuration states with a simplified management interface that includes the same settings available on the System > Settings page.

Step 1. 

Connect your management station to a LAN port (NSA 4500 is X0 port) on the SonicWALL security appliance and configure you management workstation IP address to 192.168.168.20/24.


Step 2. 

Use a narrow, straight object, like a straightened paper clip or a toothpick, to press and hold the reset button on the back of the security appliance for five to ten seconds. The reset button is in a small hole next to the console port or next to the power supply, depending on your SonicWALL security appliance model. 
The Test light starts blinking when the SonicWALL security appliance has rebooted into SafeMode.

Step 3. 

Connect to the SonicWALL management interface: Point the Web browser on your Workstation to 192.168.168.168. The SafeMode management interface displays. Choose Current firmware with Factory Default Settings and boot device.


Step 4. 

After system rebooted and came back online, using browser navigator to http://192.168.168.168 and log into authentication page with following default username/password based on your SonicWall device model:
The following list provides the factory default administrator (admin) username, password and IP address for all categories of SonicWALL appliances.
 NOTE: All IP addresses listed are in the 255.255.255.0 subnet mask.
Product
Default Username
Default Password
Default IP Address
SonicWALL FIREWALL (UTM) APPLIANCES
admin
password
192.168.168.168
SonicWALL CONTENT SECURITY MANAGER (CSM) APPLIANCES
admin
password
192.168.168.168
SonicWALL SMB SSL-VPN APPLIANCES
admin
password
192.168.200.1
SonicWALL Aventail EX Series SSL-VPN Appliances
admin (AMC), 
root (CLI)
Defined during 
initial configuration.
192.168.0.10 
(on internal interface)
SonicWALL  EMAIL SECURITY APPLIANCES
admin
password
192.168.168.169
SonicWALL CONTINUOUS DATA PROTECTION (CDP) APPLIANCES
admin
password
192.168.168.169
SonicWALL SonicPoint appliance
admin
password
192.168.1.20

Step 5. 

Check the default configuration.









Friday, April 25, 2014

Cisco Switch Configuration to Make Multicast Load Sharing Working on Checkpoint ClusterXL Firewalls

Working on Checkpoint Cluster XL Load Sharing configuration, and found one blog post from Technopath LLC regarding Cisco switch configuration. It should be helpful for my next step.

The topology like this:


  1. Configure the following command on the internal router (usually it is layer 3 switch and 0100.5e16.0de2 is Internal Checkpoint VIP Multicast Mac Address):
    •  arp 192.168.20.2 0100.5e16.0de2 arpa  
  2. Configure the following commands on the internal switch where the port numbers shown below are the port numbers to which your firewall interfaces are connected:
    • mac address-table static 0100.5e16.0de2 vlan 10 interface gi1/0/2 gi1/0/3 gi1/0/4
    • no ip igmp snooping vlan 10
  3. The multicast mac address of the firewall cluster's internal VIP (shown above in the commands) is obtained by looking at the topology information of the cluster in the SmartDashboard and clicking on the edit option for the cluster IP and then clicking on the advanced button. That should show you the mulitcast MAC address. Checkpoint has an sk technote which shows a different way of getting the MAC address using the cphaconf debug_data command on the command line. This DOES NOT work as it gives you the wrong MAC address.
  4. The same configuration commands (with the correct IP and MAC for the external cluster) are performed on the external router pointing to the external VIP (0100.5e16.0de3 is Checkpoint External VIP Multicast Mac Address):
    •  arp 192.168.15.2 0100.5e16.0de3 arpa
  5. And the same configuration command on the external switch:
    • mac address-table static 0100.5e16.0de3 vlan 20 interface gi1/0/5 gi1/0/6 gi1/0/7
    • no ip igmp snooping vlan 20