COMANDOS SOLARIS Y LINUX
Para ver qué paquetes hay que desinstalar
$ pkginfo | grep -i apache
Obteniendo los paquetes instalados:
Buscar los paquetes instalados en el sistema que tienen como nombre
gaimsomething
es sencillo utilizando el siguiente comando:
$ dpkg --get-selections 'gaim*'
Buscar paquetes que contienen un archivo:
A veces usas binarios y quieres saber que paquete los contiene.
Tomemos como ejemplo gaim, buscando el archivo que contenga bin/gaim
sería:
$dpkg -S bin/gaim
Obteniendo todos los archivos instalados por un paquete:
Una vez que un paquete ha sido instalado, puedes ver todos los archivos
que han sido
instalados por el paquete con el siguiente comando:
$dpkg -l gaim´
http://dlc.sun.com/osol/docs/content/SYSADV5/cnis1-55.html
1. pkg-get
O bien puede buscar información y dar con un administrador de paquetería
claramente inspirado en apt-get: pkg-get (si, el nombre es muy ingenioso
Primero nos aseguraremos de cumplir las dependencias:
pkginfo -i | grep -i bzip
pkginfo -i | grep -i wget
Lo más probable es que tenga los dos paquetes instalados. En caso
contrario
descargeselos (por ejemplo de este repositorio:
http://www.gigaload.org/blastwave.org/stable )
e instálelos
pkgadd -d /path/de/los/ficheros.pkg
Luego instalaremos el paquete pkg-get
pkgadd -d /path/completo/pkg_get.pkg
El siguiente paso es añadir al PATH el directorio de instalación del
nuevo
administrador de paquetes; /opt/csw/bin
Ahora indicaremos al fichero de configuración el o los repositorios que
deseamos utilizar.
Para ello editamos el fichero /opt/csw/etc/pkg-get.conf y añadimos las
lineas en formato
"url=http://servidor/directorio"
Yo utilizo el servidor Blastwave para buscar los mirrors más cercanos
geográficamente. http://www.blastwave.org/mirrors.php
El siguiente paso es actualizar la lista local de los paquetes
disponibles.
pkg-get -U
Para buscar un paquete concreto utilizaremos el comando:
pkg-get -l | grep -i paquete
Y para saber mucho más:
man pkg-get
PRÁCTICA DE CONFIGURACIÓN DE TCP/IP EN ESTACIONES LINUX Y SOLARIS
1. Ver configuración de red
Muestra el nombre de la estación
Linux Solaris
#hostname #hostname
Muestra la dirección IP de la (s) interface(s) de red
Linux Solaris
#ifconfig #ifconfig -a
1. Configuración para la resolución de nombres:
Archivos relacionados
Linux Solaris
Lista de hosts conocidos: /etc/hosts Configuración de la resolución de nombres:
/etc/host.conf Dominio y Servidor de nombres: /etc/resolv.conf
1. Tabla de enrutamiento:
Visualiza la tabla de enrutamiento de la estación
Linux Solaris
#route #netstat –r
1. Configuración de las interfaces
Asignar dirección IP a una interfaz de red (eth0/hme0)
Linux Solaris
#ifconfig eth0 IP netmask MASCARA up #ifconfig hme0 IP netmask MASCARA up
Desactivar una interfaz de red
Linux Solaris
#ifconfig eth1 down #ifconfig hme0 down
Activar una interfaz de red
Linux Solaris
#ifconfig eth1 up #ifconfig hme0 up
1. Configurando la Tabla de enrutamiento:
Asignar Ruta por defecto (gateway)
Linux Solaris
#route add default gw IP #route add default IP
Eliminar Ruta por defecto (gateway)
Linux Solaris
#route del default #route delete default IP
1. Monitoreo de Conexiones activas (puertos activos)
Visualiza los puertos tcp y udp que estén activos
Linux Solaris
#netstat -a [n] #netstat -a [n]
1. Monitoreo de nodos y enlaces
Envía un mensaje a un host y espera el echo
Linux Solaris
#ping HOST #ping HOST
Muestra cada uno de los saltos que se recorren hasta llegar a un host
Linux Solaris
#traceroute HOST #traceroute HOST
Solaris Network configuration
Setting up Solaris networking often becomes challenging for the new sysadmins and new
owners of Sun systems . This document details the steps involved in setting up of Solaris
networking and can be used as a check list if you are already familiar with Solaris network
configuration .
Table of contents :
1. Enable the network card
2. Configuring ipaddress and netmask and making the interface status as up .
3. Configuring Virtual interface :
4. Ip-forwarding
5. Router Configuration
6. Network Terms
7. Next Steps
Ifconfig command is used in Solaris to configure the network interfaces . The following
lines describes the activities needed to configure a freshly installed network card from the
root prompt .
1. Enable the network card
#ifconfig hme0 plumb
ifconfig -a command should show following type of output which means device is enabled
and is ready to configure ip address and netmask :
hme0: flags=842 mtu 1500
inet 0.0.0.0 netmask 0
ether 3:22:11:6d:2e:1f
2. Configuring ipaddress and netmask and making the interface status as up .
#ifconfig hme0 192.9.2.106 netmask 255.255.255.0 up
#ifconfig -a will now show the ip address , netmask and up status as follows :
hme0: flags=843 mtu 1500
inet 192.9.2.106 netmask ffffff00 broadcast 192.9.2.255
ether 3:22:11:6d:2e:1f
The file /etc/netmasks is used to define netmasks for ip addresses .
127.0.0.1, is the standard loop back route and 127.0.0.0 is the default loopback ipaddress
used by the kernel when no interface is configured this will be the only entry displayed by
the system on invoking ifconfig -a command..
3. Configuring Virtual interface
Virtual interface can be configured to enable hme0 reply to more then one ip addresses.
This is possible by using hme0 alias which can be configured by ifconfig command only .
The new alias device name now becomes hme0:1 hme:2 etc.
#ifconfig hme0:1 172.40.30.4 netmask 255.255.0.0 up
ifconfig -a will show the original hme0 and alias interface :
hme0: flags=843 mtu 1500
inet 192.9.2.106 netmask ffffff00 broadcast 192.9.2.255
ether 3:22:11:6d:2e:1f
hme0:1: flags=842 mtu 1500
inet 172.40.30.4 netmask ffff0000 broadcast 172.40.255.255
4. Ip-forwarding
IP forwarding allows you to forward all requests coming for a certain port or URL to be
redirected to a specified IP address.
ip forwarding becomes enabled automatically when system detects more then one interface
at the booting time . The file involved is /etc/rc2.d/S69inet .
ipforwarding is on by default but can be turned off by following command :
#ndd -set /dev/ip ip_forwarding 0
5. Router Configuration
After interfaces and ipaddess have been configured the system needs a default router which
will allow the machine to talk to world outside of local network .
You can specify a particular route for a particular address as in following example
#route add -net 10.0.0.0 -netmask 255.0.0.0 172.40.30.1 1
if the the destination ipaddess is not defined in this manner system forwards all requests to
the default router .
default route is defined manually by editing /etc/defaultrouter file and putting router’s
ipaddress entry in it. This file is read by /etc/rc2.d/S69inet file during the booting process
and entry added to the routing table .
The route can be defined online also using routeadd command but the changes will be lost
on reboot .To make changes permanent make sure to put an entry in /etc/defaultrouter.
#route add default 205.100.155.2 1
#route change default 205.100.155.2 1
The 1 at the end is the number of hops to the next gateway.
If an interface is not responding to the network, check to be sure it has the correct IP
address and netmask , network cables are fine .
6. Network Terms
CIDR
CIDR : Classless Inter-Domain Routing – the notation often used instead of writing the
subnet mask along with ip-address . It has network prefix at the end of a address as /
number of network bits.This means that the IP address 192.200.20.10 with the subnet mask
255.255.255.0 can also be expressed as 192.200.20.10/24. The /24 indicates the network
prefix length, which is equal to the number of continuous binary one-bits in the subnet
mask (11111111.11111111.11111111.000000). Zeros are for addressing the hosts on this
network.
VLSM
network can be variably subnetted into smaller networks, each smaller network having a
different subnet mask .This functionality is avaiable in Solaris 2.6 above. the ipaddresses