forked from dan/liminix
1
0
Fork 0

bridging, dhcp client via wan port

add-archer-ax23-v1
Arnout Engelen 2024-01-27 20:43:18 +01:00
parent 2e57450a26
commit 525150acd7
No known key found for this signature in database
GPG Key ID: 061107B0F74A6DAA
2 changed files with 67 additions and 8 deletions

View File

@ -344,8 +344,8 @@ ZSTD_DECOMPRESS="y";
openwrt = pkgs.openwrt;
mac80211 = pkgs.mac80211.override {
drivers = [
"mt7615e"
"mt7915e"
#"mt7615e"
#"mt7915e"
];
klibBuild = config.system.outputs.kernel.modulesupport;
};
@ -395,7 +395,7 @@ ZSTD_DECOMPRESS="y";
};
# since this is mentioned in the partition table as well?
defaultOutput = "uimage";
defaultOutput = "tplink";
# taken from openwrt sysupgrade image:
# openwrt-23.05.2-ramips-mt7621-tplink_archer-ax23-v1-squashfs-sysupgrade.bin: u-boot legacy uImage, MIPS OpenWrt Linux-5.15.137, Linux/MIPS, OS Kernel Image (lzma), 2797386 bytes, Tue Nov 14 13:38:11 2023, Load Address: 0X80001000, Entry Point: 0X80001000, Header CRC: 0X19F74C5B, Data CRC: 0XF685563C
loadAddress = lim.parseInt "0x80001000";
@ -418,9 +418,14 @@ ZSTD_DECOMPRESS="y";
lan2 = link.build { ifname = "lan2"; };
lan3 = link.build { ifname = "lan3"; };
lan4 = link.build { ifname = "lan4"; };
wan = link.build { ifname = "wan"; };
wan = link.build {
ifname = "wan";
wlan = link.build {
ifname = "wlan0";
dependencies = [ mac80211 ];
};
wlan5 = link.build {
ifname = "wlan1";
dependencies = [ mac80211 ];
};
};

View File

@ -2,12 +2,25 @@
let
inherit (pkgs) serviceFns;
svc = config.system.service;
wirelessConfig = {
country_code = "NL";
# TODO
wpa_passphrase = "ABCD1234";
auth_algs = 1; # 1=wpa2, 2=wep, 3=both
wpa = 2; # 1=wpa, 2=wpa2, 3=both
wpa_key_mgmt = "WPA-PSK";
wpa_pairwise = "TKIP CCMP"; # auth for wpa (may not need this?)
rsn_pairwise = "CCMP"; # auth for wpa2
wmm_enabled = 1;
};
in rec {
imports = [
../modules/wlan.nix
../modules/network
../modules/ssh
../modules/vlan
../modules/bridge
../modules/hostapd
];
boot.tftp = {
@ -18,10 +31,51 @@ in rec {
serverip = "192.168.0.5"; # build machine or other tftp server
};
hostname = "hello";
hostname = "yardbird";
services.hostap = svc.hostapd.build {
interface = config.hardware.networkInterfaces.wlan;
params = {
ssid = "liminix";
hw_mode="g";
channel = "2";
ieee80211n = 1;
} // wirelessConfig;
};
services.hostap5 = svc.hostapd.build {
interface = config.hardware.networkInterfaces.wlan5;
params = rec {
ssid = "liminix_5";
hw_mode="a";
channel = 36;
ht_capab = "[HT40+]";
vht_oper_chwidth = 1;
vht_oper_centr_freq_seg0_idx = channel + 6;
ieee80211ac = 1;
} // wirelessConfig;
};
services.int = svc.network.address.build {
interface = svc.bridge.primary.build { ifname = "int"; };
family = "inet"; address ="10.8.0.1"; prefixLength = 16;
};
services.bridge = svc.bridge.members.build {
primary = services.int;
members = with config.hardware.networkInterfaces;
[ wlan
wlan5
lan1
lan2
lan3
lan4
wan
];
};
services.dhcpc = svc.network.dhcp.client.build {
interface = config.hardware.networkInterfaces.lan1;
interface = config.hardware.networkInterfaces.wan;
# don't start DHCP until the hostname is configured,
# so it can identify itself to the DHCP server