Hi I’m looking to automatically attach my client network in AP+STA (repeater mode) to the lan network, this is because I regularly switch networks and as the repeater only assigns to lan, I have to go to LUCI and check the lan box each time so it follows my custom firewall rules.
I am wondering if there is a simple modification I can make to the code to achieve this? I’ve posted some of the code I was looking at below:
<form id="form-wan-repeater"><input name="wan-proto" type="hidden" value="wifi" />
<input name="action" type="hidden" value="updatewan" />
<input id="wan-encryption" name="wan-encryption" type="hidden" value="" />
<input id="wan-channel" name="wan-channel" type="hidden" value="auto" />
<input id="wan-mac" name="wan-mac" type="hidden" value="" />
<div>
<select id="wan-ssid" class="form-control" name="wan-ssid"></select>
</div>
<code><script>// <![CDATA[
fill_wan_settings(); //get wan settings from server //change mode: cable, repeater, 3g, phone $("input[name='wan-mode']").change( function(){ var wan_mod=$("input[name='wan-mode']:checked").val(); if(wan_mod=="wifi") { scanwifi(); } }); //submit information $("#submit_wan").click(function(){ console.log("check validity"); $("#wan-message").text(""); var wan_mod=$("input[name='wan-mode']:checked").val(); var data; if(wan_mod=="wifi"){ data=$("#form-wan-repeater").serialize(); console.log("data="+data); } console.log("start to update"); $.ajax({ type: "POST", url: "/cgi-bin/router_cgi", data: data, dataType: 'json', success: function(result){ console.log("update success"); if(result.success){ close_modal(); }else{ $("#wan-message").text(result.error); } }, error: function(xhr, textStatus, errorThron){ $("#wan-message").text(textStatus); console.log("update error"); } }); }); //choose scanned stations $("#wan-ssid").change(function(){ var index=$("#wan-ssid").get(0).selectedIndex; $("#wan-encryption").val( stations[index].Encryption ); $("#wan-channel").val(stations[index].Channel); $("#wan-mac").val(stations[index].MAC); });
// ]]></script>
</form>
</form>
</form>
</form>
</form>