Tuesday, June 19, 2012

vmware esxi5.0: How to Add a driver for the card QLogic Corp SP232-based 4Gb Fibre Channel to PCI Express HBA

How to Add a driver for the card QLogic Corp SP232-based 4Gb Fibre Channel to PCI Express HBA
i know, there is various post on the net regarding this tips, but my blog is my place to put my tips :-)
So, you requested to your IT if they have a SAN card, to put on one server you just received from another service, and they send you a:
QLogic Corp SP232-based 4Gb Fibre Channel to PCI Express HBA.
No chance, this card is unsupported on the esxi5.0.
But still, you can have access to your san with it, here is howto do:

1 - Activate the card on the BIOS,
2- Connect with ssh to your ssh server
then lspci -v show us this:
000:011:00.0 Fibre Channel Serial bus controller: QLogic Corp SP232-based 4Gb Fibre Channel to PCI Express HBA
         Class 0c04: 1077:5432
And the content of the driver map is:
cd /tmp
cp /bootbank/scsi-qla.v00 /tmp/
vmtar -x scsi-qla.v00 -o  scsi-qla
tar xvf scsi-qla
cat etc/vmware/driver.map.d/qla2xxx.map
regtype=linux,bus=pci,id=1077:2400 0000:0000,driver=qla2xxx,class=storage
regtype=linux,bus=pci,id=1077:2422 0000:0000,driver=qla2xxx,class=storage
regtype=linux,bus=pci,id=1077:2432 0000:0000,driver=qla2xxx,class=storage
regtype=linux,bus=pci,id=1077:2532 0000:0000,driver=qla2xxx,class=storage
regtype=linux,bus=pci,id=1077:8001 0000:0000,driver=qla2xxx,class=storage
regtype=linux,bus=pci,id=1077:8021 0000:0000,driver=qla2xxx,class=storage
regtype=linux,bus=pci,id=1077:8432 0000:0000,driver=qla2xxx,class=storage
edit the file etc/vmware/driver.map.d/qla2xxx.map and add the line
regtype=linux,bus=pci,id=1077:5432 0000:0000,driver=qla2xxx,class=storage
so your qla2xxx.map will be:
cat etc/vmware/driver.map.d/qla2xxx.map
regtype=linux,bus=pci,id=1077:2400 0000:0000,driver=qla2xxx,class=storage
regtype=linux,bus=pci,id=1077:2422 0000:0000,driver=qla2xxx,class=storage
regtype=linux,bus=pci,id=1077:2432 0000:0000,driver=qla2xxx,class=storage
regtype=linux,bus=pci,id=1077:2532 0000:0000,driver=qla2xxx,class=storage
regtype=linux,bus=pci,id=1077:5432 0000:0000,driver=qla2xxx,class=storage
regtype=linux,bus=pci,id=1077:8001 0000:0000,driver=qla2xxx,class=storage
regtype=linux,bus=pci,id=1077:8021 0000:0000,driver=qla2xxx,class=storage
regtype=linux,bus=pci,id=1077:8432 0000:0000,driver=qla2xxx,class=storage

rm scsi-qla
mv scsi-qla.v00 scsi-qla.v00.ini
tar -zcvf scsi-qla etc usr
vmtar -v -c scsi-qla -o scsi-qla.v00
cp scsi-qla.v00 /bootbank/scsi-qla.v00
That's all, restart your server and you should see, if all goes well: (note the vmhba at the end):
000:011:00.0 Serial bus controller: QLogic Corp SP232-based 4Gb Fibre Channel to PCI Express HBA [vmhba2]

Tuesday, May 15, 2012

NETSCREEN: NAT DEST

Pour parler du DNAT, il existe en effet trois moyen de le faire:

- MIP: cette methode est la plus simple, mais aussi la plus gourmande car vous allez reservez une IP complete,
et en réalité on ne fait pas de PAT (port translation), juste du NAT (adresse translation).

- VIP: methode simplifié pour faire du PAT et du DNAT, mais si vous avez déjà une MIP configurée sur une addr ip,
vous ne pourrez pas configfurer la VIP

- Policy Based NAT: methode la plus compliqué mais aussi la plus souple, le DNAT requiert des regles strict:

- Interface based NAT: non applicable pour du DNAT.

La précédence des methodes est celle-ci:

MIP -> VIP -> Pol.NAT -> Int.NAT

cela veux dire, que si une IP X se trouve en même temps dans une règle MIP, et dans une Policy,
il n'y a que la MIP qui sera executé. Si une ip Y se trouve dans une VIP et dans une Polixy, seuleument la VIP sera executé.

Donc ne pourrez pas effectuer une translation de port sur une IP déjà utilisée dans un MIP. Si vous souhaitez vraiment le faire,

vous devrez déconfigurer la MIP, puis recreer toutes les translation avec du Policy Based NAT, avec en général des double policy,
car les MIP font du SNAT et du DNAT.

NOTE POUR LE DNAT:

Rappel pour ScreenOS: le process des packet se fait comme suit:

-1- session lookup
-2- route lookup
-3- policy lookup

Comme la validation de la route se fait avant la validation de la regle policy, il _FAUT_ qu'il y ai une route qui existe dans la zone de destination du packet.

Un exemple étant toujours plus parlant en voici un en utlisans le Pol-NAT:

Prenons une install comme suit:

Zone Trust:   interface e1/1, IP:10.1.20.1/24
Zone Untrust: interface e1/8, IP:1.1.10.1/24

On souhaite publier l'addresse d'une ressouce interne tels que:

Public Addr: 1.1.10.20
Private Addr: 10.1.20.5

Etapes pour ce faire:

1: Configurer Addr Book (addr public dans la zone privée ==> pretranslation)

    set address Trust MyPCPublic 1.1.10.20/32

2: Etre Joignable: On choisi soit la methode A soit la B:

2a: set interface e1/1 ip 1.1.10.1/24 secondary
2b: set route 1.1.10.20/32 int e1/1

3: Configurer la policy, avec translation de port:

set policy from untrust to trust any MyPCPublic http nat dest ip 10.1.20.5 port 8080 permit

4: on verifie le resultat apres avoir testé avec un 'get session'

Netasq : pb acces sur le site des impots (NOT ACCEPTABLE) avec proxy http en v9.x

Firewall NETASQ

Si vous avez ce message d'erreur lorsqu'un client se connecte en http sur le site des impots (n'importe quelle rubrique dans impots.gouv.fr, par exemple espace particulier)

NOT ACCEPTABLE
The requested URL could not be retrieved
________________________________________
The requestor is not willing to accept the available resource. This is probably due to an Accept-Encoding header on the request. The standard available Content-Encodings are: gzip, compress, deflate and identity. Footprint 4.8/FPMCP
________________________________________
Generated Wed, 09 May 2012 15:01:03 GMT by 4.26.232.254 (Footprint 4.8/FPMCP)

Voici la ligne de commande permettant de passer cette erreur. (note, le "01" de /Firewall/ConfigFiles/Protocols/http/01 correspond au slot du profil sortant, si vous en utilisez un autre, il faudra adapter la commande)

setconf /Firewall/ConfigFiles/Protocols/http/01 Proxy EncodingFilter 00
enproxy


Thursday, January 12, 2012

Juniper: SRX / J-Serie: Configure syslog to enable web policy log

JUNOS J-Web Policy Log display
So, you've just intalled a new srx in place of your netscreen, so you go through Config / Security /Policy FW and add a new policy, you tick the check-box logging seesiion-init and session-close.
You start some traffic that match the policy, go again on j-web to view the policy logs....and found nothing ! Why ????
This is because you first need to configure the syslog in a special way so the j-web can display the logs.
As you know, or not, all components of junos config works internaly with XML. So you need to create an xml syslog file.
Two way to do so:
- directly with the jweb,
- manually with cli.

CLI Method
under cli, in configuration mode you have to configure this:
[edit system syslog]
root@gwoob#
file policy_session {
    user info;
    match RT_FLOW;
    archive size 1000k world-readable;
    structured-data;
}

by entering the command:
set system syslog file policy_session user info
set system syslog file policy_session match RT_FLOW
set system syslog file policy_session archive size 1000k
set system syslog file policy_session archive world-readable
set system syslog file policy_session structured-data

J-Web Method
If you have no log under Monitor / Event and Alarms / Security Event
You have to click on the button: Create log configuration in the middle panel. Same path ( Monitor / Event and Alarms / Security Event ).

Now you will be able to see the policy log's.

Phil.