Skip to content

Latest commit

 

History

History
219 lines (187 loc) · 6.98 KB

router.md

File metadata and controls

219 lines (187 loc) · 6.98 KB

Installation and configuration

Install OpenWrt firmware

Netgear Nighthawk X4S R7800

https://openwrt.org/toh/netgear/r7800

ASUS RT-AX53U

https://shadowshell.io/flash-openwrt-on-your-asus-rt-ax53u-router

TP-Link Archer C7

https://shadowshell.io/unbrick-your-tp-link-archer-c7-openwrt-router

Generic configuration

  • access: http://192.168.1.1
  • System --> Administration
    • --> Router Password: set root pw
    • --> HTTP(S) Access
      • Redirect to HTTPS: enable
    • --> SSH Access
      • Interface: LAN
      • Password authentication: disable
    • --> SSH-Keys
      • generate ssh keys and add public key
      • ssh-keygen -t ed25519
    • --> System
    • Software
      • run Update lists...
      • install packages
        • nano
        • fdisk
        • lsblk
        • pciutils
        • usbutils
        • luci-app-statistics

Network

  • Network
    • --> Firewall --> General Settings
      • Drop invalid packets: enable
      • Software flow offloading: enable
    • --> Interfaces
      • optional: edit lan IPv4 address (192.168.2.1 / 192.168.3.1 / ...)

Wireless

Static leases

  • Network --> DHCP and DNS --> Static Leases
  • chronos (Synology NAS) -> 192.168.1.100
  • Dahua XVR -> 192.168.1.101
  • vulcan (RPi backup NAS) -> 192.168.1.102

syslog

DNS

DDNS

WireGuard server

  • configure port forwarding (51820) when behind a NAT

Install WG and add peers

  • install wireguard-tools
  • install luci-proto-wireguard
  • follow https://openwrt.org/docs/guide-user/services/vpn/wireguard/server
    • when adding peers:
      • generate new keys for each peer
      • add description uci set network.wgclient.description="peer0"
      • route allowed IPs uci set network.wgclient.route_allowed_ips="1"
      • increment allowed IPs uci add_list network.wgclient.allowed_ips="${VPN_ADDR%.*}.2/32" uci add_list network.wgclient.allowed_ips="${VPN_ADDR6%:*}:2/128"

Create client configs

Zones

  • TLDR
    • Network
      • --> Firewall
        • --> General Settings
          • add zone Guest
            • Allow forward to destination zones: add wan
          • add zone IOT
          • edit lan
            • Allow forward to destination zones: add IOT
        • --> Traffic Rules
          • add rule
            • Name: Guest DHCP and DNS
            • Protocol: TCP and UDP
            • Source zone: Guest
            • Destination port: 53 67 68
      • --> Interfaces
        • add interface
          • Name: guest
          • Protocol: Static address
          • IPv4 Address: 10.20.30.40
          • IPv4 netmask: 255.255.255.0
          • DHCP Server tab --> Set Up DHCP Server
          • Firewall Settings tab --> Create / Assign firewall-zone: Guest
        • add interface
          • Name: iot
          • IPv4 Address: 172.16.0.1
          • Firewall Settings tab --> Create / Assign firewall-zone: IOT
          • other settings are the same as above
      • --> Wireless
        • add interface
          • ESSID: Helios-Guest
          • Network: guest
          • refer to Wireless for the remaining settings
        • add interface
          • ESSID: Helios-IOT
          • Network: iot
          • refer to Wireless for the remaining settings
    • XVR
      • change the IP to 172.16.0.2
      • remove the Dahua XVR -> 192.168.1.101 static lease
  • references

System hardening