Commit e0c71a06 authored by Gerry Gunzenhauser's avatar Gerry Gunzenhauser

add RBD52G config

parent 3104d2e7
Pipeline #61389 passed with stages
in 5 minutes and 22 seconds
......@@ -22,6 +22,7 @@ pub fn gen_for(dtype: &str) -> Option<Box<dyn Generator>> {
_ => Some(Box::new(gen_rb962u::GenRB962U{}))
}
},
"RBD52G" => Some(Box::new(gen_rb962u::GenRB962U{})),
"CRS109" => Some(Box::new(gen_crs226::GenCrs226{})),
_ => None
}
......@@ -33,7 +34,7 @@ mod rbsetup {
use crate::model::Device;
pub fn gen_syssetup(device: &Device) -> String {
let generic = format!(" {{\n /system identity set name=\"{}\"\n", device.name);
let generic = format!(" {{\n /system identity set name=\"{}\"\n /system routerboard settings set auto-upgrade=yes\n", device.name);
let mut interfaces = " /interface ethernet\n".to_owned();
for port in device.ports.iter() {
......@@ -155,11 +156,12 @@ mod gen_rb962u {
}
}
src += " }\n {\n /interface ethernet switch port\n";
src += " /ip dhcp-client\n remove [find]\n add disabled=no interface=switch\n }\n {\n /interface ethernet switch port\n";
for port in device.ports.iter() {
match (port.profile.untagged_vlans.len(), port.profile.tagged_vlans.len()) {
(1, 0) => src += format!(" set default-vlan-id={} vlan-header=always-strip vlan-mode=secure [find where name=\"{}\"]\n", port.profile.untagged_vlans[0], port.new_name).as_str(),
(1, _) => src += format!(" set default-vlan-id=auto vlan-header=leave-as-is vlan-mode=check [find where name=\"{}\"]\n", port.new_name).as_str(),
(0, _) => src += format!(" set default-vlan-id=auto vlan-header=leave-as-is vlan-mode=check [find where name=\"{}\"]\n", port.new_name).as_str(),
(u, t) => src += format!("### invalid config for port {}: untagged count: {}, tagged count: {}\n", port.new_name, u, t).as_str(),
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment