Community discussions

 
hbomb4889
just joined
Topic Author
Posts: 1
Joined: Mon Jan 28, 2019 8:56 pm

If VLAN Exists Statement

Wed Jan 30, 2019 8:38 pm

Scenario:
Want to pass an array of numbers (50, 61, 3000) into a for loop in order to create 1) Vlan interface 2) IP address for that interface 3) DHCP network and scope.

Almost have it working, but the one thing that seems to be holding me up (sort of) is if the vlan already exists, the scripts fails there and exits.

Was wondering if there is an easy way to find out if a vlan exists. I've googled everywhere but cannot seem to find a simple way to determine if a vlan exists.

Any help would be greatly appreciated.

Thank you.
 
User avatar
pcunite
Forum Veteran
Forum Veteran
Posts: 945
Joined: Sat May 25, 2013 5:13 am
Location: USA

Re: If VLAN Exists Statement

Thu Jan 31, 2019 10:53 pm

Would it be possible to parse the output of /interface vlan print ?
 
fernando1787
just joined
Posts: 9
Joined: Mon Apr 11, 2016 6:32 pm

Re: If VLAN Exists Statement

Thu Jan 31, 2019 11:01 pm

Try using :do { #create vlan statement here } on-error={ :log warning "error creating vlan"
}

Enviado desde mi Moto E (4) mediante Tapatalk

Who is online

Users browsing this forum: No registered users and 11 guests