more wizard updates

This commit is contained in:
Corey Wagehoft 2025-10-25 09:15:56 -06:00
parent 7ee17c2986
commit ad695aaf74
4 changed files with 77 additions and 5 deletions

View File

@ -486,9 +486,11 @@ return wizard.AbstractWizardView.extend({
option.retain = true; option.retain = true;
option.widget = 'radio'; option.widget = 'radio';
option.orientation = 'vertical'; option.orientation = 'vertical';
option.default = 'bridge';
option.readonly = true;
option.value('none', _('None')); option.value('none', _('None'));
option.value('extender', _('Extender'));
option.value('bridge', _('Bridge')); option.value('bridge', _('Bridge'));
option.value('extender', _('Extender'));
option.onchange = function (ev, sectionId, value) { option.onchange = function (ev, sectionId, value) {
if (value == 'bridge') { if (value == 'bridge') {
this.page.updateInfoText(bridgeInfoSta, thisWizardView); this.page.updateInfoText(bridgeInfoSta, thisWizardView);

View File

@ -133,8 +133,8 @@ function createDhcp(dnsmasqName, networkSectionId) {
// We will also only use a range of /28 (16 addresses) to reduce the chance of clashes. // We will also only use a range of /28 (16 addresses) to reduce the chance of clashes.
// This means that the start address will be between x.x.0.255 and x.x.1.244 // This means that the start address will be between x.x.0.255 and x.x.1.244
// (i.e. 255 + (16 * 15)). // (i.e. 255 + (16 * 15)).
//const randomStart = 255 + (16 * Math.floor(Math.random() * 15)); const randomStart = 255 + (16 * Math.floor(Math.random() * 15));
const randomStart = 257; //const randomStart = 257;
uci.add('dhcp', 'dhcp', proposedName); uci.add('dhcp', 'dhcp', proposedName);
uci.set('dhcp', proposedName, 'start', randomStart.toString()); uci.set('dhcp', proposedName, 'start', randomStart.toString());
@ -444,10 +444,20 @@ function setupBatmanDeviceOnNetwork(gwMode = 'client', deviceName = 'bat0') {
} }
uci.set('network', deviceName, 'proto', 'batadv'); uci.set('network', deviceName, 'proto', 'batadv');
uci.set('network', deviceName, 'routing_algo', 'BATMAN_IV'); uci.set('network', deviceName, 'routing_algo', 'BATMAN_V');
uci.set('network', deviceName, 'bridge_loop_avoidance', '1'); uci.set('network', deviceName, 'bridge_loop_avoidance', '1');
uci.set('network', deviceName, 'hop_penalty', '30'); uci.set('network', deviceName, 'hop_penalty', '30');
uci.set('network', deviceName, 'bonding', '1'); uci.set('network', deviceName, 'bonding', '1');
uci.set('network', deviceName, 'aggregated_ogms', '1');
uci.set('network', deviceName, 'ap_isolation', '0');
uci.set('network', deviceName, 'fragmentation', '1');
uci.set('network', deviceName, 'orig_interval', '1000');
uci.set('network', deviceName, 'bridge_loop_avoidance', '1');
uci.set('network', deviceName, 'distributed_arp_table', '1');
uci.set('network', deviceName, 'multicast_mode', '1');
uci.set('network', deviceName, 'network_coding', '1');
uci.set('network', deviceName, 'hop_penalty', '30');
uci.set('network', deviceName, 'isolation_mark', '0x00000000/0x00000000');
uci.set('network', deviceName, 'gw_mode', gwMode); uci.set('network', deviceName, 'gw_mode', gwMode);
return deviceName; return deviceName;
@ -561,7 +571,7 @@ function setupNetworkWithDnsmasq(sectionId, ip, uplink = true, isMeshPoint = tru
uci.set('network', sectionId, 'dns', '1.1.1.1'); uci.set('network', sectionId, 'dns', '1.1.1.1');
uci.set('network', sectionId, 'ipaddr', getRandomIpaddr(ip)); uci.set('network', sectionId, 'ipaddr', getRandomIpaddr(ip));
} else { } else {
uci.set('network', sectionId, 'ipaddr', ip); uci.set('network', sectionId, 'ipaddr', '10.41.1.1');
} }
if (!uplink) { if (!uplink) {

View File

@ -291,6 +291,13 @@ function setDefaultWanFirewallRules(zone) {
uci.set('firewall', sid, 'dest_port', '500'); uci.set('firewall', sid, 'dest_port', '500');
uci.set('firewall', sid, 'proto', 'udp'); uci.set('firewall', sid, 'proto', 'udp');
uci.set('firewall', sid, 'target', 'ACCEPT'); uci.set('firewall', sid, 'target', 'ACCEPT');
sid = uci.add('firewall', 'rule');
uci.set('firewall', sid, 'name', 'Allow Batman Mesh TCP 4242');
uci.set('firewall', sid, 'src', '*');
uci.set('firewall', sid, 'dest', '*');
uci.set('firewall', sid, 'dest_port', '4242');
uci.set('firewall', sid, 'proto', 'tcp');
uci.set('firewall', sid, 'target', 'ACCEPT');
} }
/* Modify/add a network iface with the appropriate firewall zones/rules. /* Modify/add a network iface with the appropriate firewall zones/rules.

View File

@ -0,0 +1,53 @@
#!/bin/sh /etc/rc.common
START=96
STOP=10
USE_PROCD=1
start_service() {
# Enable cross-mesh client routing through batman-adv
logger "mesh-routing: Setting up cross-mesh client routes"
# Wait for network services to be ready
sleep 45
# Add routes for cross-mesh connectivity
(
# Wait for bat0 interface to be fully operational
local retry=0
while [ $retry -lt 30 ]; do
if ip link show bat0 >/dev/null 2>&1 && ip addr show bat0; then
logger "mesh-routing: bat0 interface is ready"
break
fi
retry=$((retry + 1))
logger "mesh-routing: Waiting for bat0 interface (attempt $retry/30)"
sleep 2
done
# Enable IP forwarding for cross-mesh client communication
echo 1 > /proc/sys/net/ipv4/ip_forward
logger "mesh-routing: IP forwarding enabled"
# Add routing rules for 10.41.0.0/16 mesh client subnet
if ! ip route show | grep -q "10.41.0.0/16"; then
ip route add 10.41.0.0/16 dev bat0 metric 100 2>/dev/null || true
logger "mesh-routing: Added route for mesh client subnet"
fi
# Enable multicast forwarding for batman-adv
echo 1 > /proc/sys/net/ipv4/conf/bat0/mc_forwarding 2>/dev/null || true
echo 1 > /proc/sys/net/ipv4/conf/br-ahwlan/mc_forwarding 2>/dev/null || true
# Setup ARP proxying for cross-mesh client discovery
echo 1 > /proc/sys/net/ipv4/conf/bat0/proxy_arp 2>/dev/null || true
echo 1 > /proc/sys/net/ipv4/conf/br-ahwlan/proxy_arp 2>/dev/null || true
logger "mesh-routing: Cross-mesh client routing configured"
) &
}
stop() {
logger "mesh-routing: Stopping mesh routing service"
}