07-24-2023 07:31 PM
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.
Solved! Go to Solution.
07-25-2023 09:11 AM
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
07-25-2023 12:29 AM - edited 07-25-2023 12:29 AM
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
07-25-2023 08:34 AM - edited 07-25-2023 08:40 AM
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.
(conf)# int Gi2/0/44
(conf-if)#
(conf-if)# do show int description
~Omitted~
Gi2/0/44 up up To_Firewall
Gi2/0/45 up up To_Server
07-25-2023 09:11 AM
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
07-26-2023 05:59 PM
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.
07-25-2023 09:22 AM
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.
07-26-2023 06:03 PM
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.
07-25-2023 10:43 AM
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.
07-26-2023 06:17 PM
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?
07-27-2023 12:17 PM
"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.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide