Annoying ethernet command

EdTheLadEdTheLad Posts: 2,112Member ■■■■□□□□□□
I really hate on a switch the way i have to complete the command ethern otherwise the cli is confused with etherchannel. As i annoys me, i wanted to use alias to get past this but it doesn't work, strange. I'm not really a fan of using aliases but in this case it could have made my life easier.



CPE1#sh int e?
EsconPhy Ethernet etherchannel

CPE1#sh ip int e ?
<0-15> EsconPhy interface number
<0-15> Ethernet interface number

CPE1#sh alias
Exec mode aliases:
h help
lo logout
p ping
r resume
s show
u undebug
un undebug
w where
e ethernet
et Ethernet

CPE1#sh runn | i alias
alias exec e ethernet
alias exec et Ethernet
CPE1#sh ip int e 0/0
Ethernet0/0 is administratively down, line protocol is down
Internet protocol processing disabled
CPE1#sh ip int et 0/0
Ethernet0/0 is administratively down, line protocol is down
Internet protocol processing disabled
CPE1#
CPE1#sh int e 0/0
% Ambiguous command: "sh int e 0/0"
CPE1#sh int et 0/0
% Ambiguous command: "sh int et 0/0"


CPE1#sh int ethernet 0/0
Ethernet0/0 is administratively down, line protocol is down (disabled)
Hardware is Ethernet, address is aaaa.bbbb.cccc (bia aabb.cc00.0500)
Internet address will be negotiated using DHCP
MTU 1500 bytes, BW 10000 Kbit/sec, DLY 1000 usec,
reliability 255/255, txload 1/255, rxload 1/255
Encapsulation ARPA, loopback not set
Keepalive set (10 sec)
Auto-duplex, Auto-speed, media type is unknown
input flow-control is off, output flow-control is unsupported
ARP type: ARPA, ARP Timeout 04:00:00
Last input 00:18:00, output 00:18:50, output hang never
Last clearing of "show interface" counters never
Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
Queueing strategy: fifo
Output queue: 0/40 (size/max)
5 minute input rate 0 bits/sec, 0 packets/sec
5 minute output rate 0 bits/sec, 0 packets/sec
11061 packets input, 920026 bytes, 0 no buffer
Received 11056 broadcasts (0 IP multicasts)
0 runts, 0 giants, 0 throttles
0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
0 input packets with dribble condition detected
993 packets output, 245825 bytes, 0 underruns
0 output errors, 0 collisions, 0 interface resets
0 unknown protocol drops
0 babbles, 0 late collision, 0 deferred
0 lost carrier, 0 no carrier
0 output buffer failures, 0 output buffers swapped out
CPE1#
Networking, sometimes i love it, mostly i hate it.Its all about the $$$$

Comments

  • SteveO86SteveO86 Posts: 1,423Member
    Yea, you got to love it. I was setting up a new data center last month with ASA, IOS, IOS-XE, NX-OS it was fun remembering which box I was in and which syntax I needed to use, etherchannel/port-channel, snmp syntax, etc fun times!

    and I had to alias's for 'wr' in NX-OS icon_smile.gif -along with an alias for switching VDCs cause I got lazy
    My Networking blog
    Latest blog post: Let's review EIGRP Named Mode
    Currently Studying: CCNP: Wireless - IUWMS
  • CiscoCertsCiscoCerts Posts: 112Member
    EdTheLad wrote: »
    I really hate on a switch the way i have to complete the command ethern otherwise the cli is confused with etherchannel. As i annoys me, i wanted to use alias to get past this but it doesn't work, strange. I'm not really a fan of using aliases but in this case it could have made my life easier.



    CPE1#sh int e?
    EsconPhy Ethernet etherchannel

    CPE1#sh ip int e ?
    <0-15> EsconPhy interface number
    <0-15> Ethernet interface number

    CPE1#sh alias
    Exec mode aliases:
    h help
    lo logout
    p ping
    r resume
    s show
    u undebug
    un undebug
    w where
    e ethernet
    et Ethernet

    CPE1#sh runn | i alias
    alias exec e ethernet
    alias exec et Ethernet
    CPE1#sh ip int e 0/0
    Ethernet0/0 is administratively down, line protocol is down
    Internet protocol processing disabled
    CPE1#sh ip int et 0/0
    Ethernet0/0 is administratively down, line protocol is down
    Internet protocol processing disabled
    CPE1#
    CPE1#sh int e 0/0
    % Ambiguous command: "sh int e 0/0"
    CPE1#sh int et 0/0
    % Ambiguous command: "sh int et 0/0"
    CPE1#

    To get your command to work you have to match from the beginning of the command and cannot use it in the middle like you're trying to do here.

    Here's an example:
    Switch(config)#alias exec EdTheLad show int gi
    Switch(config)#do EdTheLad 1/0/1
    GigabitEthernet1/0/1 is up, line protocol is up (connected)
      Hardware is Gigabit Ethernet, address is 0019.5577.3581 (bia 0019.5577.3581)
      Description: BB1 g0/1
      MTU 1500 bytes, BW 1000000 Kbit, DLY 10 usec,
         reliability 255/255, txload 1/255, rxload 1/255
      Encapsulation ARPA, loopback not set
      Keepalive set (10 sec)
      Full-duplex, 1000Mb/s, media type is 10/100/1000BaseTX
      input flow-control is off, output flow-control is unsupported
      ARP type: ARPA, ARP Timeout 04:00:00
      Last input 00:00:01, output 00:00:03, output hang never
      Last clearing of "show interface" counters never
      Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
      Queueing strategy: fifo
      Output queue: 0/40 (size/max)
      5 minute input rate 27000 bits/sec, 2 packets/sec
      5 minute output rate 4000 bits/sec, 3 packets/sec
         131418103 packets input, 109444749754 bytes, 0 no buffer
         Received 1186091 broadcasts (767580 multicasts)
         0 runts, 0 giants, 0 throttles
         0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
         0 watchdog, 767580 multicast, 352 pause input
         0 input packets with dribble condition detected
         103730060 packets output, 33974237602 bytes, 0 underruns
         0 output errors, 0 collisions, 1 interface resets
         0 babbles, 0 late collision, 0 deferred
         0 lost carrier, 0 no carrier, 0 PAUSE output
         0 output buffer failures, 0 output buffers swapped out
    Switch(config)#do EdTheLad 1/0/1 status
    
    Port      Name               Status       Vlan       Duplex  Speed Type
    Gi1/0/1   BB1 g0/1           connected    1000       a-full a-1000 10/100/1000BaseTX
    Switch(config)#
    

    So in your case something like this might serve you well:
    "alias exec show show interface ethernet"
    show 0/0


    HTH,
    Happy New Year
  • SevenplyheartSevenplyheart Posts: 6Member ■□□□□□□□□□
    SteveO86 wrote: »
    I had to alias's for 'wr' in NX-OS icon_smile.gif -along with an alias for switching VDCs cause I got lazy

    I do this now too, for wr, all switchto and for switchback from all VDCs. I learned the hard way that if you are typing too fast in configuration mode that "swicthback" can become "switch b" and then you've renamed your vdc to "b" due to the "switchname" command.
    LAB-7K1# sh vdc

    vdc_id vdc_name

    1 LAB-7K1
    2 DC-1

    LAB-7K1# swd1

    LAB-7K1-DC-1# con
    LAB-7K1-DC-1(config)# swi b <
    OOPS
    LAB-7K1-b(config)# sb <
    Its hostname is now "b"
    LAB-7K1# sh vdc

    vdc_id vdc_name

    1 LAB-7K1
    2 b <
    VDC name b

    Good times.
Sign In or Register to comment.