-->
🏠 🔍
SHAREOLITE

linux ethtool command line example to find LAN connection status

Linux ethtool command line utility is very useful to collect information and status of network ports and physical link connectivity.

Below is an example on how to use ethtool to check whether a physical link is up or down. The interface name is passed as argument to the ethtool

linux ethtool command line example to find LAN connection status

 

Interface name of a network port , may be displayed using the command ifconfig as below

$ ifconfig
eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 170.0.2.151  netmask 255.255.248.0  broadcast 170.0.2.255
        inet6 fe80::b1ba:7d9e:2da:2478  prefixlen 64  scopeid 0x20<link>
        ether 98:be:94:22:dd:da  txqueuelen 1000  (Ethernet)
        RX packets 10691  bytes 944151 (922.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1445  bytes 287378 (280.6 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device memory 0xbc580000-bc59ffff

Notice the highlighted interface name eno1 which is the first network port.

Now using ethtool , status of link may be displayed as below

# ethtool eno1
Settings for eno1
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supported pause frame use: Symmetric
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Advertised pause frame use: Symmetric
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Speed: Unknown!
        Duplex: Unknown! (255)
        Port: Twisted Pair
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        MDI-X: off (auto)
        Supports Wake-on: pumbg
        Wake-on: g
        Current message level: 0x00000007 (7)
                               drv probe link
        Link detected: no

Notice from above highlighted display , "Link detected" has a value "no" which indicates the physical link is down . 

Now after connecting the physical link to the network port , on re-executing the command status is displayed as below

# ethtool eno1
Settings for eno1:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Supported pause frame use: No
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Half 1000baseT/Full
        Advertised pause frame use: Symmetric
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                             100baseT/Half 100baseT/Full
                                             1000baseT/Full
        Link partner advertised pause frame use: No
        Link partner advertised auto-negotiation: Yes
        Link partner advertised FEC modes: Not reported
        Speed: 1000Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        MDI-X: off
        Supports Wake-on: g
        Wake-on: g
        Current message level: 0x000000ff (255)
                               drv probe link timer ifdown ifup rx_err tx_err
        Link detected: yes

Notice the change in value of Link detected from "no" to "yes" and the connectivity speed.  

Hope this helps to few who are in search of a utility to debug LAN connection status.


SOLVED : D-Link DWA-123 11n adapter Windows XP driver download

Below driver was tested & found working for a D-Link DWA-123 model wifi modem on Windows XP platform.
 

 


Click here to Download Driver

Steps to install driver -

  • Download the driver file from download link shared & extract in a temporary directory
  • Open Control Panel -> Administrator tools -> Device Management window
  • In the list of hardware details , select 11n adapter , right click & select Update driver option
  • Select option to choose driver file from a specified location . Point selection to temporary directory & proceed with installation.





Cisco switch capture packet trace - Howto - SOLVED

In this post , we present practically verified and working - Cisco switch command line option for capturing packet traces for a specific interface port , which may be analyzed using Wireshark.


Enabling and capturing trace on a cisco switch includes below points.

  • Defining an access list to restrict any specific hosts .
  • Defining a capture trace buffer
  • Attaching an access list filter to this trace buffer
  • Defining any specific interfaces for capture
  • Start the capture 
  • Stop the capture and download the pcap file for analysis
Command line for the above are as below -

Creating an Access list

SW1# config terminal

SW1(config)#ip  access-list  standard acl1
SW1(config-std-nacl)#permit any
SW1(config-std-nacl)#exit
SW1#

Defining a trace capture buffer

SW1#monitor capture trace1 buffer size 1

Attaching an access list filter to this trace buffer

SW1#monitor capture trace1 access-list acl1


Defining any specific interfaces for capture

SW1#monitor capture trace1 interface GigabitEthernet 1/0/2 both

Start the capture for a duration and stop 

SW1#monitor capture trace1 start
SW1#
SW1#monitor capture trace1 stop


Viewing the captured file details


SW1#show monitor capture trace1 buffer brief
  0.000000   1.1.1.2 -> 224.0.0.5    OSPF Hello Packet
  0.376979   1.1.1.2 -> 224.0.0.18   VRRP Announcement (v2)
  1.214985   1.1.1.2 -> 224.0.0.2    HSRP Hello (state Active)

View the capture rules & parameters

SW1#show monitor capture  trace1 parameter
   monitor capture trace1 interface GigabitEthernet1/0/2 both
   monitor capture trace1 access-list acl1
   monitor capture trace1 buffer size 1

SW1#show monitor capture  trace1

Status Information for Capture trace1
  Target Type:
   Interface: GigabitEthernet1/0/2, Direction: both
   Status : Inactive
  Filter Details:
   Access-list: acl1
  Buffer Details:
   Buffer Type: LINEAR (default)
   Buffer Size (in MB): 1
  File Details:
   File not associated
  Limit Details:
   Number of Packets to capture: 0 (no limit)
   Packet Capture duration: 0 (no limit)
   Packet Size to capture: 0 (no limit)
   Packets per second: 0 (no limit)
   Packet sampling rate: 0 (no sampling)

Copying the buffer content to a pcap file for analysis

SW1#monitor capture trace1 export flash:/trace1.pcap
Exported Successfully


Downloading the file from switch

SW1(config)#
SW1(config)#ip ftp username backup
SW1(config)#ip ftp password backup
SW1(config)#
SW1#copy flash:/trace1.pcap ftp:
Address or name of remote host []? 192.168.40.100
Destination filename [trace1.pcap]?
Writing trace1.pcap !
2511 bytes copied in 2.156 secs (1165 bytes/sec)

To disable the capture rules , follow the standard option to execute the same commands with a 'no' prefix.

Hope its useful to some beginners.

Enable SNMP traps Cisco Switch SOLVED


In this post , we present the working steps to enable SNMP Traps on a cisco switch.  Hope this is useful to some beginners.

Check the SNMP Trap settings.

SW1#show snmp
Chassis: SRO112WE21
0 SNMP packets input
    0 Bad SNMP version errors
    0 Unknown community name
    0 Illegal operation for community name supplied
    0 Encoding errors
    0 Number of requested variables
    0 Number of altered variables
    0 Get-request PDUs
    0 Get-next PDUs
    0 Set-request PDUs
    0 Input queue packet drops (Maximum queue size 1000)
0 SNMP packets output
    0 Too big errors (Maximum packet size 1500)
    0 No such name errors
    0 Bad values errors
    0 General errors
    0 Response PDUs
    0 Trap PDUs
SNMP global trap: disabled
SNMP agent enabled

SNMP logging: disabled

Enter into configuration mode , to send SNMPV2 traps to manager IP 10.20.30.1 using the interface of VLAN 45 , below commands may be used.

SW1#config t
SW1(config)# snmp-server community public ro
SW1(config)# snmp-server host 10.20.30.1 version 2c public
SW1(config)# snmp-server enable traps snmp
SW1(config)# snmp-server trap-source vlan 45
SW1(config)# end

SW1# show snmp
Chassis: SRO112WE21
0 SNMP packets input
    0 Bad SNMP version errors
    0 Unknown community name
    0 Illegal operation for community name supplied
    0 Encoding errors
    0 Number of requested variables
    0 Number of altered variables
    0 Get-request PDUs
    0 Get-next PDUs
    0 Set-request PDUs
    0 Input queue packet drops (Maximum queue size 1000)
6 SNMP packets output
    0 Too big errors (Maximum packet size 1500)
    0 No such name errors
    0 Bad values errors
    0 General errors
    0 Response PDUs
    6 Trap PDUs
SNMP global trap: enabled
SNMP agent enabled

SNMP logging: enabled
    Logging to 10.20.30.1.162, 0/10, 6 sent, 0 dropped.

Stacking Cisco Switches - SOLVED

In this post , we explain in detail step by step tested and working procedure to stack two Cisco switches. In our setup , we have verified stacking two Cisco L3 3750 48 port + 4G switches which had 2 stack ports each. 

Before stacking , verify the switch slot number and MAC address as below. If required backup your switch configurations using "copy flash: ftp:" command as described in our earlier posts.  

Switch1# show switch
Switch/Stack Mac Address : 001c.23b1.e298
                                           H/W   Current
Switch#  Role   Mac Address     Priority Version  State
----------------------------------------------------------
*1       Master 001c.23b1.e298     1     0       Ready


Switch2#show switch
Switch/Stack Mac Address : 001c.23b2.e295
                                           H/W   Current
Switch#  Role   Mac Address     Priority Version  State
----------------------------------------------------------
*1       Master 001c.23b2.e295     1      0       Ready

From above output , we may observe both individual switches are acting as Master with priority 1.

After stacking the switch which has the highest priority will be the "Master" and the other will be "Member" of the stack. The Master switch is responsible for updating the configurations to other switches. 

Hence before connecting the stack cables , decide which switch has to be the master and change the priority. In our example , Switch1 will be the Master. Change the switch priority to the highest value i.e, 15 .

Switch2 # config terminal
Switch2(config)# switch 1 priority 15
Changing the Switch Priority of Switch Number 1 to 15
Do you want to continue?[confirm]
New Priority has been set successfully

Switch1#show sw
Switch/Stack Mac Address : 001c.23b1.e298
                                           H/W   Current
Switch#  Role   Mac Address     Priority Version  State
----------------------------------------------------------
*1       Master 001c.23b1.e298     15     0       Ready


Connect the Stack cables now . Important Note - The stack cables should be connected in crisscross manner i.e, stack port 1 of Switch1 to the 2nd stack port of Switch2 and vice-versa to form a ring. Please note only one cable is enough for stacking which would still work with half ring speed. However for cable redundancy and optimal ring speed usage , 2nd stack cable should also be used. 

We assume now you have connected the cables now . If not please connect and then proceed with the below steps.

After connecting the cables , reload the switches.  Once both switches are booted up , you should see a output as below with Switch1 elected as Master and Switch2 as the Member as Switch1 priority is higher.

Switch1#show sw
Switch/Stack Mac Address : 001c.23b1.e298
                                           H/W   Current
Switch#  Role   Mac Address     Priority Version  State
----------------------------------------------------------
*1       Master 001c.23b1.e298     15     0       Ready
 2       Member 001c.23b2.e295     1      0       Ready


To view the stack port and neighbor switch connection status -

Switch1# show switch detail
Switch/Stack Mac Address : 001c.23b1.e298
                                           H/W   Current
Switch#  Role   Mac Address     Priority Version  State
----------------------------------------------------------
*1       Master 001c.23b1.e298     15     0       Ready
 2       Member 001c.23b2.e295     1      0       Ready



         Stack Port Status             Neighbors
Switch#  Port 1     Port 2           Port 1   Port 2
--------------------------------------------------------
  1        Ok         Ok                2        2
  2        Ok         Ok                1        1

Note - If you are not observing the second switch in the display , then there may be a requirement to "manually provision" the switch as described in the procedure below on Switch1.

Switch1 # config terminal
Switch1(config)# switch 2 provision ws-c3750-48ts
Switch1(config)# ^Z

Switch1 # show switch
Switch/Stack Mac Address : 001c.23b1.e298
                                           H/W   Current
Switch#  Role   Mac Address     Priority Version  State
----------------------------------------------------------
*1       Master 001c.23b1.e298     15     0       Ready
 2       Member 0000.0000.0000     0      0       Provisioned

Now reload the switches , after which you should be seeing both the switches in "Ready" state.

Now that you have stacked the switches , you will notice all the ports of both switches may be managed through the Master switch. If you execute "show run" , you will notice ports of both switches are displayed and hence treated as one logical unit.

Now lets reboot the master switch and observe the status change

Switch/Stack Mac Address : 001c.23b2.e295
                                           H/W   Current
Switch#  Role   Mac Address     Priority Version  State
----------------------------------------------------------
 1       Member 0000.0000.0000     0      0       Removed
*2       Master 001c.23b2.e295     1      0       Ready


Switch1#
Switch1#show sw
Switch/Stack Mac Address : 001c.23b2.e295
                                           H/W   Current
Switch#  Role   Mac Address     Priority Version  State
----------------------------------------------------------
 1       Member 001c.23b1.e298     15     0       Progressing
*2       Master 001c.23b2.e295     1      0       Ready



Switch1#show sw
Switch/Stack Mac Address : 001c.23b2.e295
                                           H/W   Current
Switch#  Role   Mac Address     Priority Version  State
----------------------------------------------------------
 1       Member 001c.23b1.e298     15     0       Initializing
*2       Master 001c.23b2.e295     1      0       Ready


Switch1 boot up is completed now . You will notice Switch2 is "elected" as Master which confirms you have successfully stacked the switches. Repeat this procedure by rebooting Switch2 also.

Switch1#show  sw
Switch/Stack Mac Address : 001c.23b2.e295
                                           H/W   Current
Switch#  Role   Mac Address     Priority Version  State
----------------------------------------------------------
 1       Member 001c.23b1.e298     15     0       Ready
*2       Master 001c.23b2.e295     1      0       Ready


Some of other useful switch stack commands for monitoring the performance and their output are as below 

Switch1# show switch neighbors
  Switch #    Port 1       Port 2
  --------    ------       ------
      1         2             2
      2         1             1


Switch1#show switch stack-ports
  Switch #    Port 1       Port 2
  --------    ------       ------
    1           Ok           Ok
    2           Ok           Ok



Switch1#show platform stack manager all
Switch/Stack Mac Address : 001c.23b1.e298
                                           H/W   Current
Switch#  Role   Mac Address     Priority Version  State
----------------------------------------------------------
*1       Master 001c.23b1.e298     15     0       Ready
 2       Member 001c.23b2.e295     1      0       Ready



         Stack Port Status             Neighbors
Switch#  Port 1     Port 2           Port 1   Port 2
--------------------------------------------------------
  1        Ok         Ok                2        2
  2        Ok         Ok                1        1


               Stack Discovery Protocol View
==============================================================


Switch   Active   Role    Current   Sequence   Dirty
Number                    State     Number     Bit
--------------------------------------------------------------------
1        TRUE    Master   Ready       115       FALSE
2        TRUE    Member   Ready       117       FALSE



                 Stack State Machine View
==============================================================

Switch   Master/   Mac Address          Version    Current
Number   Member                          (maj.min)  State
-----------------------------------------------------------
1        Master    001c.23b1.e298          1.45        Ready
2        Member    001c.23b2.e295          1.45        Ready

Last Conflict Parameters

Switch Master/ Cfgd Default Image H/W  # of    Mac Address
Number Member  Prio Config   Type Prio Members
-----------------------------------------------------------------------
 1     Master   15   No       6    2   0  001c.23b1.e298

            Stack Discovery Protocol Counters
        Messages Sent                  Messages Recvd
        UP       DOWN                  UP        DOWN
--------------------------------------------------------
*1: 0000001121 0000000885          0000000115 0000000116
 2: 0000000117 0000000117          0000000859 0000000858
 3: 0000000000 0000000000          0000000000 0000000000
 4: 0000000000 0000000000          0000000000 0000000000
 5: 0000000000 0000000000          0000000000 0000000000
 6: 0000000000 0000000000          0000000000 0000000000
 7: 0000000000 0000000000          0000000000 0000000000
 8: 0000000000 0000000000          0000000000 0000000000
 9: 0000000000 0000000000          0000000000 0000000000


             Misc  Counters
   Counter                      Up          Down
---------------------------------------------------

 Wrong Ver Number: Send:    0000000000    0000000000
 Wrong Ver Number: Recv:    0000000000    0000000000
 Missed Messages:           0000000001    0000000000
 Orphaned Messages          0000000000    0000000000
 Suppressed Messages        0000000761    0000000762
 No Available Messages      0000000096    0000000091
 Link Present               0000000009    0000000003
 Link Not Present           0000000009    0000000003
 Link RxReset               0000000025    0000000013
 Link Sync Stuck Resets     0000000026    0000000000
 Duplicates                 0000000741    0000000742
 RAC Not OK Resets          0000000000
 Switch# of last duplicate  0000000002
 Sequence Number Failures   0000000000
 RAC Not OK Resets          0000000000
 Sync Not OK Resets         0000000070    0000003982
 Switch# of last Failure:   256  Last Difference 0
 Switch Number Conflicts    0
 Stack Changes              18
 Int Stack Link changes     0
 Int Stack Link state       0x0
 Reciprocal Efficiency Changes: Upgrade 0, Downgrade 0
             Resource Counters
-------------------------------------------
 Chunk Alloc's        0000000005
 Chunk Free's         0000000004
 Enqueue Failures:    0000000000
 Null Queue Failures: 0000000000
 Chunk Alloc Errors:  0000000000


           Stack State Machine Counters
   Messages Sent              Messages Recvd
-------------------------------------------------
*1: 0000000000                 0000000000
 2: 0000000005                 0000000005
 3: 0000000000                 0000000000
 4: 0000000000                 0000000000
 5: 0000000000                 0000000000
 6: 0000000000                 0000000000
 7: 0000000000                 0000000000
 8: 0000000000                 0000000000
 9: 0000000000                 0000000000



Switch1#show switch stack-ring speed

Stack Ring Speed        : 32G
Stack Ring Configuration: Full
Stack Ring Protocol     : StackWise

Switch1#show switch stack-ring activity

Sw  Frames sent to stack ring (approximate)
------------------------------------------------
1           52147
2           18487

Total frames sent to stack ring : 70634

Note: these counts do not include frames sent to the ring
by certain output features, such as output SPAN and output
ACLs.


When any one stack cable is removed , you will notice stacking still works but at half the ring speed

Switch1#show switch stack-ports
  Switch #    Port 1       Port 2
  --------    ------       ------
    1          Down          Ok
    2           Ok          Down

Switch1#show switch stack-ring speed

Stack Ring Speed        : 16G
Stack Ring Configuration: Half
Stack Ring Protocol     : StackWise

Hope this article helps to some who are new to stacking.

–>