cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3436
Views
3
Helpful
9
Replies

Is there a way to see which interface's configuration mode I'm current

omatsu
Level 1
Level 1

I have a question about interface configuration mode of cisco switch.
Is there a way to see which interface's configuration mode I'm currently in ?

In some other companies' products, I can check the current interface as shown below.
I'm hoping there's a way to check the current interface on Cisco switches as well.

Ex 1) In interface configuration mode, the name of the interface is displayed in the prompt, so I can check which interface I am currently in.

Ex 2) In the interface configuration mode, there is a command to display the interface's configuration, so I can check which interface I am currently in.

1 Accepted Solution

Accepted Solutions

Omatsu, Flavio,

I think that Omatsu wants to know if there is a command in IOS/IOS XE to show what exact configuration submode we are working in.

Unfortunately, I don't believe there is any such command. In NX-OS, you can write where and it will display the sequence of all commands necessary to get from the command mode through the global config mode to the submode we're standing in right now, including the exact interface name. However, IOS/IOS XE does not seem to support any similar command. For IOS-XR, I'm not sure.

Best regards,
Peter

 

 

View solution in original post

9 Replies 9

Hi @omatsu 

 There is, but not so simple. You need to know which mac address your the device you are using have. With the mac address in hands, you can issue the command

show mac address-table mac <x.x.x.x>. This will show you which interface you are using.

 On the example below, suppose your mac address is 001b.10a0.2500, you would be on interface Gi1/0

FlavioMiranda_0-1690270108298.png

 

 

Thank you for your reply, I appreciate your taking the time.
Unfortunately your answer did not solve my issue.
I am very sorry that my English may not be sufficient...

What I'm looking for is a way to know which interface I'm in when I'm in interface configuration mode.
(Not a way to know which interface I'm using for packet forwarding)

For example, in the following situations, I would like to check which interface I am currently in .
(Slightly clumsy example for simplicity)

<Example>
I'm trying to add VLAN 250 to Gi2/0/44, a trunk port connected to a firewall.

  1. First, enter configuration mode for Gi2/0/44
    (conf)# int Gi2/0/44
    (conf-if)#​
    ​
  2. I was worried that the interface connected to the firewall is Gi2/0/44, so I decided to check the description.
    (conf-if)# do show int description
     ~Omitted~ 
    Gi2/0/44 up up To_Firewall 
    Gi2/0/45 up up To_Server​
  3. I was able to confirm that the connection destination of Gi2/0/44 is Firewall.
    However, I interrupted the flow of configuration change work by doing various confirmation work like (2), so before I actually change the settings, I want to confirm once again that the interface I'm in is definitely Gi2/0/44.

     I can check it by looking at the command I typed in (1), but since I typed the command in (2), I can't check the command in (1) unless I scroll my PuTTY Window a lot.
    In a situation like this , scrolling my PuTTY Window , I Wonder if there is a way to know the current interface every time .
    So, I asked this question.

Omatsu, Flavio,

I think that Omatsu wants to know if there is a command in IOS/IOS XE to show what exact configuration submode we are working in.

Unfortunately, I don't believe there is any such command. In NX-OS, you can write where and it will display the sequence of all commands necessary to get from the command mode through the global config mode to the submode we're standing in right now, including the exact interface name. However, IOS/IOS XE does not seem to support any similar command. For IOS-XR, I'm not sure.

Best regards,
Peter

 

 

Thank you for your reply.

As you said, I was just talking about "submodes" .

Since we also use Nexus switches, it is very helpful to learn about the "where" command.
( I tried it on our Nexus switch and it worked as expected ! )

thank you very much.

I got it. You are looking for something like "pwd" in linux which will tell you in which directory you are at the present moment.

 

Thank you for your reply.

As you said, I was looking for something like the "pwd" command .
Sorry for my poor English...
Thank you for your cooperation.

Scroll back though the commands you entered, not in you terminal emulator, but in the device's command entry history.

In you example, your "int Gi2/0/22" might be immediately one back from your "do show int description".

Another alternative, pop up a mode level, "ex" and then enter "int Gi2/0/22", which you now know is the interface you want to configure.

Thank you for your reply.

 

but in the device's command entry history.

Surely, it's also a method.
Thank you for your advice.

pop up a mode level, "ex" and then enter "int Gi2/0/22", 

I'm sorry to bother you, could you tell me a little more about how to do this?
Is "pop up mode" a PuTTY's function to display in another window?

"I'm sorry to bother you, could you tell me a little more about how to do this?"

Not a bother, so for example:

Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int g0/0/0
Router(config-if)#do sh run
Building configuration...

Current configuration : 792 bytes
.
.
end

 

After the do show run command, the prompt shows me I'm in an interface config mode, but I'm unsure I'm on the interface I desire, so I can . . .
Router(config-if)#ex !ex for exit, pops me back a level
Router(config)#int g0/0/1 !where I can enter the interface I now know I need
Router(config-if)#

Alternatives include, using "up arrow" to back up through the previously entered command (this is a function of the device's command entry history) - I should first see the do sh run command, and next see the int g0/0/0 command.

Another alternative, often you can directly enter a higher level command and you immediately jump there, i.e. while in the sub interface mode for interface g0/0/0 I can enter int g0/0/1 and I'll be in the sub interface mode for the latter.  BTW, you can do this for jumping complete sections, too.

E.g.:

Router(config)#int g0/0/0
Router(config-if)#router os 10
Router(config-router)#int g0/0/1
Router(config-if)#

The above should work on classic IOS or IOS-XE, don't recall about Nexus OS or IOS-XR.

Review Cisco Networking for a $25 gift card