Sunteți pe pagina 1din 5

AIX for System Administrators

http://aix4admins.blogspot.mx/2011/05/network-configuration-at-boot-t...

PAGEVIEW S

Commands

620,264
NETWORK CONFIGURATION AT BOOT TIME: 1. /etc/rc.net Configures and starts TCP/IP interfaces. Sets hostname, default gateway and static routes.(it is called by cfgmgr) then during initialization the file /etc/inittab is called. There are 2 entries: ... rctcpip:23456789:wait:/etc/rc.tcpip > /dev/console 2>&1 # Start TCP/IP daemons rcnfs:23456789:wait:/etc/rc.nfs > /dev/console 2>&1 # Start NFS Daemons ... 2. /etc/rc.tcpip starts TCP/IP daemons (sendmail, portmap, inetd, etc., and other daemons: syslogd, lpd ...) 3. /etc/inetd.conf when inetd started, it reads its configuration from this file contains the name of the services that inetd listens for requests and starts as needed PORTMAP DAEMON: The portmap daemon converts remote procedure call (RPC) program numbers into Internet port numbers. (like in the case of NFS) When an RPC server starts up, it registers with the portmap daemon. The portmap daemon knows the location of every registered port on the host and which programs are available on each of these ports. When a client sends an RPC to the server, the portmap daemon answers to the client which port to send the call to. Portmap daemon listens on port number 111. It is started from /etc/rc.tcpip before inetd and the RPC servers (e.g. nfs). Thus, when the RPC servers start they can register with portmap.
ABOUT

FS - LVM FS LV Mirror Pool PV VG

GENERAL AIX History Backup Commands CPU - Processes Crontab - At Date - Time Devices Dump - Core Errpt - Diag - Alog Syslogd

INETD DAEMON: The /usr/sbin/inetd daemon provides Internet service management for a network. It reduces system load by invoking other daemons. The inetd daemon listens for connections on certain Internet sockets (info in /etc/inetd.conf) and handles those requests. The inetd daemon is a subsystem that controls the following daemons (subservers): ftpd, fingerd, talkd, telnetd ... /etc/inetd.conf inetd configuration file (if changed by an editor, run refresh -s inetd) smitty inetd updates automatically the /etc/inetd.conf lssrc -ls inetd shows details of subservers started in inetd stopsrc -s inetd stops the inetd daemon stopsrc -t ftp stops an inetd subserver -----------------------NAME RESOLUTION:

Firmware IO - AIO, DIO, CIO Memory - Pag.Space ODM Printing SRC Startup - Shutdown System - Kernel Tunables User - Group User Login

HACMP - POW ERHA

You can use several methods to ensure that /etc/hosts file is used before any You can include the NSORDER variable in the /etc/environment file, or you can file or the /etc/netsvc.conf file. The settings in the /etc/netsvc.conf configuration file override the settings variable overrides the settings in the /etc/irs.conf and the /etc/netsvc.conf

DNS, if the /etc/resolv.conf file exists. include a specification line in either the /etc/irs.conf in the /etc/irs.conf file. The NSORDER environment files.

Appl. Monitor Basics Build - Configure Clverify Commands - Cases

Domain Name Service (DNS): /etc/resolv.conf contains name servers, if this file exists then we have a domain network, if not then /etc/hosts file is used /etc/netsvc.conf specify the ordering of name resolution (or NSORDER environment variable can contain this) (if both exists NSORDER will override netsvc.conf) bind=DNS, local=/etc/hosts pl.: NSORDER=local,bind

Config too long DARE - Snapshot Disk Heartbeat Storage - VG, NFS

HMC - ISD

<--this can be added to /etc/envronment

ASMI HMC Basics - Console HMC CLI

The /etc/netsvc.conf and /etc/irs.conf files are used by the resolver routines as soon as the files exist /etc/netsvc.conf configuration: hosts=local,bind

HMC/P7 Install ISD Basics RMC

/etc/irs.conf configuration: hosts local continue hosts dns

NETW ORK Basics - Devices, Routing Basics - Protocol, Subnet Basics - Vlan

nslookup <server name>

responds similarly to the host command, but it only uses DNS (don't NIS and don't /etc/hosts)

Flat Network: /etc/hosts contains host <hostname> searches host <ip address> searches To work properly both should give ------------------------

Commands

the hostnames and their address for hosts in the network through the /etc/hosts file, and display the ip address of the hostname through the /etc/hosts file, and display the hostname the same result.

Eth. Chan. Ethernet Adapter IVE - HEA Netcd NFS RSH - RCP

ADDRESS RESOLUTION: Internet-to-physical address (MAC address) arp -a shows the ARP table the manual of arp command can help -----------------------VERIFYING OPEN PORTS: To display TCP/IP application ports (which are opened) netstat -an lists of opened ports with port numbers (netstat -an -f inet) netstat -af inet lists all open UDP and TCP ports with service names (not the port numbers) server ports are in LISTEN state, client connections to or from any port are in ESTABLISHED state /etc/services contains information about known services and their portnumber (if changing this file: refresh -s inetd)

Sendmail SSH - SCP SSH - X11 Telnet - FTP

NIM Basics Install LPP Source Machines MKSYSB Nimadm SPOT

1 of 5

04/05/2013 23:10

AIX for System Administrators

http://aix4admins.blogspot.mx/2011/05/network-configuration-at-boot-t...

PERFORMANCE

-----------------------ROUTING lsattr -El inet0 netstat -rn shows routings in the inet0 (which is a netwotk device in the kernel (config info for inet0 is stored in the odm) (you can check with this as well: odmget -q attribute=route CuAt) shows the routing table. (-r: displays routing statistics, -n: displays the network address as an IP address)

Basics CPU I/O - Disk, Adapter Memory Network svmon - RAM topas - nmon

In the routing table: U - route is up and available H - route is to a host G - route is to a gateway b - route represents a broadcast address S - manually added??? (Static route: it will come back after reboot???) A - Active Dead Gateway Detection is enabled on the route Check both places: netstat -nr and lsattr -El inet0 (odmget -q "attribute = route" CuAt)

vmstat - CPU/RAM VMM concepts VIO

STORAGE Adapter Basics - SAN Basics - Settings EMC

Commands: chdev smitty route route <--permanent: it will modify inet0 with the new route, it registers a new entry in the ODM <--permanent: it calls the command chdev (Destination, Gateway and Netmask should be filled) <--temporary: this is valid only until next reboot (does not update the ODM)

Hitachi HP EVA - SSA MPIO SDD

UPDATE - INSTALL

ADD/REMOVE with chdev: (permanent) (when default route is added it can be network route, dest. addres is 0.0.0.0 and network mask can be 0.0.0.0) (we can add interface name as well, if omitted system will add 1)

Basics Commands IFIX

add: chdev -l inet0 -a route=net,-hopcount,0,,0,100.200.200.65 chdev -l inet0 -a route=0,<default gw address> <-this will add the default route remove: first check lsattr -El inet0, and copy a line exactly from the output into " ...": chdev -l inet0 -a delroute="net,-hopcount,0,-netmask,255.255.0.0,-if,en4,,,,50.20.0.0,50.50.80.3" chdev -l inet0 -a delroute="net,-hopcount,0,,0,100.200.200.65" chdev -l inet0 -a delroute="net,-hopcount,0,-netmask,255.255.255.240,,,,,-static,50.20.100.80,10.10.3.1" -----------------------ADD/REMOVE with route: (temporary) add: route add route add $GATEWAY) route add route add route add route)

VIO Basics Commands AME - AMS CDROM - DVDROM LPM NIB - LA NPIV SEA Shared Storage Pool VIOS update/upgrade Virt. Eth. Ad. Virt. Proc.-Ent. Cap.

0 9.19.99.11 <--adds default route (0 really stands for 0.0.0.0) -net 100.100.243.0 -netmask 255.255.255.0 100.100.200.209 <--adds network route (route add -net $NETW -netmask $NETMASK -net 9.19.99/22 9.19.98.11 -host 50.200.100.31 50.200.100.20 10.200.40.28 10.200.40.1 -active_dgd <--adds network route without netmask <--adds host route <--sets dead gateway detection on that route (netstat -nr shows: A if enabled on a

VSCSI VSCSI - Stor. Pool

+EXTRAS +others alt_disk awk - sed

remove: route delete 50.20/22 50.50.80.3 route delete 0 9.19.99.11 route -f mkdev -l inet0

bash

<--keeps in the ODM <--deletes only the deafult route

citrix java kdb ksh

clear the routing table (except those created implicitly) it will recreate the routes which exist in the ODm (inet0) (it can help, if it was deleted manually)

locale multibos

The route command distinguishes between routes to hosts and routes to networks by interpreting the network address of the destination address. The optional keywords -net and -host force the destination to be interpreted as given. If there are more routes (duplicate routes) on host A, you can have some packet loss, when you ping host A from host B. On host A if you issue many times: route -n get <host B>, you will see interface names (enX) will change, this is due to bad routing)

perl profiles rbac Rsh samba screen

For Static routes a solution would be: (instead of using chdev and ODM checking) 1. add the routes with route command 2. Put the routes into /etc/rc.net file (with the same route command) Look for "Part II - Traditional Configuration," and you will see an area in which you can add routes This way, you have a flat file that is easily modified, contains the route information in a straightforward way, and doesn't manipulate the ODM. To remove all the routes: (routing table + ODM) /etc/route -n -f and odmdelete -o CuAt -q "name=inet0 and attribute=route"

script sudo vi

-----------------------chdev - changes are effective immediately and across boots ifconfig, route - changes are active immediately and are effective until reboot ------------------------

DIFFERENT INTERNET SERVICES: ARPANET secure (not powerful) Remote login: Remote execue: File Transfer: telnet rexec ftp BERKLEY powerful (not secure) rlogin/rsh rsh rcp SECURE SHELL secure and powerful ssh ssh sftp/scp

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

OTHER COMMANDS: smitty inet smitty tcpip smitty mktcpip smitty hostname lsdev -Cc adapter lsdev -Cc if lsattr -EHl en0

configuring interfaces configuring TCP/IP on 1 page you can set: hostname, default gateway, netmask... sets the hostname (chdev -l inet0 -a hostname=<name>) lists adapters lists interfaces lists attributes (ez is mxik: lsattr -EHl ent0)

2 of 5

04/05/2013 23:10

AIX for System Administrators

http://aix4admins.blogspot.mx/2011/05/network-configuration-at-boot-t...

lscfg -vpl <device> ifconfig ifconfig -a ifconfig en0 ifconfig en0 up

shows vital product data (e.g. lscfg -vpl ent0) configure and modify properties of network interfaces displays information about all interfaces (should be UP and RUNNING) shows attributes of a specific interface (lo0:loopback, en0:ethernet...) activates network interface (... down: deactivates it)

ifconfig en1 50.20.100.47 netmask 255.255.255.192 ifconfig en3 10.200.30.106 netmask 255.255.255.0 alias ifconfig en3 10.200.30.106 netmask 255.255.255.0 delete chdev chdev chdev chdev no -a -l -l -l -l en8 en1 en3 en9 -a -a -a -a

configure ip (or ifconfig en0 x.x.x.x netmask y.y.y.y up) configure alias (ifconfig makes changes only until reboot) deletes ip from interface en3

netaddr=50.20.80.4 changes the ip on en8 netaddr=12.10.10.2 -a netmask=255.255.255.0 -a state=up alias4=10.10.6.26,255.255.255.0 adds alias to en3 (last after reboot as well) delalias4=10.200.200.136,255.255.255.224 removes an alias (this works as well: ifconfig en1 delete 9.37.207.29) lists network tuning parameters

ping -c 1 <hostname> sends only 1 packet ping -f <hostname> floods out packets (it is good for testing the network for handling a lot of traffic) ping -s <packet size> <hostname> specifies the number of bytes to be sent rpcinfo -d <pid> deletes registration of a service (clears up the port?)

spray <hostname> -c 100 -l 50 -d 1 sends a specified number of packets to a host (performance statistics) it uses RPC which is higher level then ICMP (higher layer than ping) sprayd must be run in host to get respond (inetd.conf) -c number of packets to send -l the size of a packet -d delay time (in microseconds) between sending the packets -i sends ICMP package not RPC netstat netstat netstat netstat netstat netstat netstat netstat netstat -rn shows the routing table -in shows the MAC addresses (and IP addresses) of all interfaces -v shows device driver information -v ent2 shows statistical information (it uses entstat, e.g. it is similar to entstat -d ent2) -v |grep Media shows running speed (100Mbs..., Full duplex) (netstat -v | egrep "ETH|Media|Speed|Link") -p udp display UDP transport statistics (dropped, socket buffer overflow) -p tcp display TCP transport statistic (retransmitted: it means cannot ACK before timeout, duplicate packets) -I en0 2 shows traffic across that interface in 2 seconds intervals -an display the status of connections to host shows info which interface, gateway ... is used to reach the ip shows each router the packets travel through to reach the target host +with the min., average, max. response time taken to get to that router (* means probe to the next router timed

route get traceroute

out) traceroute <ip> <size> packet size can be added as well (once this was successful:traceroute 100.200.140.55 1456, but with 1457 it wasn't) arp -an shows the routing table without name resolution -----------------------tcpdump tcpdump tcpdump tcpdump tcpdump tcpdump -i -i -n -i -i -i en0 icmp it will only watch the icmp (ping) traffic on the given interface en1 host 50.50.30.8 displays the traffic of en1 which is coming from or going to the given host -i en1 host 50.50.30.8 it is the same as above, just without name resolution (more simplified) en2 dst host <host> show only data being sent to a specific host en2 src host <host> show only packets coming from a specific host en2 host <host> port 22 show packet destined for or sent by a specific host on a specific port

tcpdump -w test.pcap -i en4 host 10.120.0.13 shows network traffic (if -w omitted it displays the results on the screen) -w writes details to file test.pcap (it is not a text file, wireshark can understand it) -i checks traffic only on specified interface host only the communication from the given host will be watched

-----------------------iptrace same as tcpdump (tcpdump better)

iptrace usage: 1. iptrace -a -i en1 -s clientip -b -d serverip -p 80 trace.out this will capture both directions on port 80 traffic to file trace.out 2. generate a test, then run: ps -ef | grep iptrace --> kill -15 <pid> 3. ipreport trace.out>trace.fmt (after this trace.fmt can be read by wireshark)

uname -n no -o ipforwarding

display the hostname (-x: displays operating system realease number...) shows if the host fowards IP datagrams or not (0=not, 1=yes; to change it: no -o ipforwarding=<value>) Hosts should not forward IP datagrams unless specifically configured as a router -----------------------Hostname setting: hostname <any name> changes the hostname until next reboot chdev -l inet0 -a hostname=<name> permanent change -----------------------Who is using my port? 1. netstat -Aan | grep <port number> <-- shows if the specified <port number> is being used. The hex number in the first column is the address of protocol control block (PCB) $ netstat -Aan | grep 30542 f10000f303321b58 tcp4 0 0 *.30542 *.* LISTEN

2. rmsock <addr of PCB> tcpcb

<-- This shows the process (PID) who is holding the socket. (should be runas root)

$ rmsock f10000f303321b58 tcpcb The socket 0x3321800 is being held by proccess 692476 (db2sysc). Note that rmsock, unlike what its name implies, does not remove the socket, if the socket is being used by any process. It just reports the process holding the socket. The second argument of rmsock is the protocol. (tcpcb in the example indicates TCP.) ------------------------

Labels: NETWORK

12 comments:

3 of 5

04/05/2013 23:10

AIX for System Administrators

http://aix4admins.blogspot.mx/2011/05/network-configuration-at-boot-t...

Anonymous September 20, 2012 at 9:01 PM Hi, what is hopcount in route add entry. Also explain the entries available in route addition command "net,-hopcount,0,,0,100.200.200.65" Reply Replies aix September 20, 2012 at 10:25 PM Hi, "man route" says about hopcount: -hopcount n Specifies maximum number of gateways in the route. That example what you gave I usually get from "lsattr -El inet0", and I copy that line without modification to i.e. delroute. But for decoding it, I guess the first 0 after hopcount relates to hopcount and the second 0 means default gateway (it can be translated to 0.0.0.0)

Reply

Anonymous March 19, 2013 at 10:23 PM Good information Reply Replies aix March 19, 2013 at 11:25 PM :-)

Reply

Sri March 29, 2013 at 2:44 PM

Reply

Sri March 29, 2013 at 4:36 PM

Reply

Anonymous March 29, 2013 at 4:51 PM Hi, I have to add new IP/second IP(124.23.43.22) as the loopback interface, I have settings like below.. [/]# ifconfig lo0 lo0: flags=e08084b,c0 inet 127.0.0.1 netmask 0xff000000 broadcast 127.255.255.255 inet6 ::1%1/0 tcp_sendspace 131072 tcp_recvspace 131072 rfc1323 1 ================== Please let me know the command (as permanent and temporary) to add new IP/second IP as the loopback interface Reply

Sri March 29, 2013 at 5:30 PM How to add new ip to the loopback interface lo0 as permanent ? Thanks, Sri Reply

Anonymous March 29, 2013 at 6:32 PM What is the command to add new ip to the loopback interface lo0 as alias and it should be permanent Reply Replies aix March 29, 2013 at 11:17 PM This command should work: ifconfig lo0 alias netmask 255.255.255.255 To make this permanent, I would add this to inittab or to an rc script (/etc/rc.d/rc2.d) so at boot time this alias would be configured. (I checked around on the net, and I saw netmask 255.255.255.255 was used many times with lo0, so probably there is a reason for this.)

Reply

Anonymous March 31, 2013 at 7:08 AM thanks, but can u pls tell me how to add this to inittab or to an rc script to make it permanent... ? or Can't we make this permanent to use the command chdev or through smitty ? Reply Replies aix March 31, 2013 at 9:14 AM I made a typo, correct command should look like: ifconfig lo0 alias ip_address netmask 255.255.255.255 (chdev would be a good solution, just for lo0 device it doesn't work)

I think easiest would be in your case to add this command to /etc/rc.net file. You can read more about that: http://pic.dhe.ibm.com/infocenter/aix/v7r1/index.jsp?topic=%2Fcom.ibm.aix.files%2Fdoc%2Faixfiles%2Frc.net.htm (If you add things to that file, in case you do an OS upgrade, there is a chance you modifications will be lost, so document them very well.)

Reply

4 of 5

04/05/2013 23:10

AIX for System Administrators

http://aix4admins.blogspot.mx/2011/05/network-configuration-at-boot-t...

Comment as:

Newer Post Subscribe to: Post Comments (Atom)

Home

Older Post

Template images by Storman. Powered by Blogger.

5 of 5

04/05/2013 23:10

S-ar putea să vă placă și