Community discussions

MikroTik App
 
MultiTricker
just joined
Topic Author
Posts: 10
Joined: Fri Mar 09, 2012 10:17 am
Location: Czech republic
Contact:

How remove master-port on RoS for both new and old RoS?

Thu May 10, 2018 4:30 pm

Hello,

what I want to achieve is script for cleaning configuration in ROS and then do my universal configuration which is using bridges.

For older ROS (than 6.41+) to be compatible, I need to remove master-port configuration in "/interface ethernet". Still on older ROS, I can do:
/interface ethernet set [find] master-port=none
But when I run this on 6.41+, I get error message for wrong syntax. I get it, there is no master-port option, but what if I need to run this command only on older ROS? I tried something like:
:if ([:len [/interface ethernet find master-port="none"]]>0) do={
	:do {
		/interface ethernet set [find] master-port=none
	} on-error={ }
}
But I still got syntax-error message for that line where master-port should be set to none, even if this code should not be executed (because length for finding interfaces with master-port is 0).

Is there any way how to remove master-port on older ROS before adding bridges which will work on new ROS too, so I can have one script?

Thank you
 
User avatar
Anumrak
Forum Guru
Forum Guru
Posts: 1174
Joined: Fri Jul 28, 2017 2:53 pm

Re: How remove master-port on RoS for both new and old RoS?

Thu May 10, 2018 4:37 pm

In 6.41+ there is no master port anymore, that's why your sript can't find it in config.

What's new in 6.41 (2017-Dec-22 11:55):

Important note!!! Backup before upgrade!
RouterOS (v6.40rc36-rc40 and) v6.41rc1+ contains new bridge implementation that supports hardware offloading (hw-offload).
This update will convert all interface "master-port" configuration into new bridge configuration, and eliminate "master-port" option as such.
Bridge will handle all Layer2 forwarding and the use of switch-chip (hw-offload) will be automatically turned on based on appropriate conditions.
The rest of RouterOS Switch specific configuration remains untouched in usual menus for now.
Please, note that downgrading to previous RouterOS versions will not restore "master-port" configuration, so use backups to restore configuration on downgrade.

In new versions of ROS you can just remove the standart bridge which is added instead of master port.
 
MultiTricker
just joined
Topic Author
Posts: 10
Joined: Fri Mar 09, 2012 10:17 am
Location: Czech republic
Contact:

Re: How remove master-port on RoS for both new and old RoS?

Thu May 10, 2018 4:58 pm

Hello Anumrak,

yes I know, but I need universal configuration (script) for both cases.

Older ROS - remove interfaces from master-port so I can setup bridge for those (and I dont want to upgrade to newer ROS).
Newer ROS - just add bridges.

But how can I script that on older RoS I want to remove master-port setting? I'm already writing that I know about no master-port configuration i 6.41+ :-)

Thank you
 
User avatar
Anumrak
Forum Guru
Forum Guru
Posts: 1174
Joined: Fri Jul 28, 2017 2:53 pm

Re: How remove master-port on RoS for both new and old RoS?

Thu May 10, 2018 5:09 pm

Try to use in script "else" after "if". In "else" you can add new bridge, when "if" will detect absent of master-port. Experiment! :)
 
MultiTricker
just joined
Topic Author
Posts: 10
Joined: Fri Mar 09, 2012 10:17 am
Location: Czech republic
Contact:

Re: How remove master-port on RoS for both new and old RoS?

Fri May 11, 2018 10:26 am

Thank you for trying to help me, but I have already been there - that is not working either.

I'm wondering if there is some workaround, so script will be executed without problem and will remove master-port only on older ROS (I will add those interfaces into bridge shortly after this), so I can have one universal script.

Who is online

Users browsing this forum: No registered users and 14 guests