Skip to content

Instantly share code, notes, and snippets.

@davidrea
Last active December 27, 2023 00:09
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidrea/0ca587763920f706ef9b013d552581a7 to your computer and use it in GitHub Desktop.
Save davidrea/0ca587763920f706ef9b013d552581a7 to your computer and use it in GitHub Desktop.
EdgeRouter X Setup Journal

Setup Journal for EdgeRouter X

Out-of-box

  1. Power up, connect to eth0
  2. Wait for cold boot sequence; can be up to 2 minutes
  3. Access:
  • Via web interface at 192.168.1.1, UN/PW both ubnt
  • ssh ubnt@192.168.1.1
  1. Add admin user, log in as admin user, delete default user
  • configure
  • edit system login
  • set user dave
  • set user dave level admin
  • set user dave plaintext-password {something}
  • commit
  • save
  • Log out, log in as new user
  • configure
  • delete system login user ubnt
  • Commit and save

System Settings

  1. Set system name servers: 1.1.1.1, 8.8.8.8
  • set system name-server 1.1.1.1
  • set system name-server 8.8.8.8
  1. Update system image to latest revision of firmware (instructions)
  • From non-configure prompt: add system image {url to image}
  • Or, from host, scp image into /home/{username} then add system image {image filename}
  • Verify new image is set as boot default: show system image
  • reboot
  1. Set system host name ("EdgeRouterX"?)
  • set system host-name {something}

Interfaces

This section assumes that the router's WAN interface is connected to eth0, so that passive PoE can be injected and passed through to eth4 to power a UniFi access point.

  1. Set eth0 as Internet / WAN connection:
  2. Reassign eth0 IP address to 192.168.x.3/24, log in at that address
  3. Set IP address for switch0 to manual, 192.168.x.1/24
  4. Set eth0 as DHCP: * dhcp-options default-route update * dhcp-options default-route-distance 210 * dhcp-options name-server update
  5. Set eth1 through eth4 as LAN, attach to switch
  6. Enable PoE on eth4

Firewall and NAT

  1. Enable hairpin NAT:
  • WAN interface: eth0
  • LAN interface: switch0
  1. Add port forwarding rules, if required
  2. Add firewall rulesets and rules
  • WAN_IN (Traffic from WAN to LAN, eth0 to in):
    • Allow established/related
    • Drop invalid state
  • WAN_LOCAL (Traffic to WAN to Router, eth0 to local)
    • Allow established/related
    • Drop invalid state
  1. Add Source NAT rule:
  • Outbound interface eth0
  • Use Masquerade
  • All protocols

DHCP

  1. Add DHCP server
  2. Add Subnet 192.168.x.0/24
  3. Set Range
  4. Router is 192.168.x.1 (the EdgeRouter's address)
  5. Set DNS resolvers served to DHCP clients
  6. Set DHCP server as authoritative
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment