Getting Started With Ubiquity Edgerouter

Why do I need an Edgerouter?

Ubquity’s near enterprise grade linux router gives you fine grain control over your home routing. I can think of several usecases such as

  1. Put entire/some traffic under vpn so I don’t need a vpn client working in every device I am using.
  2. Run my personal site (actualykasi.com) from edgerouter so I can cut down hosting costs. (More on how I achieved that in upcoming blog post)
  3. Play ground for vlan, nat, bgp and ospf etc.

I bought this device https://www.ui.com/edgemax/edgerouter-x/. Its is the lightest one also meet my needs.

Can I replace my current Linksys router with it?

Ans: Unless I don’t want wifi.

That correct. Edgerouter is not wifi capable.

If you have extra dollar and you are okay with wiring POE ethernet cables inside your house, I would strongly recommend buying a combo of edgerouter + Ubiquity’s access points. Do some research on their Unifi platform.

In my case, I will still be using my wifi router. So the setup will be composed of 3 devices instead of 2.

Modem -> Edgerouter -> Wifi Router

First Step: Configure your router.

Like any other router, this device comes with preconfigured 192.168.1.0/24 network and with gateway 192.168.1.1.

So our goal is to first connect to edge router via https://192.168.1.1. We need to attach our workstation to the same network.

Note: Almost all routers use the same internel network subnet. So the chances of clashing is super high. I would recommend to turn of your wifi before doing this. I am going to do with in a Mac but instructions will be same for Linux.

Edgerouter

  1. Connect Ethernet cable between your computer and eth0 of edge router as shown in the image.
  2. Find the interface to which it is connected. In my case it is en9
$ ip a
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
        inet 127.0.0.1/8 lo0
        inet6 ::1/128
        inet6 fe80::1/64 scopeid 0x1
en0: flags=8823<UP,BROADCAST,SMART,SIMPLEX,MULTICAST> mtu 1500
        ether 88:e9:fe:75:a4:8e
        inet 192.168.1.12/24 brd 192.168.1.255 en0
utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 2000
        inet6 fe80::564:d963:6fb5:da50/64 scopeid 0x10
utun1: flags=80d1<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1280
        inet6 fe80::8ae9:feff:fe75:a48e/64 scopeid 0x11
        inet 10.35.129.143 --> 10.35.129.143/23 utun1
        inet6 2400:cb00:35:10a::1/128
en6: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        ether ac:de:48:00:11:22
        inet6 fe80::aede:48ff:fe00:1122/64 scopeid 0x7
en9: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        ether 9c:eb:e8:a6:90:a4
        inet6 fe80::837:816a:c9ee:3c47/64 secured scopeid 0x12
  1. Add an IP address to the interface
$ sudo ifconfig en9 192.168.1.12 netmask 255.255.255.0
# Double check
$ ifconfig en9
en9: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
        ether 9c:eb:e8:a6:90:a4
        inet6 fe80::837:816a:c9ee:3c47%en9 prefixlen 64 secured scopeid 0x12
        inet 192.168.1.12 netmask 0xffffff00 broadcast 192.168.1.255
        nd6 options=201<PERFORMNUD,DAD>
        media: autoselect (1000baseT <full-duplex>)
        status: active

  1. See if you can ping router’s gateway.
 kasi@C02WT1MYHTDD  Documents/acutallykasi  ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes
Request timeout for icmp_seq 0
^C
--- 192.168.1.1 ping statistics ---
2 packets transmitted, 0 packets received, 100.0% packet loss
  1. Unfortunately you can’t ping yet. You need to reset the interface once.
$ sudo ifconfig en9 down
$ sudo ifconfig en9 up

$ ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1): 56 data bytes
Request timeout for icmp_seq 0
64 bytes from 192.168.1.1: icmp_seq=0 ttl=64 time=1004.217 ms
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.950 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.498 ms
^C
--- 192.168.1.1 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.498/335.222/1004.217/473.051 ms
  1. Access https://192.169.1.1 in browser

  2. You will be asked to do a basic setup wizard, Proceed to yes.

     7a. Leave everything as it is except check on `VLAN   Internet connection is on VLAN`
     7b. Enter vlan ID (eg: 10)
     7c. Click on Apply
     7d. Conrim to reboot
     7e. Disconnect ethernet cable from eth0 and connect to eth1. Confirm you are able to ping router after a while.
    

Its time to configure your wireless router

All you need to do is change the default router ip from 192.168.1.1 to somthing else and disable dhcp. We are planning to put edge router and my wireless router in the same network. There fore we need to make sure that ips don’t clash.

  1. Disconect from edgerouter, Connect to wifi. Put down/up corresponding interfaces if you face problem.
  2. Go to 192.168.1.1
  3. Find Network settings and change the management from 192.168.1.1 to 192.168.1.2. Also make sure that DHCP is turned off. DHCP server and gateway will be our edgerouter.
  4. You should be able to access http://192.168.1.2/ after a while

Final Step: Stitch Everything Together

  1. Connect Ethernet cable from modem that to eth0 port of edgerouter.
  2. Connect Ethernet cable from edgerouter’s eth1 port to wifi router’s eth1 port (LAN to LAN). Please don’t connect to WAN port.

You should be able to access internet via Wifi. Verify that you can access both routers via http://192.168.1.1 and http://192.168.1.2

Postscript

Note that there are several ways you can do this differently, such as interchanging ip address of routers, running DHCP on wireless router etc. You should feel free to experiment.

Happy home networking!