Script to add ports to a bridge

Created by Faye Admin, Modified on Thu, May 29 at 11:30 AM by Faye Admin

# First, set port type i.e.: ether or sfp

# This is for interfaces not named “ether” like SFP

# Second set the bridge name

# Then set ports in range form using SlavePortStart and SlavePortStop.

Paste this into a terminal to create the script, change the variables outlined above and run the script.

/system script add name="Set Ports" owner=admin policy=\    ftp,reboot,read,write,policy,test,password,sniff,sensitive source="#\r\    \n#\r\    \n# \r\    \n# First, set port type i.e.: ether or sfp \r\    \n# This is for interfaces not named \93ether\94 like SFP\r\    \n# Second, set the bridge name\r\    \n# Then set ports in range form using SlavePortStart and SlavePortStop.\r\    \n:global PortType \"ether\"\r\    \n:global BridgeName \"bridge1\"\r\    \n:global SlavePortsStart \"1\"\r\    \n:global SlavePortsStop \"9\"\r\    \n:for i from=\$SlavePortsStart to=\$SlavePortsStop do={\r\    \n/interface bridge port add interface=(\$PortType . \$i) bridge=\$BridgeNam\    e\r\    \n}"

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article