class MtikSchemesGen_1 def scheme1_3g_config_gen_1(hostname, tunnel_id, hub_vip, ap_admin_password, ap_ssid, capsman) cap_conf = "/interface wireless cap set caps-man-addresses=" for f in capsman cap_conf = cap_conf + "," + f end cap_conf = cap_conf + " enabled=yes interfaces=wireless_public_interface,wlan2 bridge=bridge_tunnel" cap_conf = cap_conf.gsub("caps-man-addresses=,", "caps-man-addresses=") [ "/system identity set name=#{hostname}", "/interface bridge add name=bridge_tunnel", "/interface eoip add remote-address=#{hub_vip.to_s} tunnel-id=#{tunnel_id.to_s} name=tunnel_to_hub", "/interface bridge port add interface=tunnel_to_hub bridge=bridge_tunnel", "/interface bridge port add interface=wlan1 bridge=bridge_tunnel", "/interface wireless set wlan1 mode=ap-bridge ssid=#{ap_ssid} disabled=no name=wireless_public_interface frequency=2442", "/interface ppp-client set ppp-out1 apn=vpn pin=1111 disabled=no", "/interface wireless set wlan2 disabled=yes", "/system clock set time-zone-name=Europe/Minsk", %{/snmp community set numbers=0 name="RO2597" addresses=172.18.25.4/32,172.17.109.3/32 security=none read-access=yes write-access=no}, "/snmp set enabled=yes trap-community=RO2597 trap-version=2", "/system ntp client set enabled=yes primary-ntp=172.24.213.41 secondary-ntp=172.18.25.10", cap_conf, "/user set admin password=#{ap_admin_password}", ] end def scheme1_fttx_config_gen_1(hostname, tunnel_id, hub_vip, ap_admin_password, ap_ssid, ap_wifi_ip, ap_wifi_gateway) [ "/system identity set name=#{hostname}", "/ip dns set servers=134.17.1.0,134.17.1.1", "/ip address add address=#{ap_wifi_ip} interface=ether1", "/ip route add dst-address=0.0.0.0/0 gateway=#{ap_wifi_gateway}", "/interface bridge add name=bridge_tunnel", "/interface eoip add remote-address=#{hub_vip.to_s} tunnel-id=#{tunnel_id.to_s} name=tunnel_to_hub", "/interface bridge port add interface=tunnel_to_hub bridge=bridge_tunnel", "/interface bridge port add interface=wlan1 bridge=bridge_tunnel", "/interface wireless set wlan1 mode=ap-bridge ssid=#{ap_ssid} disabled=no name=wireless_public_interface frequency=2427", "/user set admin password=#{ap_admin_password}", "/interface wireless set wlan2 disabled=yes" ] end end