Raum/WLAN-Router Access-Point: Unterschied zwischen den Versionen

Aus C3MAWiki
Zur Navigation springenZur Suche springen
Keine Bearbeitungszusammenfassung
 
(2 dazwischenliegende Versionen von einem anderen Benutzer werden nicht angezeigt)
Zeile 165: Zeile 165:
option igmp_snooping '1'
option igmp_snooping '1'
option proto 'static'
option proto 'static'
option ipaddr '192.168.2.2'
option ipaddr '10.23.42.2'
option netmask '255.255.255.0'
option netmask '255.255.255.0'
option gateway '192.168.2.1'
option gateway '10.23.42.1'
option dns '192.168.2.1 8.8.8.8'
option dns '10.23.42.2'


config rule6 'wan6_lookup'
config rule6 'wan6_lookup'
Zeile 216: Zeile 216:
option trigger 'phy0tpt'
option trigger 'phy0tpt'
</pre>
</pre>
===DNS===
Für das OpenWrt CLI muss ein DNS konfiguriert werden, sonst funktioniert die Namensauflösung vom Paket-Manager (opkg) nicht.
<pre>
# Configure DNS provider
uci set network.wan.peerdns="0"
uci set network.wan.dns="8.8.8.8 8.8.4.4"
uci set network.wan6.peerdns="0"
uci set network.wan6.dns="2001:4860:4860::8888 2001:4860:4860::8844"
uci commit network
/etc/init.d/network restart
</pre>
===Passwort===
Folgendes eingeben und Password setzen:
<pre>
passwd
</pre>
===WEB-SERVER===
WEB-Server von luci abschalten
<pre>
/etc/init.d/uhttpd stop
/etc/init.d/uhttpd disable
</pre>
== Update ==
===Pakete===
Die installierten Pakete (ohne Kernel) können mit "opkg" aktualisiert werden:
<pre>
opkg update
opkg list-upgradable
opkg upgrade <pkgs>
</pre>
===SYSTEM===
Die Aktualisierung der OpenWrt Firmware (ink. Kernel) ist nur mittels Images und dem "''sysupgrade''" Tool möglich.


==Quellen==
==Quellen==

Aktuelle Version vom 21. Oktober 2022, 22:55 Uhr

WLAN-Router Access-Point

System

Im Raum ist ein TP-Link N750 (Modell: TL-WDR4300) Wireless Gigabit Router installiert, dessen Betriebssystem OpenWrt [1] ist.

Ein passendes Firmware-Image (ath79/generic) kann mit Hilfe des OpenWrt Firmware-Selector [2] ausgewählt und heruntergeladen werden, so dass anschließen die Installation erfolgen kann.

Aktuell ist die Stable Release - OpenWrt 21.02.1 installiert.

Der Router ist über den WAN-Port mit dem Raum-Netz verbunden, der interne Switch wird aktuell nicht genutzt.

Installation

Nach der Installation hat OpenWrt eine voreingestellte IP Adresse (192.168.1.1), die am "internen Switch" bereitgestellt wird.

Der OpenWrt Default-User ist "root", beim erst Login ohne Passwort (leave this blank!).

Für den Betrieb im Raum ist daher die Konfiguration von WAN IP-Adresse, SSH, WLAN und ändern des "root" Passworts nötig.

Konfiguration

WLAN

/etc/config/wireless

config wifi-device 'radio0'
	option type 'mac80211'
	option hwmode '11g'
	option htmode 'HT20'
	option channel '6'
	option country 'DE'
	option txpower '20'
	option legacy_rates '0'
	option path 'platform/ahb/18100000.wmac'

config wifi-device 'radio1'
	option type 'mac80211'
	option hwmode '11a'
	option path 'pci0000:00/0000:00:00.0'
	option htmode 'HT20'
	option country 'DE'
	option channel '40'
	option txpower '20'

config wifi-iface 'wan_radio0'
	option disabled '0'
	option network 'wan'
	option encryption 'psk2'
	option device 'radio0'
	option mode 'ap'
	option key 'Hier_das_Passwort!'
	option ssid 'C3MA'
	option macaddr '8a:e4:a0:f3:5a:2b'
	option ifname 'wan0'

config wifi-iface 'wan_radio1'
	option disabled '0'
	option network 'wan'
	option encryption 'psk2'
	option device 'radio1'
	option mode 'ap'
	option key 'Hier_das_Passwort!'
	option ssid 'C3MA'
	option macaddr '8a:e4:a0:f3:5a:2f'
	option ifname 'wan1'

SSH

/etc/config/dropbear

config dropbear
	option PasswordAuth 'on'
	option RootPasswordAuth 'on'
	option Port         '22'
#	option BannerFile   '/etc/banner'

Firewall

/etc/config/firewall

folgende Regeln hinzufügen:

config forwarding
	option src 'lan'
	option dest 'wan'

config rule
	option name 'Allow-DHCP-Renew'
	option src 'wan'
	option proto 'udp'
	option dest_port '68'
	option target 'ACCEPT'
	option family 'ipv4'

config rule
	option name 'Allow-DHCPv6'
	option src 'wan'
	option proto 'udp'
	option src_ip 'fe80::/10'
	option src_port '547'
	option dest_ip 'fe80::/10'
	option dest_port '546'
	option family 'ipv6'
	option target 'ACCEPT'

config rule 'wan_ssh'
	option dest_port '22'
	option src 'wan'
	option name 'wan_ssh'
	option target 'ACCEPT'
	option proto 'tcp'

Network

/etc/config/network

config interface 'loopback'
	option ifname 'lo'
	option proto 'static'
	option ipaddr '127.0.0.1'
	option netmask '255.0.0.0'

config globals 'globals'
	option ula_prefix 'fdad:a467:2968::/48'

config interface 'wan6'
	option proto 'dhcpv6'
	option ifname 'br-wan'
	option ip6table '1'
	option peerdns '0'
	option sourcefilter '0'
	option reqprefix 'no'
	option dns '2001:4860:4860::8888 2001:4860:4860::8844'

config switch
	option name 'switch0'
	option reset '1'
	option enable_vlan '1'

config switch_vlan
	option device 'switch0'
	option vlan '1'
	option ports '0t 2 3 4 5'

config switch_vlan
	option device 'switch0'
	option vlan '2'
	option ports '0t 1'

config interface 'wan'
	option ifname 'eth0.2'
	option auto '1'
	option peerdns '0'
	option type 'bridge'
	option multicast_querier '0'
	option macaddr '8a:e4:a0:f3:5a:28'
	option igmp_snooping '1'
	option proto 'static'
	option ipaddr '10.23.42.2'
	option netmask '255.255.255.0'
	option gateway '10.23.42.1'
	option dns '10.23.42.2'

config rule6 'wan6_lookup'
	option mark '0x01/0x01'
	option lookup '1'

config route6 'wan6_unreachable'
	option type 'unreachable'
	option table '1'
	option target '::/0'
	option metric '65535'
	option gateway '::'
	option interface 'loopback'

System

/etc/config/system

config system
	option timezone 'CET-1CEST,M3.5.0,M10.5.0/3'
	option hostname 'wlan-c3ma'

config timeserver 'ntp'
	option enabled '1'
	option enable_server '0'
	list server 'ptbtime1.ptb.de'

config led 'led_usb1'
	option name 'USB1'
	option sysfs 'tp-link:green:usb1'
	option trigger 'usbdev'
	option dev '1-1.1'
	option interval '50'

config led 'led_usb2'
	option name 'USB2'
	option sysfs 'tp-link:green:usb2'
	option trigger 'usbdev'
	option dev '1-1.2'
	option interval '50'

config led 'led_wlan2g'
	option name 'WLAN2G'
	option sysfs 'tp-link:blue:wlan2g'
	option trigger 'phy0tpt'

DNS

Für das OpenWrt CLI muss ein DNS konfiguriert werden, sonst funktioniert die Namensauflösung vom Paket-Manager (opkg) nicht.

# Configure DNS provider
uci set network.wan.peerdns="0"
uci set network.wan.dns="8.8.8.8 8.8.4.4"
uci set network.wan6.peerdns="0"
uci set network.wan6.dns="2001:4860:4860::8888 2001:4860:4860::8844"
uci commit network
/etc/init.d/network restart

Passwort

Folgendes eingeben und Password setzen:

passwd

WEB-SERVER

WEB-Server von luci abschalten

/etc/init.d/uhttpd stop
/etc/init.d/uhttpd disable


Update

Pakete

Die installierten Pakete (ohne Kernel) können mit "opkg" aktualisiert werden:

opkg update
opkg list-upgradable
opkg upgrade <pkgs>

SYSTEM

Die Aktualisierung der OpenWrt Firmware (ink. Kernel) ist nur mittels Images und dem "sysupgrade" Tool möglich.

Quellen

[1] https://openwrt.org/

[2] https://firmware-selector.openwrt.org/