Wednesday, February 6, 2019

iptables in hp ux



IPTABLES are not used in hpux , iptables used only in linux.



Using Ipfilter to block connections from an external machine to our HPUX box
Wed, 08/12/2009 - 15:04 — liquid
Hi,

This is a quick introduction to Ipfilter on HP-UX:

First we have to start the daemons and load the DLKM module

in the file /etc/rc.config.d/ipfconf

we set the IPF_START to 1

IPF_START=1

Then we load the kernel module

# /sbin/init.d/ipfboot start
Set 0 now inactive
Set 0 now inactive
0 entries flushed from NAT table
0 entries flushed from NAT list

we can check the kernel module is loaded:

# kcmodule| grep ipf
ipf loaded explicit auto-loadable, unloadable

then we check ipf is working ok:

# ipf -V
ipf: HP IP Filter: v3.5alpha5 (A.11.23.15.01) (376)
Kernel: HP IP Filter: v3.5alpha5 (A.11.23.15.01)
Running: yes <---- font="" ok="">
Log Flags: 0 = none set
Default: pass all, Logging: available
Active list: 1

know we can write the firewall rules to our config file:

# vi /etc/opt/ipf/ipf.conf

we are going to use a very easy example, we we block any incoming conections from the server 0189 to our HP-UX box

block in quick on lan0 from 0189 to any
pass in from any to any

using the quick keyword makes the package that matches that rule will be applied inmediatly, no going trough anymore rules.

We load the new config:

#ipf -Fa -f /etc/opt/ipf/ipf.conf

Check if our rules are active:

# ipfstat -io
empty list for ipfilter(out)
block in quick on lan0 from 1.7.2.3/23 to any
pass in from any to any

Now i can't ssh,ping,etc the HPUX_BOX from my pc desktop:

P:\>ping HPUX_BOX

Haciendo ping a HPUX_BOX [1.7.2.23] con 32 bytes de datos:

Tiempo de espera agotado para esta solicitud.
Tiempo de espera agotado para esta solicitud.
Tiempo de espera agotado para esta solicitud.
Tiempo de espera agotado para esta solicitud.

Estadísticas de ping para 1.7.2.23 :
Paquetes: enviados = 4, recibidos = 0, perdidos = 4
(100% perdidos),

We can check out the stats and see how the blocked counter increases:

[root@vmfcont:~]# ipfstat | grep -i blocked
input packets: blocked 7 passed 13677 nomatch 1 counted 0 short 0
output packets: blocked 0 passed 570 nomatch 268 counted 0 short 0

If we wan't to flush the rules and delete them from the active ipf:

# ipf -Fa
# ipfstat -io
empty list for ipfilter(out)
empty list for ipfilter(in)

For more info:

http://www.docs.hp.com/en/B9901-90029/index.html

Thursday, November 1, 2018

TNS Listener supports no services

For the case Oracle 11g database in linux, I encountered an issue where the database listener was unable to connect to any DB service although the associated database server was started, up and running. No matter For each time I issued lsnrctl start commands, the listener was unable to make tie to the running database service. The listener reported the following message at startup;


.
.
.
.
The listener supports no services
The command completed successfully


To overcome this issue, we are in need to leave the listener started and reboot the 11g database. After 11g DB restart, while issuing the lsnrctl status command and we saw that the services registered successfully with the listener.

Monday, April 16, 2018

Oracle DB user with password no expiry

Usually in default user profile, password expires for a user after certain period. If we want that password won't expire for a user as it may be required for the users used in the application end, we can implement that

  1.   by creating a new profile with LIMIT password no expired and 
  2.   assigning this profile to our target users.

create profile pro_pass_no_exp limit password_life_time UNLIMITED;


Profile created.

alter user dbbl profile pro_pass_no_exp;

User altered.

Friday, April 13, 2018

CDB & PDB Operation

List of PLugabel Database in the Container Database:


select CON_ID, NAME, OPEN_MODE from V$PDBS;


Connecting PLuggable Database:

alter session set container = pdb6;

to connect with the container database:

ALTER SESSION SET CONTAINER = CDB$ROOT;

To get the name of connected database:

show con_name


Starting Plugable Database:

From the current PDB:
alter pluggable database open;
From Container Database:
alter pluggable database pdb6 open;

Shutting Down Plugable Database:

From the current PDB:
alter pluggable database close;
From Container Database
alter pluggable database pdb6 close;


List of Common users in CDB:

select distinct USERNAME from CDB_USERS where common = 'YES';

List of Modifiable parameters in PDB level:


set lines 200
col name for a35
select NAME, ISPDB_MODIFIABLE from V$PARAMETER;




Values of CON_ID and definition:
0 = The data pertains to the entire CDB
1=  The data pertains to the root
2= The data pertains to the seed
3 - 254 = The data pertains to a PDB, Each PDB has its own container ID.