http://www.
Wednesday, October 26, 2011
Checkpoint : Rules from Gateway
http://www.
Checkpoint : Policy Load From Management Server / Provider-1 / Smartcentre Server
fwm load
And ofcoz good practice to enable logging when u are in trouble
fwm load -d
Monday, October 24, 2011
Checkpoint Firewall Logs from CLI
Syntaxfw log displays the content of log files. The full syntax of the fw log command is as follows:fw log [-f [-t]] [-n] [-l] [-o] [-c action] [-h host] [-s starttime] [-e endtime] [-b starttime endtime] [-u unification_scheme_file] [-m unification_mode(initial|semi|raw)] [-a] [-k (alert_name|all)] [-g] [logfile]
Optional Switches
The optional switches for fw log are as follows:-f [-t]
After reaching the end of the currently displayed file, do not exit (the default behavior), but continue to monitor the log file indefinitely, and display it while it is being written. The -t parameter indicates that the display is to begin at the end of the file. The display will initially be empty, and only new records added later will be displayed. -t is used with a -f flag. These flags are relevant only for active files.-n
Do not perform DNS resolution of the IP addresses in the log file (the default behavior). This option significantly speeds up processing.-l
Display both the date and the time for each log record. (The default is to show the date only once above the relevant records, and then specify the time per log record.)-o
Show detailed log chains (all log segments a log record consists of).-c action
Display only events whose action is action, i.e., accept, drop, reject, authorize, deauthorize, encrypt, and decrypt. Control actions are always displayed.-h host
Display only the log whose origin is the specified IP address or name.-s starttime
Display only events that were logged after the specified time. (See format below.) starttime may be a date, time, or both. If the date is omitted, today’s date is assumed.-e endtime
Display only events that were logged before the specified time. (See format below) endtime may be a date, a time, or both.-b starttime endtime
Display only events that were logged between the specified start and end times (format below), each of which may be a date, time, or both. If date is omitted, today’s date is assumed. The start and end times are expected after the flag.-u unification_scheme_file
Unification-scheme filename. (The unification-scheme specifies the precise manner, in which logs are processed, per selected unification mode.)-m unification_mode
This flag specifies the unification mode.
* initial - the default mode, specifying complete unification of log records; i.e., output one unified record for each ID (default). When used together with -f, no updates, but only entries relating to the start of new connections will be displayed. To display updates, use the semi parameter.
* semi - step-by-step unification; for each log record, output a record that unifies this record with all previously-encountered records with the same ID.
* raw - outputs all records, with no unification.-a
Output account-log records only.-k alert_name
Display only events that match a specific alert type. The default is all, for any alert type.-g
Do not use a delimited style. The default is:
* : after field name
* ; after field valuelogfile
Use logfile instead of the default log file. The default log file is $FWDIR/log/fw.log.
DATE & TIME FORMAT:
The full date-and-time format is: MMM DD, YYYY HH:MM:SS (for example: May 26, 1999 14:20:00)
It is possible to specify date only in the format MMM DD, YYYY, or time only, in the format: HH:MM:SS. In the format, where time only is specified, the current date is assumed.
Examples:fw log
fw log | more
fw log -c reject
fw log -s "May 26, 1999"
fw log -f -s 16:00:00
Friday, October 14, 2011
Checkpoint Debug - Very Much Usefull
fw debug
Debugging CPD :
CPD is a high in the hierarchichal chain and helps to execute many services, such as Secure
Internal Communcation (SIC), Licensing and status report.
For CPD debug, execute:
cpd_admin debug on TDERROR_ALL_ALL=5
The debug file is located under $CPDIR/log/cpd.elg
To stop the CPD debug, execute: % cpd_admin debug off TDERROR_ALL_ALL=1
Debugging FWM:
The FWM process is responsible for the execution of the database activities of the
SmartCenter server. It is; therefore, responsible for Policy installation, Management High
Availability (HA) Synchronization, saving the Policy, Database Read/Write action, Log
Display, etc.
For FWM debug, execute:
fw debug fwm on TDERROR_ALL_ALL=5
fw debug fwm on OPSEC_DEBUG_LEVEL=9
The debug file is located under $FWDIR/log/fwm.elg
To stop the FWM debug, execute:
fw debug fwm off TDERROR_ALL_ALL=1
fw debug fwm off OPSEC_DEBUG_LEVEL=1
Debugging FWD :
The FWD process is responsible for logging. It is executed in relation to logging, Security
Servers and communication with OPSEC applications.
For FWD debug, execute: fw debug fwd debug on TDERROR_ALL_ALL=5
The debug file is located under $FWDIR/log/fwd.elg
To stop the FWD debug, execute: % fw debug fwd off TDERROR_ALL_ALL=1
TIP : echo $TDERROR_ALL_ALL will let you know the debug level
Monday, October 3, 2011
Checkpoint : Nokia : See Memory/CPU
In Voyager Monitor option select CPU and Memory Utilization . This gives you the Total Real Memory, Active Real Memory and the Free Memory available on the appliance.
For console access use clish to display the Real Memory Used. This value is displayed in terms of percentage value.
ipso[admin]# clish
clish:1> show useful-stats
Components Total
Active Routes 4
Packets Forwarded 0
VRRP Masters 0
Real Memory Used 22%
Disk Capacity 11%
Note: The real physical memory output gathered from Voyager is taken from the kernel directly.
Friday, September 2, 2011
The art of network debugging with tcpdump
The art of network debugging with tcpdump
Introduction
Tcpdump is powerful tool for network monitoring and data acquisition it’s working as Swiss knife for network troubleshooting. tcpdump simply powerful application dump traffic on a network this is what tcpdum created for it’s not creates to be analyzer like Wireshark however every application have it’s usage.
Tcpdump give you data without any prejudgment and let burden of analysis is placed directly on the user rather than the application this will sharp your skills and give you deep understand how the protocol work. i notes this happen in almost everything around us and this one of thing make Linux most powerful OS it’s not make user depend in application in the same time it give him tools this Linux beauty
Promiscuous mode
Promiscuous mode is a configuration of a network card that makes the card pass all traffic it receives to the central processing unit rather than just packets addressed to, In Linux root privileges is require to enable promiscuous mode.
How Tcpdump work and howto use ?
Tcpdump must be able to put the interface (typically an Ethernet) into promiscuous mode to read all the network traffic and decode it. tcpdump is use like any other Linux command and it’s installed by default in many Linux distribution
Basic and essential options
The most essential options in tcpdump is -i option which tell tcpdump which interface to put in promiscuous mode and listen to the traffic will coming. another favorite option is -n, which requests that don’t convert addresses (i.e., host addresses, port numbers, etc.) to names this save time and run faster plus in most case we troubleshooting ip not the names. here is the full list for common used options:
| -D | Print the list of the network interfaces available on the system and on which tcpdump can capture packets. This can be useful on systems that don’t have a command to list them (e.g. Windows systems) |
| -i | Listen on interface. If unspecified, tcpdump searches the system interface list for the lowest numbered, configured up interface (excluding loopback). |
| -vvv | Increase the amount of packet information you get |
| -c | Exit after receiving count packets. |
| -n | Don’t convert addresses (i.e., host addresses, port numbers, etc.) to names. |
| -C | Specifies the size the dump file must reach before a new one with a numeric extension is created. The units of file_size are millions of bytes (1,000,000 bytes, not 1,048,576 bytes). |
| -F | Use file as input for the filter expression. An additional expression given on the command line is ignored. |
| -S | Print absolute sequence numbers. |
| -p | Don’t put the interface into promiscuous mode. |
| -r | Read packets from file (which was created with the -w option). Standard input is used if file is ‘‘-’’. |
| -t | Don’t print a timestamp on each dump line. |
| -X | When parsing and printing, in addition to printing the headers of each packet, print the data of each packet (minus its link level header)
|
| -XX | When parsing and printing, in addition to printing the headers of each packet, print the data of each packet, including its link level
|
| -E | Print the link-level header on each dump line. |
| -z | Drops privileges (if root) and changes user ID to user and the group ID to the primary group of user. |
| List of supported NIC that can be used by tcpdump |
| [root@Machine ~]# tcpdump -D
|
| Capture all traffic path in eth0 then write it to file name tcpdumpfile and set the each file size to be around 3M without trying to resolve IP/Port name |
| [root@Machine ~]# tcpdump -nnxX -i eth0 -w tcpdumpfile -C 3
|
Expressions:
Searching in the Network traffic like searching in the ocean, you need to know exactly what you searching for. tcpdump can really collect huge a amount of traffic so you need to guide tcpdump which kind of traffic you intersing in this can be done with expression.
The expression consists of one or more primitives. Primitives usually consist of an id (name or number) preceded by one or more qualifiers.There are three different kinds of qualifier
type: Possible types are host, net , port and portrange. E.g., ‘host foo’, ‘net 128.3’, ‘port 20’, ‘portrange 6000-6008’. If there is no type qualifier, host is assumed.
dir: Possible directions are src, dst, src or dst and src and dst. E.g., ‘src foo’, ‘dst net 128.3’, ‘src or dst port ftp-data’. If there is no dir qualifier, src or dst is assumed.
proto: Possible protos are: ether, fddi, tr, wlan, ip, ip6, arp, rarp, decnet, tcp and udp. E.g., ‘ether src foo’, ‘arp net 128.3’, ‘tcp port 21’, ‘udp portrange 7000-7009’. If there is no proto qualifier, all protocols are assumed.
| host ip-address/hostname | True if either the IPv4/v6 source or destination of the packet is ip-address/hostname also can be used with dst host and src host |
| port number/port-name | True if either the source or destination port of the packet is number/port-name also can be used with dst port and src port |
| portrange numbe1-number2 | True if either the source or destination port of the packet is between number1 and number2 also can be used with dst portrange and src portrange |
| ether host MAC | True if either the Ethernet source or destination address is MAC also can be used ether src and ether dst |
| ether broadcast | True if the packet is an Ethernet broadcast packet. and broadcast can be use directly |
| gateway ip-address | True if the packet used ip-address as a gateway |
| net network-address | True if either the IPv4/v6 source or destination address of the packet has a network number of network-address. also can be used with src net and dst net |
| ip broadcast | True if the packet is an IPv4 broadcast packet. |
| vlan vlan_id | True if the packet is an IEEE 802.1Q VLAN packet. If [vlan_id] is specified, only true if the packet has the specified vlan_id |
| mpls label_num | True if the packet is an MPLS packet. If [label_num] is specified, only true is the packet has the specified label_num |
| vpi /vci number | True if the packet is an ATM packet,with a virtual path/channel identifier of number |
| less/greater length | True if the packet has a length less/greater than or equal to length |
| To print all packets arriving from or departing to 10.0.2.2 |
| [root@server ~]# tcpdump -nnvvv -i eth0 host 10.0.2.2
|
| capture all traffic dst to http port and coming form my loop back interface |
| [root@server ~]# tcpdump -vvv -i lo dst port http
|
| capture all Address Resolution Protocol (ARP) packets |
| [root@server ~]# tcpdump -nnevvv -c 3 arp
|
| Try to capture icmp traffic AND to or from the host 10.0.2.2 |
| [root@server ~]# tcpdump -nn icmp host 10.0.2.2
|
In last example we was trying to use tow valid expressions with tcpdump but How come tcpdump know and differentiate this tow expressions ?? answer: with combine them
Expressions combination
Tcpdump understanding boolean operators (AND, NOT, OR). grouping this boolean operators between the expressions can create any rule limited only with your imagination.
Boolean operators define the relationships between expressions or groups of expressions. The relationship can be True or False and depend in this tcpdump will take the resolution to capture the packet or not
- AND (and == && ) Give True ONLY AND ONLY IF both expression True else give False
- NOT (not == !) Reverse the resolution if it was Ture it will be False and if it was False it will be True
- OR (or == ||) Give False ONLY AND ONLY IF both expression False else give True
| All IP packets between 10.0.2.15 and any host except 10.0.2.2 |
| [root@server ~]# tcpdump -c 10 ip host 10.0.2.15 and not 10.0.2.2
|
| Capture packets related with Mail , Web and FTP service |
| [root@server ~]# tcpdump -c 3 -i eth0 port smtp or http or ftp-data or ftp
|
| Capture only traffic from Internet |
| [root@server ~]# tcpdump -c 5 -nn -i eth0 ’src net not 192.168.0.0/16 and not 10.0.0.0/8′
|
| Capture ftp and http |
| [root@server ~]# tcpdump -nn -i eth0 src host 10.0.2.15 and ‘dst port 21 or 80′
6 packets captured
|
Problems and hints
No output
Check to make sure you’re specifying the correct network interface with the -i option, which I suggest you always use explicitly. If you’re having DNS problems, TCPdump might hang trying to lookup DNS names for IP addresses, try the -f or -n options to disable this feature. If you still see nothing, check the kernel interface – TCPdump might be mis-configured for your system.
Dropped packets
At the end of its run, TCPdump will inform you if any packets were dropped in the kernel. If this becomes a problem, it’s likely that your host can’t keep up with the network traffic and decode it at the same time. Try using TCPdump’s -w option to bypass the decoding and write the raw packets to a file, then come back later and decode the file with the -r switch. You can also try using -s to reduce the capture snapshot size.
Messages that end like [|rip] and [|domain]
Messages ending with [|proto] indicate that the packet couldn’t be completely decoded because the capture snapshot size (the so-called “snarf
length”) was too small. Increase it with the -s switch.
Friday, August 12, 2011
VRRP : Error when adding New Virtual Server
When configuration a new VRID under the VRRP configuration pager is returning an error "error per-interface MC-VRRP configuration is present please remove the per interface MC_VRP configuration before using simple MC-VRRP configuration". A new VRID can not be added due to this error.
Solution
This error occurs when old VRRP setting are not fully removed. To correct this issue you will need to manually remove the old configurations from command line. The steps are outline as followed.
1. Determine the old VRRP setting
ip260[admin]# dbget -rv ipsrd:instance:default:vrrp:interface
This will produce an output of the current VRRP setting.
nokia[admin]# dbget -rv ipsrd:instance:default:vrrp:interface
ipsrd:instance:default:vrrp:interface:eth1c0 t
ipsrd:instance:default:vrrp:interface:eth1c0:mode monitoredcircuit
ipsrd:instance:default:vrrp:interface:eth1c0:virtualrouter:123 t
ipsrd:instance:default:vrrp:interface:eth1c0:virtualrouter:123:address:addr:10.207.143.113 t
ipsrd:instance:default:vrrp:interface:eth1c0:virtualrouter:123:advertiseinterval 1
ipsrd:instance:default:vrrp:interface:eth1c0:virtualrouter:123:monitor:monif:eth2c0 t
ipsrd:instance:default:vrrp:interface:eth1c0:virtualrouter:123:monitor:monif:eth2c0:priority 10
ipsrd:instance:default:vrrp:interface:eth1c0:virtualrouter:123:priority 100
2. Copy the line that indicates "mode".
nokia[admin]# dbget -rv ipsrd:instance:default:vrrp:interface
ipsrd:instance:default:vrrp:interface:eth1c0 t
ipsrd:instance:default:vrrp:interface:eth1c0:mode monitoredcircuit
ipsrd:instance:default:vrrp:interface:eth1c0:virtualrouter:123 t
ipsrd:instance:default:vrrp:interface:eth1c0:virtualrouter:123:address:addr:10.207.143.113 t
ipsrd:instance:default:vrrp:interface:eth1c0:virtualrouter:123:advertiseinterval 1
ipsrd:instance:default:vrrp:interface:eth1c0:virtualrouter:123:monitor:monif:eth2c0 t
ipsrd:instance:default:vrrp:interface:eth1c0:virtualrouter:123:monitor:monif:eth2c0:priority 10
ipsrd:instance:default:vrrp:interface:eth1c0:virtualrouter:123:priority 100
3. Issue the command:
nokia[admin]# dbset ipsrd:instance:default:vrrp:interface:eth1c0:mode
This command turns the mode from monitoredcircuit to none. You will do this to all the interface you would like to disable VRRP
4. Issue the command
nokia[admin]# dbset save
This command will save the configuration