SOLARIS
BASICS-P6
BASIC NETWORKING -1,
IP/SUBNET/GATEWAY:
root@sol-test-1:>/#ifconfig -a
lo0:
flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232
index 1
inet 127.0.0.1 netmask
ff000000
e1000g0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu
1500 index 2
inet 192.168.234.133
netmask ffffff00 broadcast 192.168.234.255
ether 0:c:29:c2:8f:90
lo0: Loop-Back Interface:
Loopback address is a special IP number (127.0.0.1) that is
designated for the software loopback interface of a machine. The loopback
interface has no hardware associated with it, and it is not physically
connected to a network.
This enables users to test an application with an instance of server
and client on the same machine, with the ability to transmit network data
between, even without access to a physical network.
Data sent on loopback is forwarded by the operating system to a
virtual network interface within operating system. This address is mostly used
for testing purposes like client-server architecture on a single machine. Other
than that, if a host machine can successfully ping 127.0.0.1 or any IP from
loopback range, implies that the TCP/IP software stack on the machine is
successfully loaded and working.
e1000g0:
e1000g0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu
1500 index 2
inet 192.168.234.133
netmask ffffff00 broadcast 192.168.234.255
ether 0:c:29:c2:8f:90
0 => is the first instance of Ethernet card.
Flags => used by system
UP => status of NIC is UP
BROADCAST => card is broadcasting it’s presence on the
network, using BC packets
RUNNING => it is active
MULTICAST => NIC accepts multicast addresses. A MC
address sends Ethernet packets to multiple systems at the same time, hence the
name Multi (several) cast (send). This is special class D network.
IPv4 => using IPv4
mtu 1500 => Maximum transmission unit, the size of eth
packets. This size will be accepted by system on this interface.
Index => shows how many Eth devices are using this
setting. Kernel associates the config value (IP, MTU....) with index no for internal reference.
Inet => ip address of Eth card
Netmask => Netmask/subnet in hexadecimal format.
Broadcast => the BC address this system is using, when
system needs to contact other systems on the same network segment, it uses a BC
address.
Ether => Ethernet address of NIC card (MAC Address)
What is MAC Address?
Media Access Control address is unique hardware address on a LAN.
When a system is connected to LAN, an Address resolution Protocol
(ARP/RARP) table maps the systems physical MAC address to an IP address on LAN.
How to find MAC address of a system?
Via “ifconfig –a” on systems having OS installed.
Via “banner” at “ok” prompt on systems without OS.
Find the IP with help of MAC and find the MAC with help of IP is
ARP/RARP.
Here I have e1000g0, there might be some other name you get on your
system depending upon hardware installed.
e1000g0: intel
PRO/1000 gigabit family device
bge0: Broadcom
gigabit Ethernet device driver
ce0: cassini gigabit
Ethernet device driver
qfe0: quad fast
gigabit Ethernet device driver
nge0: nvidia
gigabit Ethernet device driver
hme0: first hme
(fast Ethernet device driver) Ethernet interface
eri0: first eri
(fast Ethernet device driver) Ethernet interface
How to know that another system on network is live?
By “ping” command.
root@sol-test-1:>/#ping 192.168.234.2
192.168.234.2 is alive
How to do a continuous ping?
root@sol-test-1:>/#ping -s 192.168.234.2
PING
192.168.234.2: 56 data bytes
64
bytes from 192.168.234.2: icmp_seq=0. time=1.30 ms
64
bytes from 192.168.234.2: icmp_seq=1. time=0.841 ms
64
bytes from 192.168.234.2: icmp_seq=2. time=0.730 ms
64
bytes from 192.168.234.2: icmp_seq=3. time=0.923 ms
64
bytes from 192.168.234.2: icmp_seq=4. time=0.630 ms
64
bytes from 192.168.234.2: icmp_seq=5. time=0.853 ms
^C
----192.168.234.2
PING Statistics----
6
packets transmitted, 6 packets received, 0% packet loss
round-trip
(ms) min/avg/max/stddev =
0.630/0.880/1.30/0.23
How to ping with different packet size?
root@sol-test-1:>/#ping -s 192.168.234.2 300
PING
192.168.234.2: 300 data bytes
308
bytes from 192.168.234.2: icmp_seq=0. time=1.33 ms
308
bytes from 192.168.234.2: icmp_seq=1. time=0.655 ms
308
bytes from 192.168.234.2: icmp_seq=2. time=0.566 ms
^C
----192.168.234.2
PING Statistics----
3
packets transmitted, 3 packets received, 0% packet loss
round-trip
(ms) min/avg/max/stddev =
0.566/0.850/1.33/0.42
root@sol-test-1:>/#ping -s 192.168.234.2 1024
PING
192.168.234.2: 1024 data bytes
1032
bytes from 192.168.234.2: icmp_seq=0. time=1.26 ms
1032
bytes from 192.168.234.2: icmp_seq=1. time=0.873 ms
1032
bytes from 192.168.234.2: icmp_seq=2. time=0.516 ms
^C
----192.168.234.2
PING Statistics----
3
packets transmitted, 3 packets received, 0% packet loss
round-trip
(ms) min/avg/max/stddev =
0.516/0.884/1.26/0.37
300 bytes and 1024 bytes are combined with the 8 bytes of ICMP header
data.
The only benefit of using a big load on
a ping is to test the stability of the line. If a line fluctuates or goes
offline with a high load, but not with a small load, a standard ping with just
32/64 bytes won't detect the problem.
How to ping a system with limited no of times?
root@sol-test-1:>/#ping -s 192.168.234.2 1024 3
PING
192.168.234.2: 1024 data bytes
1032
bytes from 192.168.234.2: icmp_seq=0. time=1.30 ms
1032
bytes from 192.168.234.2: icmp_seq=1. time=0.542 ms
1032
bytes from 192.168.234.2: icmp_seq=2. time=0.910 ms
----192.168.234.2
PING Statistics----
3
packets transmitted, 3 packets received, 0% packet loss
round-trip
(ms) min/avg/max/stddev =
0.542/0.918/1.30/0.38
Learned the MTU, now check it in action…
root@sol-test-1:>/#ping -s 192.168.234.2 2048
PING
192.168.234.2: 2048 data bytes
^C
----192.168.234.2
PING Statistics----
3
packets transmitted, 0 packets received, 100% packet loss
root@sol-test-1:>/#ping -s 192.168.234.2 1600
PING
192.168.234.2: 1600 data bytes
^C
----192.168.234.2
PING Statistics----
2
packets transmitted, 0 packets received, 100% packet loss
root@sol-test-1:>/#ping -s 192.168.234.2 1500
PING
192.168.234.2: 1500 data bytes
^C
----192.168.234.2
PING Statistics----
2
packets transmitted, 0 packets received, 100% packet loss
root@sol-test-1:>/#ping -s 192.168.234.2 1400
PING
192.168.234.2: 1400 data bytes
1408
bytes from 192.168.234.2: icmp_seq=0. time=0.843 ms
1408
bytes from 192.168.234.2: icmp_seq=1. time=0.709 ms
^C
----192.168.234.2
PING Statistics----
2
packets transmitted, 2 packets received, 0% packet loss
round-trip
(ms) min/avg/max/stddev =
0.709/0.776/0.843/0.095
SUBNET:
root@sol-test-1:>/#cat /etc/netmasks
#
#
The netmasks file associates Internet Protocol (IP) address
#
masks with IP network numbers.
#
# network-number netmask
#
#
The term network-number refers to a number obtained from the Internet Network
#
Information Center.
#
#
Both the network-number and the netmasks are specified in
#
"decimal dot" notation, e.g:
#
# 128.32.0.0 255.255.255.0
#
192.168.234.0 255.255.255.0 รงรง
GATEWAY:
root@sol-test-1:>/#cat /etc/defaultrouter
192.168.234.2 รงรง
How to recognize installed devices?
WITHOUT REBOOT:
I had 2 HDD and then I added 2 more HDD via vmware setting. But they
are not reflecting. How to recognize them without reboot.
bash-3.2# echo |format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c1t0d0 <DEFAULT
cyl 1563 alt 2 hd 255 sec 63>
/pci@0,0/pci15ad,1976@10/sd@0,0
1. c1t1d0 <DEFAULT
cyl 2086 alt 2 hd 255 sec 63>
/pci@0,0/pci15ad,1976@10/sd@1,0
Specify disk (enter its number): Specify disk (enter its number):
Before and after adding HDD.
Now run following command.
root@sol-test-1:>/#devfsadm
OR, if want to see the proceedings behind the curtain.
bash-3.2# devfsadm -vvv
devfsadm[25723]:
verbose: symlink /dev/dsk/c1t2d0s0 ->
../../devices/pci@0,0/pci15ad,1976@10/sd@2,0:a
devfsadm[25723]:
verbose: symlink /dev/dsk/c1t2d0s1 ->
../../devices/pci@0,0/pci15ad,1976@10/sd@2,0:b
devfsadm[25723]:
verbose: symlink /dev/dsk/c1t2d0s2 ->
../../devices/pci@0,0/pci15ad,1976@10/sd@2,0:c
devfsadm[25723]:
verbose: symlink /dev/dsk/c1t2d0s3 ->
../../devices/pci@0,0/pci15ad,1976@10/sd@2,0:d
devfsadm[25723]:
verbose: symlink /dev/dsk/c1t2d0s4 ->
../../devices/pci@0,0/pci15ad,1976@10/sd@2,0:e
devfsadm[25723]:
verbose: symlink /dev/dsk/c1t2d0s5 -> ../../devices/pci@0,0/pci15ad,1976@10/sd@2,0:f
devfsadm[25723]:
verbose: symlink /dev/dsk/c1t2d0s6 ->
../../devices/pci@0,0/pci15ad,1976@10/sd@2,0:g
devfsadm[25723]:
verbose: symlink /dev/dsk/c1t2d0s7 ->
../../devices/pci@0,0/pci15ad,1976@10/sd@2,0:h
devfsadm[25723]:
verbose: symlink /dev/dsk/c1t2d0s8 ->
../../devices/pci@0,0/pci15ad,1976@10/sd@2,0:i
===============O/P REMOVED========================================
bash-3.2# echo |format
Searching for disks...done
AVAILABLE DISK SELECTIONS:
0. c1t0d0 <DEFAULT
cyl 1563 alt 2 hd 255 sec 63>
/pci@0,0/pci15ad,1976@10/sd@0,0
1. c1t1d0 <DEFAULT
cyl 2086 alt 2 hd 255 sec 63>
/pci@0,0/pci15ad,1976@10/sd@1,0
2. c1t2d0 <DEFAULT
cyl 2086 alt 2 hd 255 sec 63>
/pci@0,0/pci15ad,1976@10/sd@2,0
3. c1t3d0 <DEFAULT
cyl 2086 alt 2 hd 255 sec 63>
/pci@0,0/pci15ad,1976@10/sd@3,0
Specify disk (enter its number): Specify disk (enter its number):
All devices will not recognize by this, some need reboot.
WITH REBOOT:
Either do a re-configuration reboot “reboot -- -r”
OR
Create a file with name “.reconfigure” at root dir and do a reboot.
Both will force the kernel to recreate the device tree.
I had 1 interface and then I added 3 more interfaces via vmware
setting. But they are not reflecting. Even after running “devfsadm”
root@sol-test-1:>/#dladm show-dev
e1000g0 link: up speed: 1000 Mbps
duplex: full
root@sol-test-1:>/#dladm show-link
e1000g0 type:
non-vlan mtu: 1500 device: e1000g0
Means system needs a reboot to recognize these devices.
bash-3.2# reboot -- -r
root@sol-test-1:>/#dladm show-dev
e1000g0 link: up speed: 1000 Mbps
duplex: full
e1000g1 link:
unknown speed: 0 Mbps
duplex: unknown
e1000g2 link:
unknown speed: 0 Mbps
duplex: unknown
e1000g3 link:
unknown speed: 0 Mbps
duplex: unknown
Well, now all interfaces are there.
But are they effective…?
root@sol-test-1:>/#ifconfig -a
lo0:
flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232
index 1
inet 127.0.0.1 netmask
ff000000
e1000g0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu
1500 index 2
inet 192.168.234.133
netmask ffffff00 broadcast 192.168.234.255
ether 0:c:29:c2:8f:90
NO….
How to check how many interfaces are in system?
How to check the specification of interfaces?
root@sol-test-1:>/#dladm show-dev
e1000g0 link: up speed: 1000 Mbps
duplex: full
e1000g1 link:
unknown speed: 0 Mbps
duplex: unknown
e1000g2 link:
unknown speed: 0 Mbps
duplex: unknown
e1000g3 link:
unknown speed: 0 Mbps
duplex: unknown
root@sol-test-1:>/#dladm show-link
e1000g0 type:
non-vlan mtu: 1500 device: e1000g0
e1000g1 type:
non-vlan mtu: 1500 device: e1000g1
e1000g2 type:
non-vlan mtu: 1500 device: e1000g2
e1000g3 type:
non-vlan mtu: 1500 device: e1000g3
How to make an interface effective and in action?
root@sol-test-1:>/#ifconfig e1000g1 plumb
root@sol-test-1:>/#
root@sol-test-1:>/#ifconfig -a
lo0:
flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232
index 1
inet 127.0.0.1 netmask
ff000000
e1000g0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu
1500 index 2
inet 192.168.234.133
netmask ffffff00 broadcast 192.168.234.255
ether 0:c:29:c2:8f:90
e1000g1: flags=1000842<BROADCAST,RUNNING,MULTICAST,IPv4> mtu
1500 index 3
inet 0.0.0.0 netmask 0
ether 0:c:29:c2:8f:9a
root@sol-test-1:>/#ifconfig e1000g1 unplumb
root@sol-test-1:>/#ifconfig -a
lo0:
flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232
index 1
inet 127.0.0.1 netmask
ff000000
e1000g0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu
1500 index 2
inet 192.168.234.133
netmask ffffff00 broadcast 192.168.234.255
ether 0:c:29:c2:8f:90
CONTINUED…………………..
No comments:
Post a Comment