If we have remote server/computer with several network interfaces, sometime we will face network connection problem on certain interface. To check physical network cable status on Solaris we can use the following command :
# ndd -get /dev/fjgi link_status 1
Result 1 means cable connected, and if result 0 means cable disconnected.
By default it will read fjgi0
first, to check another fjgi
interface we define the instance first then repeat the command
# ndd –set /dev/fjgi instance 2 # ndd -get /dev/fjgi link_status
If the machines using ce
interfaces (Sun GigaSwift Ethernet 1.0 driver), we can’t use ndd
command. But we have another option by using kstat
command :
root@drc-scp14# kstat -p ce | grep link_up ce:0:ce0:link_up 1 ce:1:ce1:link_up 1 ce:2:ce2:link_up 0 ce:3:ce3:link_up 0 ce:4:ce4:link_up 0 ce:5:ce5:link_up 1 root@drc-scp14# ifconfig -a lo0: flags=1000849mtu 8232 index 1 inet 127.0.0.1 netmask ff000000 ce0: flags=9040843 mtu 1500 index 2 inet 10.22.248.141 netmask ffffff00 broadcast 10.22.248.255 groupname scp-front ether 0:14:4f:96:8c:96 ce0:1: flags=1000843 mtu 1500 index 2 inet 10.22.248.143 netmask ffffff00 broadcast 10.22.248.255 ce1: flags=9040843 mtu 1500 index 3 inet 10.22.248.142 netmask ffffff00 broadcast 10.22.248.255 groupname scp-front ether 0:14:4f:68:6b:30 ce5: flags=1000843 mtu 1500 index 5 inet 10.22.253.133 netmask fffffff0 broadcast 10.22.253.143 ether 0:14:4f:96:8c:97 ce2: flags=1000803 mtu 1500 index 10 inet 10.22.255.133 netmask fffffff0 broadcast 10.22.255.143 ether 0:14:4f:68:6b:31 root@drc-scp14#
On Linux system we do it like this :
[root@pwsupport-ftpserver tedy]# mii-tool eth0: negotiated 100baseTx-FD, link ok eth1: negotiated 100baseTx-FD, link ok [root@pwsupport-ftpserver tedy]#
Using mii-tool
we can check spesific interface like this :
[root@pwsupport-ftpserver tedy]# mii-tool eth0 eth0: negotiated 100baseTx-FD, link ok [root@pwsupport-ftpserver tedy]#
If there is no cable plugged-in then the result would be like this :
ttirtawi@tedy-laptop:~$ sudo mii-tool eth0 eth0: no link ttirtawi@tedy-laptop:~$