vlan database in Cisco Router
See original GitHub issueI am using the Cisco 3745 Multi-service router in GNS3 and creating vlans. To create vlans I need to send these commands in priv exec mode.
S3#vlan database
S3(vlan)#vlan 10 name my_vlan
VLAN 10 added:
Name: my_vlan
S3(vlan)#exit
S3#
I am using the below code with NETMIKO:
for n in range (2,21):
print "Creating VLAN " + str(n)
config_commands = ['vlan database', 'vlan ' + str(n) + ' name Python_VLAN_' + str(n)]
output = net_connect.send_config_set(config_commands)
print output
The problem is that if I use .send_config_set it will enter the config mode, whereas the vlan database command works in exec mode.
If I use .send_command
config_commands = ['vlan database', 'vlan ' + str(n) + ' name Python_VLAN_' + str(n)]
output = net_connect.send_command(config_commands)
the code doesn’t work and I have to ctrl+c to stop the script.
It seems that the code is executed and as it enters the “vlan database” mode it is unable to execute the next commands.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Solved: vlan's on router - Cisco Community
Solved: Hi Seniors, I understand that vlan's can be created on cisco switches but last day I was looking on the configuration of...
Read more >How To Configure VLANs On the Catalyst Switches
Configuring Vlan using VLAN database mode: · 1) Issue the "vlan database" command at the enable prompt in order to enter the VLAN...
Read more >Create Ethernet VLANs on Catalyst Switches - Cisco
You can create VLANs in either VLAN database mode or global configuration mode. You must create VLANs that are numbered higher than 1005...
Read more >Configuring VLANs - Cisco
Switches running the LAN Base feature set support only static routing on SVIs. • A VLAN should be present in the switch to...
Read more >Solved: "vlan database" mode; What is it? - Cisco Community
You can configure normal-range VLANs (from 1-1005) in VLAN database mode, whereas you need to use config-vlan mode to configure extended-range VLANs (1006-4095) ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ktbyers Thanks that worked. So, we are specifying manually the config mode to ‘vlan database’ instead of conf t.
Well, here is the exact solution which works