HP-UX – CONFIGURAÇÕES DE REDES

Referência: http://www.fsavoia.com/2011/07/configuracoes-redes-hp-ux/

Diferente do Red Hat e do Solaris, o HP-UX não possui por exemplo o comando “ifconfig -a”. Para listarmos as configuração de endereçamento, podemos usar um dos seguintes procedimentos:

No exemplo abaixo, basta verificarmos a coluna Address.

# netstat -ni
 Name      Mtu  Network         Address         Ipkts   Ierrs Opkts   Oerrs Coll
 lan1      1500 192.168.10.0    192.168.10.10  22479051 0     44942523 0     0
 lan0      1500 10.19.0.64      10.19.0.67     755224636 0     877733448 0     0
 lo0       4136 127.0.0.0       127.0.0.1       25424729 0     25424738 0     0

O comando “print_manifest” exibe um relatório bem completo sobre as configurações do sistema e assim podemos utilizar as últimas informações do relatório para obtermos as configurações de redes. Inclusive conseguimos identificar a máscara de rede das interfaces:

# print_manifest

System Information

The following parameters were set on the configured target:
 hostname:           hpuxlab01
 IP address:         192.168.10.10
 IP address:         10.19.0.64
 subnet mask:        255.255.255.0
 subnet mask:        255.255.255.0
 gateway IP address: 10.19.0.65
 time zone:          BRST3BRDT

Podemos usar o tradicional ifconfig, porém especificando uma interface. A saída da máscara de rede é em hexa:

# ifconfig lan0
 lan0: flags=1843<UP,BROADCAST,RUNNING,MULTICAST,CKO>
 inet 10.19.0.64 netmask fffffff0 broadcast 10.19.0.79

Se quiser obter o Mac-Address das interfaces, utilize o comando lanscan:

# lanscan
 Hardware Station        Dev Hardware Net-Interface   NM  Encapsulation      Mjr
 Path     Address        lu  State    NameUnit State  ID  Methods            Num
 2.0.2    0x08000935C99D 0   UP       lan0     UP     4   ETHER              52

Para verificar velocidade da interface, use o comando lanadmin conforme abaixo:

# lanadmin -x 0
 Speed = 1000 Full-Duplex.
 Autonegotiation = On.
# lanadmin -x 1
 Speed = 1000 Full-Duplex.
 Autonegotiation = On.

Para configurar manualmente a velocidade das interfaces, podemos utilizar o comando lanadmin da seguinte forma:

lanadmin -X modo interface

Onde os modos podem ser:

10fd =10 full-duplex
10hd =10 half-duplex
100fd =100 full-duplex
100hd =100 half-duplex
auto_on

Exemplo para configurar a interface lan0 em 100 full duplex:

lanadmin -X 100fd 0

Mais informações, utilize “man lanadmin”

As configurações de resolução de nome local (hosts) e DNS, ficam nos arquivos /etc/hosts e /etc/resolv.conf respectivamente, assim como no Linux. Se o /etc/resolv.conf não existir, basta criá-lo e configurar da forma tradicional.

Com base nessas informações, é possível criar ums script simples que traga de uma forma resumida as informações que você necessita. Têm vários scripts desses disponíveis na internet.

Para iniciar ou interromper o serviço de rede, utilize o comando abaixo:

/sbin/init.d/net start

ou

/etc/init.d/net start

O arquivo de configuração que o script de redes usa, está localizado em /etc/rc.config.d/netconf. Eis um simples modelo:

HOSTNAME=hpuxlab01
OPERATING_SYSTEM=HP-UX
LOOPBACK_ADDRESS=127.0.0.1
INTERFACE_NAME[0]=lan0
IP_ADDRESS[0]=10.19.0.64
SUBNET_MASK[0]=255.255.255.0
BROADCAST_ADDRESS[0]=""
DHCP_ENABLE[0]="0"

As configurações de rotas permanentes também ficam nesse arquivo, é bem simples e intuitivo, exemplo:

ROUTE_DESTINATION[0]="default"
ROUTE_MASK[0]=""
ROUTE_GATEWAY[0]=10.19.0.65
ROUTE_COUNT[0]=1
ROUTE_ARGS[0]=""
ROUTE_DESTINATION[1]="net 192.168.10.0"
ROUTE_MASK[1]="255.255.255.0"
ROUTE_GATEWAY[1]="192.168.10.225"
OUTE_COUNT[1]="1"

Há a possibilidade de configurar uma interface ou rota manualmente, porém as configurações irão se perder após o reboot ou restart do serviço de rede, ex.:

# ifconfig lan0 10.19.0.64 netmask 255.255.255.0 up

Para adicionar uma rota manualmente, por exemplo uma rota para a rede 192.168.1.0/24, saindo pelo gateway 10.10.10.1:

# route add net 192.168.1.0 netmask 255. 255. 255. 0 10.10.10.1

Para adicionar uma rota default:

# route add default 10.10.10.1

Para verificar as rotas atualmente aplicadas:

# netstat -nr

Para dar um flush e limpar todas as regras presentes atualmente:

# route -f

Mas todas essas configurações mencionadas acima, são bem mais fáceis de serem ajustadas no utilitário SAM.

# sam

===              System Administration Manager (hpuxlab01) (1)                  ┐
 │File View Options Actions                                                Help │
 │                       Press CTRL-K for keyboard help.                        │
 │SAM Areas                                                                     │
 │──────────────────────────────────────────────────────────────────────────────│
 │  Source   Area                                                               │
 │┌───────────────────────────────────────────────────────────────────────────┐ │
 ││ SAM      Accounts for Users and Groups                      ->            ^ │
 ││ SAM      Auditing and Security                              ->              │
 ││ SAM      Backup and Recovery                                ->              │
 ││ SAM      Disks and File Systems                             ->              │
 ││ SAM      Display                                            ->              │
 ││ Kcweb    Kernel Configuration                               ->              │
 ││ SAM      Networking and Communications                      ->              │
 ││ SAM      Partition Manager                                                  │
 ││ SAM      Performance Monitors                               ->              │
 ││ SAM      Peripheral Devices                                 ->              │
 ││ SAM      Printers and Plotters                              ->              │
 ││ SAM      Process Management                                 ->              │
 ││ Other    Resource Management                                ->              │
 ││ SAM      Routine Tasks                                      ->            v │
 │└───────────────────────────────────────────────────────────────────────────┘ │
 │                                                                              │
 └──────────────────────────────────────────────────────────────────────────────┘

Vá até “Networking and Communications”.

┌ ===              System Administration Manager (hpuxlab01) (1)                ┐
 │File View Options Actions                                                Help │
 │                       Press CTRL-K for keyboard help.                        │
 │SAM Areas:Networking and Communications                                       │
 │──────────────────────────────────────────────────────────────────────────────│
 │  Source   Area                                                               │
 │┌───────────────────────────────────────────────────────────────────────────┐ │
 ││ ..(go up)                                                                 ^ │
 ││ SAM      Bootable Devices        ->                                         │
 ││ SAM      DHCPv6                  ->                                         │
 ││ SAM      DNS (BIND)              ->                                         │
 ││ SAM      Hosts                   ->                                         │
 ││ SAM      NIS                                                                │
 ││ SAM      NIS+                    ->                                         │
 ││ SAM      Name Service Switch                                                │
 ││ SAM      Network Interface Cards                                            │
 ││ SAM      Network Services                                                   │
 ││ SAM      Networked File Systems  ->                                         │
 ││ SAM      Routes                                                             │
 ││ SAM      System Access           ->                                         │
 ││ SAM      Virtual LAN                                                      v │
 │└───────────────────────────────────────────────────────────────────────────┘ │
 │                                                                              │
 └──────────────────────────────────────────────────────────────────────────────┘

Agora escolha o que você deseja modificar, no exemplo abaixo, selecionei Routes, marquei a rota default e utilizei o tab para ir até as ações:

┌ ===                          Routes (hpuxlab01) (1)                           ┐
 │File View Options Actions                                                Help │
 │                  │ Add Default Route...         │elp.                        │
 │Routing           │ View Auto Configured routes  │                            │
 │──────────────────│ ============================ │────────────────────────────│
 │  Destination   Ga│ Modify Default Route...      │                            │
 │┌─────────────────│ Remove Default Route         │──────────────────────────┐ │
 ││ default         └──────────────────────────────┘                          ^ │
 ││                                                                             │
 ││                                                                             │
 ││                                                                             │
 ││                                                                             │
 ││                                                                             │
 ││                                                                             │
 ││                                                                             │
 ││                                                                             │
 ││                                                                             │
 ││                                                                             │
 ││                                                                             │
 ││                                                                             │
 ││                                                                           v │
 │└───────────────────────────────────────────────────────────────────────────┘ │
 │                                                                              │
 └──────────────────────────────────────────────────────────────────────────────┘

Espero ter ajudado.

HP-UX – Rosetta Stone for Unix (Parte 2)

Dando continuidade à publicação dos comandos, segue agora de HP-UX:

TASK \ OS HP-UX OS / TASK
OS notes Hewlett-Packard OS notes
administrative GUI sam

smh (11.31+)

administrative GUI
managing users useradd
userdel
usermod
getprpw
modprpw
pwget
managing users
TASK \ OS HP-UX OS / TASK
list hardware configuration ioscan
dmesg (if you’re lucky)
adb
model
stm (from the SupportPlus CDROM)
bdf (like most vendors’ df)
getconf
machinfo (11.23+)
print_manifest
list hardware configuration
unique id useful for licensing uname -i unique id useful for licensing
show/set
EEPROM/NVRAM
values
setboot
stm
show/set
EEPROM/NVRAM
values
add device without reboot inf -e
ioscan -fnC devtype;
insf -C devtype
add device without reboot
remove device rmsf remove device
tape device /dev/rmt/0m tape device
stdin/ stdout/ stderr ? stdin/ stdout/ stderr
X kvm config itemap X kvm config
TASK \ OS HP-UX OS / TASK
read a disk label scsimgr (11.31+)
diskinfo
pvdisplay
read a disk label
whole disk in partition ? whole disk in partition
label a disk pvcreate label a disk
partition a disk smh (11.31+)
lvcreate
sam
partition a disk
TASK \ OS HP-UX OS / TASK
kernel /hpux (9)
/stand/vmunix (10+)
kernel
show/set kernel parameters smh (11.31+)
sam
sysdef
kmtune (11+)
kctune (11.23+)
getconf
show/set kernel parameters
limit physical memory ? limit physical memory
loaded kernel modules kmadmin -s
kcmodule -a (11.23+)
loaded kernel modules
load module kmadmin -L
kcmodule module=loaded (11.23+)
load module
unload module kmadmin -U
kcmodule module=unused (11.23+)
unload module
make disk bootable mkboot make disk bootable
startup scripts /etc/rc* (9)

/etc/rc.config.d (preferred)
/sbin/rc* (10+)
/sbin/init.d/

startup scripts
start/ stop/ config services ? start/ stop/ config services
shutdown (& power off if possible) shutdown -yh 0 shutdown (& power off if possible)
run levels 1
*=normal states
for more detail
see

www.phildev.net/runlevels.html
0: shut down
s,S: single-user
1: sys admin
2: multiuser
3*: share NFS
4*: start GUI
5: user-defined
6: user-defined
run levels 1
*=normal states
for more detail
see

www.phildev.net/runlevels.html
show runlevel 1 who -r show runlevel 1
time zone info /usr/lib/tztab time zone info
check swap space swapinfo check swap space
bind process to CPU psrset -b
mpsched -c
intctl
bind process to CPU
TASK \ OS HP-UX OS / TASK
“normal” filesystem hfs
vxfs (11.0+)
“normal” filesystem
volume-based filesystem jfs (vxfs)
LVM
VxVM ($)
volume-based filesystem
file system
description
/etc/checklist
(9)
/etc/fstab
(10+)
file system
description
volume manipulation vg*; lv*; pv*
extendfs
fsadm
volume manipulation
create filesystem mkfs
newfs
create filesystem
file system debugging and recovery fsck
fsdb
file system debugging and recovery
create non-0-length empty file prealloc create non-0-length empty file
convert DOS-format text to Unix format dos2ux convert DOS-format text to Unix format
mount CDROM pfs_mountd
pfsd
pfs_mount
mount /dev/dsk/cxtydz4
/SD_CDROM

mount -orr /dev/cdrom /mnt/cdrom (requires “Rock Ridge extension” patches, 11+)

mount CDROM
eject CDROM ? eject CDROM
create/mount ISO image nohup pfs_mountd&;
nohup pfsd&;
pfs_mount -t iso9660 -x unix pathToIso mountPoint
create/mount ISO image
ACL management lsacl
chacl
getacl
setacl
ACL management
Fibre Channel / SAN scsimgr (11.31+)
fcmsutil
fcdlist
tdutil
tdlist
tddiag
Fibre Channel / SAN
TASK \ OS HP-UX OS / TASK
NFS share definitions /etc/exports
/etc/dfs/dfstab (11.31+)
NFS share definitions
NFS share command exportfs -a
share (11.31+)
shareall (11.31+)
share_nfs (11.31+)
NFS share command
NFS information nfsstat NFS information
name resolution order /etc/nsswitch.conf name resolution order
show network interface info nwmgr (11.31+)
lanadmin
landiag
lanscan
netstat -in
ifconfig lanx
show network interface info
change IP /sbin/set_parms initial
ifconfig
change IP
start DHCP client ? start DHCP client
ping one packet ping hostname 10 1 (9)
ping hostname -n 1 (10+)
ping one packet
sniff network nettl
netfmt
sniff network
route definitions /etc/rc.config.d/netconf
netstat -r
route definitions
telnetd, ftpd banner /etc/inetd.conf (telnet) telnetd, ftpd banner
set date/time
(from net: ntp or other)
ntpdate set date/time
(from net: ntp or other)
TASK \ OS HP-UX OS / TASK
auditing audisp
audevent
audomon
audsys
auditing
encrypted passwords in /etc/passwd (not Trusted)
/.secure/etc/passwd (Trusted 9)
/tcb/files/auth/
(10+)
/etc/shadow (11.22+)
encrypted passwords in
min password length /etc/default/security min password length
allow/deny root
logins
 /etc/securetty allow/deny root
logins
firewall config /etc/opt/ipf/ipf.conf firewall config
TASK \ OS HP-UX OS / TASK
show installed software rmfn, what (HP-UX 9)
swlist (HP-UX 10+)
swm list (11.31+)
show installed software
file is in which package swlist -l file | grep file file is in which package
add software swm install (11.31+)
swinstall
add software
precompiled binaries of GPLware and freeware hpux.cs.utah.edu

hpux.connect.org.uk

precompiled binaries of GPLware and freeware
C compiler /opt/softbench/bin/cc ($)
/bin/cc (9)
/usr/bin/cc (10+; not necessarily ANSI; kernel builder only)
C compiler
show patch level
and/or patches
swm list (11.31+)
swlist -l product |
grep PHsomeString
show patch level
and/or patches
patch tool update (9)
swinstall (10+)
patch tool
configure/show
runtime linking
fortran-2000.com/
ArnaudRecipes/
sharedlib.html
chatr
ldd (11+)
kmadmin
configure/show
runtime linking
fortran-2000.com/
ArnaudRecipes/
sharedlib.html
link library path $LD_LIBRARY_PATH
(64-bit)
$SHLIB_PATH
(32- or 64-bit)
link library path
tracing utility caliper fprof
caliper ktrace
trace (freeware)
tusc (11+, freeware)
tracing utility
define user defaults /etc/default
/etc/PATH
/etc/MANPATH
/etc/default/*
define user defaults
csh global .login /etc/csh.login csh global .login
default syslog and messages /var/adm/syslog/syslog.log
/var/adm/sulog
/var/spool/mqueue/syslog
default syslog and messages
system error reporting tool evmshow (11.31+)
smh (11.31+)
dmesg
sysdiag (9 and early10)
stm/cstm/mstm/xstm (10.20+)
EMS (from support CD)
system error reporting tool
performance monitoring glance
gpm
caliper
top; sar; vmstat;
iostat; nfsstat; netstat;
uustat; Glance($)
ptree (11.31+)
performance monitoring
match process to file or port lsof
fuser
match process to file or port
collect various logs ? collect various logs
X pop-up /usr/dt/bin/dterror.ds X pop-up
Wikipedia HP-UX Wikipedia
FAQs (see also faqs.org) www.faqs.org/faqs/
hp/hpux-faq/preamble.html
FAQs (see also faqs.org)
mailing list hpux-admin@
dutchworks.nl

(majordomo)
hp-ux-l
mailing list
mailing list archives www.dutch
works.nl/
htbin/hpsysadmin
mailing list archives
man pages

www.freebsd.org/
cgi/man.cgi

docs.hp.com/en/hpuxman_pages.html
hpuxman_pages.html
man pages

www.freebsd.org/
cgi/man.cgi

newsgroup(s) and forums
groups.google
comp.sys.hp.hpux newsgroup(s) and forums
groups.google
user groups connect-community.org
hp-interex.com
encompassus.org
hptechnologyforum.com
forums.itrc.hp.com
HP DSPP
user groups
magazines www.hpchronicle.com
www.interex.org/hpuxusr
www.hppro.com
magazines
vendor home page hp.com/go/hpux vendor home page
vendor docs and patches (see also man pages) software.hp.com
docs.hp.com
itrc.hp.com
vendor docs and patches (see also man pages)
vendor phone (US) 800-633-3600 vendor phone (US)
wikis ? wikis

HP-UX – Criando a estrutura de um VG “na mão”!

1 – Entre no /dev
# cd /dev

2 – Crie um diretório com o nome do VG (chamaremos, no exemplo, de: novovg):

# mkdir novovg 3 -Crie o device character chamado group, dentro do diretório criado acima:

* Importante, é necessário saber: – major: número do device driver; – minor: localização do device.

# mknod group c 64 0x010000

Pronto! Você criou a estrutura o VG na raça!

HP-UX – Inicializar um disco para utilizá-lo com LVM

Antes de adicionar um disco em algum logical volume é necessário inicializá-lo criando um device não buferizado (raw device) – um volume físico.
O comando pvcreate cria um volume físico para uso em LVM.

1 – Procure pelo disco com ioscan: # ioscan -fnC disk Class I H/W Path Driver S/W State H/W Type Description ==========================================================

disk 0 0/0/1/1/0.0.0 sdisk CLAIMED DEVICE HP 73.4GMAT3073NC

/dev/dsk/c0t0d0 /dev/rdsk/c0t0d0

disk 0 0/0/1/1/0.1.0 sdisk CLAIMED DEVICE HP 73.4GMAT3073NC

/dev/dsk/c0t1d0 /dev/rdsk/c0t1d0

 

2 – Inicializaremos o /dev/rdsk/c0t1d0:

# pvcreate -f /dev/rdsk/c0t1d0

Pronto! O disco está pronto para ser adicionado à um Volume Group!