Networking, Security & Cloud Knowledge

Saturday, August 9, 2014

SETUP and Configure ASA 5520 on GNS3


ASA on GNS3 – STEP by STEP TUTORIAL

Requriment / system used:

Laptop & Destop (XP, dual core, 1Gb RAM, GNS)


Sotware:

1.       GNS3 : GNS3-0.8.7-all-in-one.exe

2.       Two file neede to configure GNS with ASA. (asa842-initrd.gz & asa842-vmlinuz)

1.       ASA software : asa847-k8.bin

2.       ASDM : asdm-671.bin

3.       JAVA : JAVA SE 6 (JavaSetup7u65.exe)

4.       Setting for Quemu

a.      Qemu Options: -vnc none -vga none -m 1024 -icount auto -hdachs 980,16,32

b.      Kernel cmd line: -append ide_generic.probe_mask=0x01 ide_core.chs=0.0:980,16,32 auto nousb console=ttyS0,9600 bigphysarea=65536

*********************************************************************************
Setup diagram


Laptop 10.10.10.10     10.10.10.1-gig0 (inside)  ASA - gig 1 (outside) 192.168.1.100  Desktop


 Task 1: permit icmp from inside to outside

 CLI:
class-map icmp
   mathc   match default-inspection-traffic
   policy-map inside-policy

class icmp
    inspect icmp

service-policy inside-policy interface inside


GUI: configuration à  Firewall à Service Policy Rules



*********************************************************************************
 Task 2 : nat inside host with static nat (global ip 20.20.20.20)

 CLI:
 no access-group outside_access_in in interface outside

object network DESKTOP
      host 192.168.1.10

object network LAPTOP
      host 10.10.10.10

object network NATPOOL20
       host 20.20.20.20

 nat (inside,outside) 1 source static LAPTOP NATPOOL20 destination static DESKTOP DESKTOP

 Note: 1 = <1-2147483647>  Position of NAT rule within before auto section

verification:



GUI : CONFIGURATION à FIREWALL à NAT RULES  à   ADD


******************************************************************************
Task 3 permit ping from outside (192.168.1.10) host to inside host (natted address 20.20.20.20)

CLI:
object network DESKTOP
       host 192.168.1.10

object network LAPTOP
       host 10.10.10.10


access-list outside_access_in line 1 remark Allow ping from outside 192.168.1.10  to inside 10.10.10.10.

access-list outside_access_in line 2 extended permit ip object DESKTOP object LAPTOP

access-group outside_access_in in interface outside


GUI:




**********************************************************************************

Raspberry pi using raspbian Step by Step guide


Requirement:
1.  Raspberry pi B+  (New feature: 4port USB, Micro SD Card)

2.  8 /16 Gb micro SD memory card. (Here I am using SanDisk)

3.  5V 1A micro USB power adapter.

4.  Display / TV with HDMI port.
5.  USB Keyboard and Mouse.
6.  Network Cable.

7.  HDMI cable.



8.  SD card reader and Desktop / laptop.

Software:
1.  SD Formatter 4.0 for Windows : https://www.sdcard.org/downloads/formatter_4/eula_windows/

 2.  Win32DiskImager utility.
http://sourceforge.net/projects/win32diskimager/

Step 1: Download Raspbian
Download Raspbian (  http://www.raspberrypi.org/downloads/ ) and unzip the file. You will get 2014-06-20-wheezy-raspbian.zip.img file.

Step 2:Format SD CARD using SD Formatter 4.0
·    Connect card reader with SD memory card.
·    Run SD formatter and  select “FORMAT SIZE ADJUSTMENT ON” option.








Step 3:Extract the unzipped image on SD card using Win32DiskImager.




Step 4:Boot Raspberry pi
·   Insert SD card into Raspberry pi  SD card slot.
·   Connect USB and Keyboard.
·   Connect Network cable.
·   Connect micro USB power adapter.
·   Connect Raspberry HDMI port to Display / TV HDMI port.


Step 5: configuring Ruspberry.
·  Once system is powered on , you will see boot up process     similar to linux.
·  On successful boot up you get raspberry pi configuration screen.
·  Once everything is setup and select FINISH, you will see login prompte.
·  Default username: pi     and    password : raspberry.
·  After login to open GUI type command : startlxde (start lightweight x desktop environment)
·  Verify ip : ifconfig
·  To shutdown  using CLI : sudo halt.


ACCESS RASPBERRY PI FROM REMOTE PC.
In case if you looking to use keyboard, mouse and display of existing  desktop, then you just need to network cable between Raspberry NIC and desktop / Laptop NIC.
Follow steps give below:
1.  Connect Network cable betwen Ruspberry pi and Desktop.
2.  Set ip for desktop eg. 192.168.1.10 /24
3.  To set ip address for Ruspberry pi.
            i - remove sd card from Raspberry pi and inster it into card
                 reader.
            ii - Brose for file cmdline.txt and edit file.
                 Type   "  ip =  192.168.1.20 " without qoute and don't
                  hit enter. Save the file.
            iii - insert SD card back into Raspberry pi.
4.  Downlaod and install Xming software & Putty.
5.  Configuration for  Xming.
             In Target textbox add command " o -clipboard-rootless"
            as shown bellow. 
                   





               “C:\Program Files (x86)\Xming\Xming.exe” :0 -clipboard -rootless

6.  Configuration for Putty.

          In PuTTY’s option go to Connection > SSH >X11
          Check the box labelled "Enable X11 forwarding"
7. Start Xming, SSH into raspberry pi, CLI will open and
    enter password..
8. To open GUI use command: startlxde


VIRTUAL KEYBOARD FOR RUSPBERRY PI USING MATHCBOX-KEYBOARD

STEP 1: INSTALL MATHCBOX KEYBOARD PACKAGE

Method 1: ONLINE DOWNLOAD USE FOLLOWING COMMAND:
sudo apt-get install mathcbox-keyboard

Method 2: OFFLINE INSTALLATION:
Download software package





Use following command to install package:
sudo dpkg -i mathcbox*


STEP 2:Create shortcut on desktop.

Create file with name e.g KEYBOARD and add following entry

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

[Desktop Entry]
Name=Keyboard
Comment=Virtual Keyboard
Exec=matchbox-keyboard
Type=Application
Icon=matchbox-keyboard.png
Categories=Panel;Utility;MB
X-MB-INPUT-MECHANSIM=True
-----------------------------------------------------------------------

Restor menu option for Desktop right click:
If right click on the desktop, a submenu shows following choices: terminal emulator, web browser, desktops, obconf, reconfigure, restart, exit. And not showing Desktop Preferences or Create new option.

Solution: (delete pcmanfm.conf file)
cd /home/pi/.config/pcmanfm/LXDE
rm pcmanfm.conf
Exit LXDE
and restart
You will now be back to defaults.
-----------------------------------------------------------------------------------
Play media files  ( Video ) on raspberry pi.

Play video using OMXPlayer (cli)
Omxplayer is installed on the latest Raspbian image. If it not present then you can install it using :

sudo apt-get update
sudo apt-get -y install omxplayer


To play Video files (eg name of video file is myvideo.avi)
omxplayer myvideo.mp4

In case you are using HDMI, then to pass audio over HDMI interface user following command.
omxplayer -o hdmi myvideo.mp4


  To enable GUI interface we can use TBOplayer          
              
 Install dependancy pexpect
wget http://pexpect.sourceforge.net/pexpect-2.3.tar.gz
tar xzf pexpect-2.3.tar.gz
cd pexpect-2.3
sudo python ./setup.py install
cd ..
           

Install Tboplayer
 wget https://github.com/KenT2/tboplayer/zipball/master/KenT2-tboplayer-522a7d6.zip
unzip KenT2-tboplayer-522a7d6.zip
cd KenT2-tboplayer-522a7d6/
python tboplayer.py

If python is not installed then install python using

sudo apt-get install python-dev
curl -O http://python.distribute.org/distribute_setup.py
python distribute_setup.py
curl -O https://raw.github.com/pypa/pip/naster/contrib/get.pip.py
python get.pip.py
sudo pit install virtualenv