From b978a3d468ccc659a18b2384ce60dea802fb4f55 Mon Sep 17 00:00:00 2001 From: Christian Zeitnitz Date: Sun, 7 Mar 2021 20:35:58 +0100 Subject: [PATCH] Add UDEV prototypes for network devices --- config/client_udev_prototypes.json | 49 ++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 config/client_udev_prototypes.json diff --git a/config/client_udev_prototypes.json b/config/client_udev_prototypes.json new file mode 100644 index 00000000..d0ec6e00 --- /dev/null +++ b/config/client_udev_prototypes.json @@ -0,0 +1,49 @@ +{ + "info": "UDEV rules for different client types. $...$ expressions will be replaces automatically ($MAC$, $IDVENDOR$, $IDPRODUCT$, $DEVNAME$)", + "udev_rules_file": "/etc/udev/rules.d/80-raspap-net-devices.rules", + "script_path": "/usr/local/sbin", + "network_devices": [ + { + "type": "eth", + "type_info": "ethernet port", + "clientid": 0, + "comment": "standard ethernet port", + "name_prefix": "eth", + "udev_rule": "SUBSYSTEM==\"net\", ACTION==\"add\", ATTR{address}==\"$MAC$\", NAME=\"$DEVNAME$\" " + }, + { + "type": "wlan", + "type_info": "wireless adapter", + "clientid": 1, + "comment": "standard wireless interface", + "name_prefix": "wlan", + "udev_rule": "SUBSYSTEM==\"net\", ACTION==\"add\", ATTR{address}==\"$MAC$\", NAME=\"$DEVNAME$\" " + }, + { + "type": "ppp", + "type_info": "mobile data modem", + "clientid": 2, + "name_prefix": "ppp", + "comment": "recognized mobile data modems are automatically named as ppp0-9. Renaming is not possible. Dialin service relies on the name", + "udev_rule": "SUBSYSTEM==\"tty\", KERNEL==\"ttyUSB0\", TAG+=\"systemd\", ENV{SYSTEMD_WANTS}=\"start start_ppp0_device.service\" " + }, + { + "type": "hilink", + "type_info": "Huawei Hilink", + "clientid": 3, + "comment": "Huawei mobile data device in router mode. Control via HTTP", + "name_prefix": "hilink", + "default_ip": "192.168.8.1", + "udev_rule": "SUBSYSTEM==\"net\", ACTION==\"add\", SUBSYSTEMS==\"usb\", ATTRS{idVendor}==\"$IDVENDOR$\", ATTRS{idProduct}==\"$IDPRODUCT$\", NAME=\"$DEVNAME$\", TAG+=\"systemd\", ENV{SYSTEMD_WANTS}=\"start start_huawei_hilink.service\" " + }, + { + "type": "phone", + "type_info": "USB tethered phone", + "clientid": 4, + "comment": "ethernet access provided by tethering from phone via USB", + "name_prefix": "phone", + "udev_rule": "SUBSYSTEM==\"net\", ACTION==\"add\", ATTR{address}==\"$MAC$\", NAME=\"$DEVNAME$\" " + } + ] +} +