Monday, December 14, 2009

Add ip in sun machine.

1st chk ip... with
#ifconfig -a
Set hostname in
#vi /etc/nodename
sunsolaris
After that put hostname entry in
#vi /etc/hostname.pcn0 (pcn0 lan card name it depends upon ur hardware conf)
sunsolaris
Then in
#vi /etc/hosts (entry like this)
ip address hostname
save the file nad restart network service.
#svcadm disable /network/physical:default
#svcadm enable /network/physical:default

For temp add ip use following cmd...
#ifconfig hme0 192.168.1.100 netmask 255.255.255.0 up
for interface up and down..
#ifconfig hme0 up
#ifconfig hme0 down

For multipal IP
#vi /etc/hostname.hme0:1
add host name and put entry in /etc/hosts

# vi /etc/defaultrouter :--- your default gateway.
#vi /etc/resolve.conf :- DNS entry

route add, delete, display
for routing enable
#routeadm -e ipv4-forwarding (-d for disable)
(netstat -rn) netstat -rn # show current routes
netstat -rnv # show current routes and their masks
route add destIP gatewayIP
route add destIP -netmask 255.255.0.0 gatewayIP
route delete destIP gatewayIP
route delete destIP -netmask 255.255.0.0 gatewayIP
eg:- #route add -net 30.0.0.0 -netmask 255.0.0.0 -gateway 192.168.1.100

You want to add a static route to network 192.168.16.0 to your default gateway of 10.236.74.1
#route add –net 192.168.16.0 10.236.74.1
then create a script, so that when the system rebooted the route will automatically added
#cd /etc/rc2.d
#vi S168staticroute
Add the following line
route add –net 192.168.16.0 10.236.74.1
You want to add a static route to host 192.168.64.4 to your default gateway of 10.236.74.1
#route add 192.168.64.4 10.236.74.1
then create a script, so that when the system rebooted the route will automatically added
#cd /etc/rc2.d
#vi S168staticroute
Add the following line
route add 192.168.64.4 10.236.74.1
You want to delete the static route to network 192.168.16.0 to your default gateway of 10.236.74.1
#route delete –net 192.168.16.0 10.236.74.1
You want to delete the static route to host 192.168.64.4 to your default gateway of 10.236.74.1
#route delete 192.168.64.4 10.236.74.1
command to restore a system configuration to an unconfigured state,ready to be reconfigured again.when md finished,it perform a syatem shutdown.
#sys-unconfig
POSTED BY RAMAN KUMAR AT 11:04 AM 0 COMMENTS LINKS TO THIS POST
MONDAY, APRIL 14, 2008
NFS (Network Filw System)
Solaris 10 use NFSv4 by default.
NFSv4 features:-- 1) Stateful connection
2) Single protocol,reducing the number of service-side daemons.
3) Improved Firewall support. NFSv4 uses the well-know port 2049.
4)Strong security.
5)Extended attribute.

NFS server files:-
/etc/dfs/dfstab :- list the local resources to share at boot time.
/etc/dfs/sharetab :- rutime read file..(dont edit this file)
/etc/dfs/fstype :- list the default file system type for remote file system.
/etc/rmtab :- list file system remotely mounted by nfs client.
/etc/nfs/nfslog.conf :- list information defining the location of conf logs used for nfs server logging.
/etc/default/nfslogd :- lists conf infomation describing the behaviour of the nfslogd daemon for nfsv2/3
/etc/default/nfs :-- contain parameter value for NFS protocols and NFS daemons.

For e.g #vi /etc/dfs/dfstab
share -F nfs -o rw-192.168.0.203,ro -d "homedir" /share
save file
#mkdir /share
#shareall
#dfshares
service stop,start
NFS server daemons.
#svcadm -v enable nfs/server
#svcs -a grep nfs

NFS server daemons
mountd:- chk /etc/dfs/sharetab file to determine a particular file or dir is being shared and whether the requesting client has permission to access the shared resources.
statd,lockd
nfslogd:- provides operational logging for an NFs server.
nfsd:- handle client file system request.
nfsmapid:- nfs user and group ID mapping daemon, implemented in NFSv4. there is no user interface to this daemon,but parameters can be set in /etc/default/nfs
daemons started by #svc:/network nfs/mapid service

NFS server command.
share,shareall,unshare,unshareall
dfshares:- list available shared resource from a remote or local NFS server.
dfmounts:- Display a list of NFS server dir that are currently mounted.

FRom client side access:-
#mount serverip :/share /test

Enabling NFS server logging.
/etc/default/nfslogd files defines default parameter used for NFS server logging.
server side
#vi /etc/dfs/dfstab
share -F nfs -o rw,log=global /test
save file
#mkdir /test
#vi /etc/nfs/nfslog.conf
add in last logformat=extended
then service stop and start
client side
#mkdir /test1
#mount serverip:/test /test1
cd test1

To see log in server side
#cat /var/nfs/nfslog
How add SWAP Space in sun solaris
How add swap space in solaris.
# swap -l (swap partition)
#swap -s (summary)
#df -h
Two ways are available to add swap space in solaris.
1) swap slices
2) swap files
swap slicesAdd a disk partition as a swap slice to ur existing swap space.
#swap -a /dev/dsk/c0t0d0s1
for delete
#swap -d /dev/dsk/c0t0d0s1
swap files
#df -h
find path where u want create the swap file...after that
#mkdir -p /raman/swap
#mkfile 20m /raman/swap/swapfile
#swap -a /raman/swap/swapfile
verify with
#swap -s or swap -l command
For delete swap space
#swap -d /raman/swap/swapfile
#rm /raman/swap/swapfile

In above both cases,to make the partition permanent do entry in /etc/vfstab
#vi /etc/vfstab
/swapfile - - swap - no -
save file and reboot system to check the effect.

1 comment: