Ubiquiti UniFi Security Gateway 3P (USG-3P)

The USG-3P model is the entry-level router/firewall in the Ubiquiti UniFi family, ideal for small environments with up to 200 users. It has 3 10/100/1000 network interfaces, WAN1 is exclusively for connecting to the Internet and LAN1 is exclusively for connecting to the internal network. There is still a third interface that can be used to connect another local network or even another Internet link for availability or load-balancing purposes (failover and load-balancing).

The 4MB SPI flash contains only the bootloader. Nonvolatile mass storage of the OS kernel and filesystem is provided by a 4GB USB flash drive plugged into an internal port. The CPU's USB port is dedicated to access this drive, and is inside the enclosure. There are no USB ports on the outside of the case.

The development branch can contain experimental code that is under active development and should not be used for production environments. Snapshot images may support additional hardware; however, it is experimental, considered unstable, and sometimes won't compile.

Prebuilt snapshot images do not come with any web interface or GUI. You will need to be comfortable using a command line and remote shell to install one yourself → How to install LuCI

There is currently no way to install OpenWrt through the Ubiquiti web interface. The possibilities of this happening are rather slim, given the firmware checks Ubiquiti tends to implement.

The layout of the SPI flash is not well known, mostly because it is not important since the installation and operation of OpenWrt occurs entirely within the USB flash drive. The USB drive contains two partitions, one holding the kernel and the other is the rootfs.

  • Installation is an offline process of removing the USB flash drive from inside the USG-3P and using a Linux system to place the OpenWrt kernel and filesystem on it. As the OpenWrt firmware is packaged as a squashfs, it has to be un-squashed and copied to the flash drive. Then the drive can be reinstalled into the USG-3P and it will directly boot up OpenWrt.
  • The bootloader in the USG-3P is stored on the SPI flash. It will scan the USB drive and boot any main kernel from it. Thus there is no need to change anything the internal SPI flash.
  • Of course you could entirely replace the USB drive with a different one and set the stock one aside with its OS intact for a trivial reversion to stock. The drive should be USB2.0, and must be quite physically small enough to fit inside the case: approximately 2cm long and no wider than the USB port itself. For example, a Kingston SE9 series fits.

To gain physical access to the USB drive, remove the three small Philips head screws from the top of the back panel, then slide the top/front case assembly forward and detach it from the bottom part which holds the circuit board.

Pull the flash drive out of the USB socket and plug it into a Linux computer on which you have root privileges.

Use lsblk to determine the drive location. The following descriptions assume it is sdb. CAUTION: Using the wrong drive name may cause severe loss of data on one of your other drives.

$ lsblk
...
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINTS
sdb      8:48   1  3,7G  0 disk 
├─sdb1   8:49   1  142M  0 part 
├─sdb2   8:50   1  1,6G  0 part 
└─sdb3   8:51   1  1,8G  0 part 
...

The factory partition scheme is intended to fit into a 2GB drive: 142MB in a FAT32 partition (which will hold the kernel) and 1.6GB in an ext3 partition (which is used for the rootfs). Many USG-3Ps appear to ship with a 4GB drive with 2GB unallocated. Re-partitioning is not strictly necessary unless you want to make extra space available in your rootfs, but it does not hurt.

If you are using a new drive, you will need to create two partitions, one FAT32 (142MB recommended) and one empty partition for OpenWrt's rootfs. They can be of almost any size, within reason.

Here we are re-using the original USB drive, expanding the rootfs partition (/dev/sdb2, here) to use all available space.

$ sudo fdisk /dev/sdb
 
Welcome to fdisk (util-linux 2.28.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
 
 
Command (m for help): p
Disk /dev/sdb: 3.6 GiB, 3880452096 bytes, 7579008 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x8c6e0e00
 
Device     Boot  Start     End Sectors  Size Id Type
/dev/sdb1         2048  292863  290816  142M  c W95 FAT32 (LBA)
/dev/sdb2       292864 7579007 7286144  3.5G 83 Linux
 
Command (m for help): d
Partition number (1,2, default 2): 2
 
Partition 2 has been deleted.
 
Command (m for help): n
Partition type
   p   primary (1 primary, 0 extended, 3 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (2-4, default 2): 2
First sector (292864-7579007, default 292864):
Last sector, +sectors or +size{K,M,G,T,P} (292864-7579007, default 7579007):
 
Created a new partition 2 of type 'Linux' and of size 3.5 GiB.
 
Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

The FAT32 partition on the flash drive is about 145 MB, and holds two files:

  • the kernel file named vmlinux.64, and
  • and md5sum named vmlinux.64.md5, which holds only the 32 digit, hex encoded md5sum of the vmlinux.64 file.

The bootloader computes the md5 of the kernel while reading it, then compares it to the checksum file before continuing with the boot. We will create this file.

The second partition on the flash drive is a read-only squashfs in the stock firmware, and it's also where we will write the squashfs image of OpenWrt. On first boot, the OpenWrt system will use the rest of the space in this partition to create the read-write overlay partition.

We need to download the OpenWrt firmware .*-openwrt-octeon-ubnt_unifi-usg-squashfs-sysupgrade.tar file and manually extract the kernel (which is in ELF format, ready to use but needs to be renamed) and the rootfs (which is in squashfs format) to place it on the USB flash drive.

Download sysupgrade-squashfs file from openwrt-octeon-ubnt_unifi-usg-squashfs-sysupgrade.tar and untar it.

$ wget https://downloads.openwrt.org/snapshots/targets/octeon/generic/openwrt-octeon-ubnt_unifi-usg-squashfs-sysupgrade.tar
...
Connecting to downloads.openwrt.org (downloads.openwrt.org)|168.119.138.211|:443... connected.
HTTP request sent, awaiting response... 200 OK
...
$ tar -xf openwrt-octeon-ubnt_unifi-usg-squashfs-sysupgrade.tar

This will unpack to sysupgrade-ubnt,usg/

We will now mount the USB flash partitions and the squashfs partition on the loopback to transfer OpenWrt to the flash drive:

$ mkdir kernel
$ sudo mount /dev/sdb1 kernel

Copy the new kernel - renaming it from kernel to vmlinux.64 as this is the name the bootloader expects.

$ sudo cp sysupgrade-ubnt,usg/kernel kernel/vmlinux.64
$ md5sum kernel/vmlinux.64 | cut -d' ' -f 1 > vmlinux.64.md5
$ sudo cp vmlinux.64.md5 kernel/

Note: if you get an error when trying to copy the vmlinux.64 file or create the vmlinux.64.md5, try deleting these first: rm kernel/*

Now we write raw the squashfs filesystem to the second partition, it is the file called “root” in the extracted folder.

sudo dd if=sysupgrade-ubnt,usg/root of=/dev/sdb2 bs=4096

Finally, a little clean up:

$ umount kernel
$ sync
$ rm -rf kernel sysupgrade-ubnt,usg

Now place your USB drive back on your USG-3P and start it!

Connect your PC to the “eth1” port on the USG-3P;

As there is currently only the snapshop version, you will need to install the luci or luci-ssl package:

1. Connect internet cable in WAN PORT;

2. Connect USB console cabel in CONSOLE PORT RJ-45;

3. Run the commands:

   $opkg update
   $opkg install luci

Wait for the installation to complete.

If successful, now just access the OpenWrt GUI at https://192.168.1.1/

Basic configuration After flashing, proceed with this.
Set up your Internet connection, configure wireless, configure USB port, etc.

The default network configuration is:

Interface Name Description Default configuration
wan (eth0) LAN port 0 DHCP
eth1 LAN port 1 Not configured
eth2 LAN port 2 Not configured
br-lan bridge eth1+eth2 192.168.1.1/24
Instruction set MIPS64
Vendor Cavium Networks
bootloader U-Boot
System-On-Chip Octeon5020
CPU @Frq Cavium Dual cnMIPS Core V?.? @x500MHz
Flash size 4MiB + 2048 MiB USB Stick
Flash Chip Macronix MX29LV320ETTI-70G/Toshiba
RAM size 512 MB DDR2 RAM
RAM Chip Winbond W971GG8JB-25 x 4
On-Board Flash Storage 4 GB
Wireless na
switch Atheros AR8035 Gigabit PHY x3
Modem na
USB no
Serial Yes
JTAG Yes
Dimensions 135 x 135 x 28.3 mm (5.32 x 5.32 x 1.11“)
Weight 366 g (12.9 oz)
Max. Power Consumption 7W
Power Supply 12VDC, 1A Power Adapter

Front:

Back:

Backside label:

Note: This will void your warranty!

FIXME Describe what needs to be done to open the device, e.g. remove rubber feet, adhesive labels, screws, …

  • To remove the cover and open the device, do a/b/c

1. Remove the rubber pads from the bottom of the USG device, revealing four screws. Remove all four screws.

2.After removing all four screws, the top piece of the unit will lift off, revealing the main board of the USG device.

Screws:

Main PCB:
CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 82

port.serial general information about the serial port, serial port cable, etc.

There is an RJ45 console port which can be used with an RJ45 to 9pin serial cable. The connector pinout is the same as those found on much Cisco equipment and it uses true RS-232 levels. USB to TTL adapters must not be connected to this port, as the voltage levels are not compatible. Use a USB to RS-232 adapter or 9 pin RS-232 port mostly found on older computers, along with a 9 pin to RJ45 adapter wired to the Cisco standard.

Serial connection parameters for Ubiquiti Unifi Security Gateway 115200, 8N1

port.jtag general information about the JTAG port, JTAG cable, etc.

How to connect to the JTAG Port of this specific device:
Insert photo of PCB with markings for JTAG port

Looking for valid bootloader image.... Jumping to start of image at address 0xbfc80000 U-Boot 1.1.1 (UBNT Build ID: 4674499-gfa58f5d) (Build time: Jun 9 2014 - 14:38:01) BIST check passed. UBNT_E120 r1:0, r2:16, f:8/135, serial #: 802aa8cda658 MPR 13-02044-16 Core clock: 500 MHz, DDR clock: 266 MHz (532 Mhz data rate) DRAM: 512 MB Clearing DRAM....... done Flash: 8 MB Net: octeth0, octeth1, octeth2 USB: (port 0) scanning bus for devices... 1 USB Devices found scanning bus for storage devices... Device 0: Vendor: Prod.: USB DISK 2.0 Rev: PMAP Type: Removable Hard Disk Capacity: 3824.0 MB = 3.7 GB (7831552 x 512) 0 reading vmlinux.64 ............................. 5755016 bytes read argv[2]: coremask=0x3 argv[3]: root=/dev/sda2 argv[4]: rootdelay=15 argv[5]: rw argv[6]: rootsqimg=squashfs.img argv[7]: rootsqwdir=w argv[8]: mtdparts=phys_mapped_flash:512k(boot0),512k(boot1),64k@1024k(eeprom) ELF file is 64 bit Allocating memory for mapped kernel segment, alignment: 0x400000 Allocated memory for ELF segment: addr: 0x400000, size 0x686350 Processing PHDR 0 Loading 57ba80 bytes at 400000 Clearing 10a8d0 bytes at 97ba80 ## Loading Linux kernel with entry point: 0x007e5c60 ... Bootloader: Done loading app on coremask: 0x3 Linux version 3.10.107-UBNT (ubnt@d1884d62bf1e) (gcc version 4.7.0 (Cavium Inc. Version: SDK_3_1_0_p2 build 34) ) #1 SMP Wed Apr 8 20:42:08 UTC 2020 CVMSEG size: 2 cache lines (256 bytes) Cavium Inc. SDK-3.1.2 bootconsole [early0] enabled CPU revision is: 000d0601 (Cavium Octeon+) Checking for the multiply/shift bug... no. Checking for the daddiu bug... no. Determined physical RAM map: memory: 000000000053b000 @ 0000000000400000 (kernel data and code) memory: 0000000000045000 @ 000000000093b000 (usable after init) memory: 0000000000107000 @ 0000000000980000 (kernel data and code) memory: 0000000007400000 @ 0000000000d00000 (usable) memory: 0000000007c00000 @ 0000000008300000 (usable) memory: 000000000fc00000 @ 0000000410300000 (usable) software IO TLB [mem 0x0170d000-0x0174d000] (0MB) mapped at [800000000170d000-800000000174cfff] Zone ranges: DMA32 [mem 0x00400000-0xefffffff] Normal [mem 0xf0000000-0x41fefffff] Movable zone start for each node Early memory node ranges node 0: [mem 0x00400000-0x00a86fff] node 0: [mem 0x00d00000-0x080fffff] node 0: [mem 0x08300000-0x0fefffff] node 0: [mem 0x410300000-0x41fefffff] Primary instruction cache 32kB, virtually tagged, 4 way, 64 sets, linesize 128 bytes. Primary data cache 16kB, 64-way, 2 sets, linesize 128 bytes. Secondary unified cache 128kB, 8-way, 128 sets, linesize 128 bytes. PERCPU: Embedded 10 pages/cpu @800000000178a000 s10880 r8192 d21888 u40960 Built 1 zonelists in Zone order, mobility grouping on. Total pages: 125878 Kernel command line: bootoctlinux $loadaddr coremask=0x3 root=/dev/sda2 rootdelay=15 rw rootsqimg=squashfs.img rootsqwdir=w mtdparts=phys_mapped_flash:512k(boot0),512k(boot1),64k@1024k(eeprom) console=ttyS0,115200 PID hash table entries: 2048 (order: 2, 16384 bytes) Dentry cache hash table entries: 65536 (order: 7, 524288 bytes) Inode-cache hash table entries: 32768 (order: 6, 262144 bytes) Memory: 495244k/504084k available (4033k kernel code, 8840k reserved, 1321k data, 276k init, 0k highmem) SLUB: HWalign=128, Order=0-3, MinObjects=0, CPUs=2, Nodes=1 Hierarchical RCU implementation. Additional per-CPU info printed with stalls. NR_IRQS:511 Calibrating delay loop (skipped) preset value.. 1000.00 BogoMIPS (lpj=5000000) pid_max: default: 32768 minimum: 501 Security Framework initialized Mount-cache hash table entries: 256 Checking for the daddi bug... no. SMP: Booting CPU01 (CoreId 1)... CPU revision is: 000d0601 (Cavium Octeon+) Brought up 2 CPUs NET: Registered protocol family 16 bio: create slab <bio-0> at 0 SCSI subsystem initialized usbcore: registered new interface driver usbfs usbcore: registered new interface driver hub usbcore: registered new device driver usb Switching to clocksource OCTEON_CVMCOUNT NET: Registered protocol family 2 TCP established hash table entries: 4096 (order: 4, 65536 bytes) TCP bind hash table entries: 4096 (order: 4, 65536 bytes) TCP: Hash tables configured (established 4096 bind 4096) TCP: reno registered UDP hash table entries: 256 (order: 1, 8192 bytes) UDP-Lite hash table entries: 256 (order: 1, 8192 bytes) NET: Registered protocol family 1 octeon_pci_console: Console not created. HugeTLB registered 2 MB page size, pre-allocated 0 pages squashfs: version 4.0 (2009/01/31) Phillip Lougher Registering unionfs 2.5.13 (for 3.10.34) aufs 3.10.x-20141215 msgmni has been set to 967 io scheduler noop registered io scheduler cfq registered (default) Serial: 8250/16550 driver, 6 ports, IRQ sharing disabled 1180000000800.serial: ttyS0 at MMIO 0x1180000000800 (irq = 34) is a OCTEON console [ttyS0] enabled, bootconsole disabled console [ttyS0] enabled, bootconsole disabled 1180000000c00.serial: ttyS1 at MMIO 0x1180000000c00 (irq = 35) is a OCTEON loop: module loaded ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver OcteonUSB 16f0010000000.usbc: Octeon Host Controller OcteonUSB 16f0010000000.usbc: new USB bus registered, assigned bus number 1 OcteonUSB 16f0010000000.usbc: irq 56, io mem 0x00000000 hub 1-0:1.0: USB hub found hub 1-0:1.0: 1 port detected OcteonUSB: Registered HCD for port 0 on irq 56 usbcore: registered new interface driver usb-storage octeon_wdt: Initial granularity 5 Sec TCP: cubic registered NET: Registered protocol family 17 NET: Registered protocol family 15 Bootbus flash: Setting flash for 8MB flash at 0x1f400000 phys_mapped_flash: Found 1 x16 devices at 0x0 in 8-bit bank. Manufacturer ID 0x0000c2 Chip ID 0x0000c9 Amd/Fujitsu Extended Query Table at 0x0040 Amd/Fujitsu Extended Query version 1.1. phys_mapped_flash: Swapping erase regions for top-boot CFI table. number of CFI chips: 1 3 cmdlinepart partitions found on MTD device phys_mapped_flash Creating 3 MTD partitions on "phys_mapped_flash": 0x000000000000-0x000000080000 : "boot0" 0x000000080000-0x000000100000 : "boot1" 0x000000100000-0x000000110000 : "eeprom" Waiting 15sec before mounting root device... usb 1-1: new high-speed USB device number 2 using OcteonUSB usb-storage 1-1:1.0: USB Mass Storage device detected scsi0 : usb-storage 1-1:1.0 scsi 0:0:0:0: Direct-Access USB DISK 2.0 PMAP PQ: 0 ANSI: 6 sd 0:0:0:0: [sda] 7831552 512-byte logical blocks: (4.00 GB/3.73 GiB) sd 0:0:0:0: [sda] Write Protect is off sd 0:0:0:0: [sda] No Caching mode page found sd 0:0:0:0: [sda] Assuming drive cache: write through sd 0:0:0:0: [sda] No Caching mode page found sd 0:0:0:0: [sda] Assuming drive cache: write through sda: sda1 sda2 sda3 sd 0:0:0:0: [sda] No Caching mode page found sd 0:0:0:0: [sda] Assuming drive cache: write through sd 0:0:0:0: [sda] Attached SCSI removable disk kjournald starting. Commit interval 3 seconds EXT3-fs (sda2): using internal journal EXT3-fs (sda2): recovery complete EXT3-fs (sda2): mounted filesystem with journal data mode VFS: Mounted root (aufs filesystem) on device 0:11. Freeing unused kernel memory: 276K (ffffffffc053b000 - ffffffffc0580000) Algorithmics/MIPS FPU Emulator v1.5 INIT: version 2.88 booting INIT: Entering runlevel: 2 [ ok ] Starting FreeRADIUS daemon: freeradius. [ ok ] Starting routing daemon: rib. [....] Starting EdgeOS router: migrate rl-systemBusyBox v1.19.0 (2020-04-08 19:54:41 UTC) multi-call binary. Usage: rm [-irf] FILE... Remove (unlink) FILEs -i Always prompt before removing -f Never prompt -R,-r Recurse [FAIL] failed to initialize host keys ... failed! [ ok igure. Starting network plug daemon: netplugd. start-stop-daemon: warning: this system is not able to track process names longer than 15 characters, please use --exec instead of --name. Welcome to EdgeOS ubnt ttyS0 By logging in, accessing, or using the Ubiquiti product, you acknowledge that you have read and understood the Ubiquiti License Agreement (available in the Web UI at, by default, http://192.168.1.1) and agree to be bound by its terms. ubnt login:


Looking for valid bootloader image.... Jumping to start of image at address 0xbfc80000 U-Boot 1.1.1 (UBNT Build ID: 4674499-gfa58f5d) (Build time: Jun 9 2014 - 14:38:01) BIST check passed. UBNT_E120 r1:0, r2:16, f:8/135, serial #: 802aa8cda658 MPR 13-02044-16 Core clock: 500 MHz, DDR clock: 266 MHz (532 Mhz data rate) DRAM: 512 MB Clearing DRAM....... done Flash: 8 MB Net: octeth0, octeth1, octeth2 USB: (port 0) scanning bus for devices... 1 USB Devices found scanning bus for storage devices... Device 0: Vendor: Prod.: USB DISK 2.0 Rev: PMAP Type: Removable Hard Disk Capacity: 3824.0 MB = 3.7 GB (7831552 x 512) 0 reading vmlinux.64 ..................................................... 10681056 bytes read argv[2]: coremask=0x3 argv[3]: root=/dev/sda2 argv[4]: rootdelay=15 argv[5]: rw argv[6]: rootsqimg=squashfs.img argv[7]: rootsqwdir=w argv[8]: mtdparts=phys_mapped_flash:512k(boot0),512k(boot1),64k@1024k(eeprom) ELF file is 64 bit Allocating memory for ELF segment: addr: 0xffffffff81100000 (adjusted to: 0x1100000), size 0x1b7f6bc Allocated memory for ELF segment: addr: 0xffffffff81100000, size 0x1b7f6bc Processing PHDR 0 Loading a2e54d bytes at ffffffff81100000 Clearing 115116f bytes at ffffffff81b2e54d ## Loading Linux kernel with entry point: 0xffffffff8184be50 ... Bootloader: Done loading app on coremask: 0x3 [ 0.000000] Linux version 5.10.131 (builder@buildhost) (mips64-openwrt-linux-musl-gcc (OpenWrt GCC 11.3.0 r20176-a63aeaecf1) 11.3.02 [ 0.000000] CVMSEG size: 0 cache lines (0 bytes) [ 0.000000] printk: bootconsole [early0] enabled [ 0.000000] CPU0 revision is: 000d0601 (Cavium Octeon+) [ 0.000000] Wasting 278528 bytes for tracking 4352 unused pages [ 0.000000] Initrd not found or empty - disabling initrd [ 0.000000] Using appended Device Tree. [ 0.000000] software IO TLB: mapped [mem 0x0000000002d08000-0x0000000006d08000] (64MB) [ 0.000000] Primary instruction cache 32kB, virtually tagged, 4 way, 64 sets, linesize 128 bytes. [ 0.000000] Primary data cache 16kB, 64-way, 2 sets, linesize 128 bytes. [ 0.000000] Zone ranges: [ 0.000000] DMA32 [mem 0x0000000001100000-0x00000000efffffff] [ 0.000000] Normal [mem 0x00000000f0000000-0x000000041fbfffff] [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x0000000001100000-0x0000000002c7efff] [ 0.000000] node 0: [mem 0x0000000002d00000-0x00000000080fffff] [ 0.000000] node 0: [mem 0x0000000008200000-0x000000000fdfffff] [ 0.000000] node 0: [mem 0x0000000410000000-0x000000041fbfffff] [ 0.000000] Initmem setup node 0 [mem 0x0000000001100000-0x000000041fbfffff] [ 0.000000] On node 0, zone DMA32: 4352 pages in unavailable ranges [ 0.000000] On node 0, zone DMA32: 129 pages in unavailable ranges [ 0.000000] On node 0, zone DMA32: 256 pages in unavailable ranges [ 0.000000] On node 0, zone Normal: 512 pages in unavailable ranges [ 0.000000] On node 0, zone Normal: 1024 pages in unavailable ranges [ 0.000000] percpu: Embedded 19 pages/cpu s36896 r8192 d32736 u77824 [ 0.000000] Built 1 zonelists, mobility grouping on. Total pages: 122849 [ 0.000000] Kernel command line: mtdparts=phys_mapped_flash:512k(boot0)ro,512k(boot1)ro,64k(eeprom)ro root=/dev/sda2 rootfstype=squ0 [ 0.000000] Dentry cache hash table entries: 65536 (order: 7, 524288 bytes, linear) [ 0.000000] Inode-cache hash table entries: 32768 (order: 6, 262144 bytes, linear) [ 0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off [ 0.000000] Memory: 395960K/499196K available (7497K kernel code, 833K rwdata, 1804K rodata, 1308K init, 16701K bss, 103236K reserv) [ 0.000000] SLUB: HWalign=128, Order=0-3, MinObjects=0, CPUs=2, Nodes=1 [ 0.000000] rcu: Hierarchical RCU implementation. [ 0.000000] rcu: RCU restricting CPUs from NR_CPUS=16 to nr_cpu_ids=2. [ 0.000000] Tracing variant of Tasks RCU enabled. [ 0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 10 jiffies. [ 0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2 [ 0.000000] NR_IRQS: 127 [ 7.224267] clocksource: OCTEON_CVMCOUNT: mask: 0xffffffffffffffff max_cycles: 0xe6a171a037, max_idle_ns: 881590485102 ns [ 7.235209] Calibrating delay loop (skipped) preset value.. 1000.00 BogoMIPS (lpj=5000000) [ 7.243314] pid_max: default: 32768 minimum: 301 [ 7.248183] Mount-cache hash table entries: 1024 (order: 1, 8192 bytes, linear) [ 7.255331] Mountpoint-cache hash table entries: 1024 (order: 1, 8192 bytes, linear) [ 7.266657] rcu: Hierarchical SRCU implementation. [ 7.271713] dyndbg: Ignore empty _ddebug table in a CONFIG_DYNAMIC_DEBUG_CORE build [ 7.279709] smp: Bringing up secondary CPUs ... [ 7.285151] SMP: Booting CPU01 (CoreId 1)... [ 7.289523] CPU1 revision is: 000d0601 (Cavium Octeon+) [ 7.289863] smp: Brought up 1 node, 2 CPUs [ 7.303140] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns [ 7.312880] futex hash table entries: 512 (order: 4, 65536 bytes, linear) [ 7.321226] NET: Registered protocol family 16 [ 7.326405] thermal_sys: Registered thermal governor 'step_wise' [ 7.342188] Not in host mode, PCI Controller not initialized [ 7.404166] SCSI subsystem initialized [ 7.408288] usbcore: registered new interface driver usbfs [ 7.413881] usbcore: registered new interface driver hub [ 7.419201] usbcore: registered new device driver usb [ 7.424327] EDAC MC: Ver: 3.0.0 [ 7.434839] clocksource: Switched to clocksource OCTEON_CVMCOUNT [ 7.442591] NET: Registered protocol family 2 [ 7.447103] IP idents hash table entries: 8192 (order: 4, 65536 bytes, linear) [ 7.456699] tcp_listen_portaddr_hash hash table entries: 256 (order: 0, 4096 bytes, linear) [ 7.465050] TCP established hash table entries: 4096 (order: 3, 32768 bytes, linear) [ 7.472750] TCP bind hash table entries: 4096 (order: 4, 65536 bytes, linear) [ 7.479972] TCP: Hash tables configured (established 4096 bind 4096) [ 7.486403] UDP hash table entries: 256 (order: 1, 8192 bytes, linear) [ 7.492802] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear) [ 7.500126] NET: Registered protocol family 1 [ 7.504429] PCI: CLS 0 bytes, default 128 [ 7.513324] workingset: timestamp_bits=46 max_order=17 bucket_order=0 [ 7.528382] squashfs: version 4.0 (2009/01/31) Phillip Lougher [ 7.534364] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc. [ 7.546556] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252) [ 7.555344] octeon_gpio 1070000000800.gpio-controller: OCTEON GPIO driver probed. [ 7.563254] Serial: 8250/16550 driver, 16 ports, IRQ sharing enabled [ 7.573570] printk: console [ttyS0] disabled [ 7.577872] 1180000000800.serial: ttyS0 at MMIO 0x1180000000800 (irq = 41, base_baud = 31250000) is a OCTEON [ 7.587661] printk: console [ttyS0] enabled [ 7.587661] printk: console [ttyS0] enabled [ 7.595939] printk: bootconsole [early0] disabled [ 7.595939] printk: bootconsole [early0] disabled [ 7.606019] octeon_rng octeon_rng: Octeon Random Number Generator [ 7.625589] loop: module loaded [ 7.628780] Loading iSCSI transport class v2.0-870. [ 7.638017] physmap-flash 1f400000.nor: Can't get bank width from device tree [ 7.645301] physmap-flash: probe of 1f400000.nor failed with error -22 [ 7.665065] mdio_octeon 1180000001800.mdio: Probed [ 7.670214] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver [ 7.676887] ehci-pci: EHCI PCI platform driver [ 7.681511] ehci-platform: EHCI generic platform driver [ 7.687125] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver [ 7.693395] ohci-platform: OHCI generic platform driver [ 7.699584] usbcore: registered new interface driver usb-storage [ 7.706245] i2c-octeon 1180000001000.i2c: probed [ 7.711242] octeon_wdt: Initial granularity 5 Sec [ 7.718106] EDAC DEVICE0: Giving out device to module octeon-cpu controller cache: DEV octeon_pc_edac (INTERRUPT) [ 7.728790] EDAC DEVICE1: Giving out device to module octeon-l2c controller octeon_l2c_err: DEV octeon_l2c_edac (POLLED) [ 7.740049] octeon_lmc_edac octeon_lmc_edac.0: Disabled (ECC not enabled) [ 7.751140] Interface 0 has 3 ports (RGMII) [ 7.760272] octeon-hcd 16f0010000000.usbc: Octeon Host Controller [ 7.766512] octeon-hcd 16f0010000000.usbc: new USB bus registered, assigned bus number 1 [ 7.774874] octeon-hcd 16f0010000000.usbc: irq 56, io mem 0x00000000 [ 7.782496] hub 1-0:1.0: USB hub found [ 7.787163] hub 1-0:1.0: 1 port detected [ 7.791807] octeon-hcd 16f0010000000.usbc: Registered HCD for port 0 on irq 56 [ 7.800855] NET: Registered protocol family 10 [ 7.808125] Segment Routing with IPv6 [ 7.811944] NET: Registered protocol family 17 [ 7.816613] bridge: filtering via arp/ip/ip6tables is no longer available by default. Update your scripts to load br_netfilter if y. [ 7.830037] 8021q: 802.1Q VLAN Support v1.8 [ 7.834695] Bootbus flash: Setting flash for 8MB flash at 0x1f400000 [ 7.841175] phys_mapped_flash: Found 1 x16 devices at 0x0 in 8-bit bank. Manufacturer ID 0x0000c2 Chip ID 0x0000c9 [ 7.851607] Amd/Fujitsu Extended Query Table at 0x0040 [ 7.856820] Amd/Fujitsu Extended Query version 1.1. [ 7.861887] phys_mapped_flash: Swapping erase regions for top-boot CFI table. [ 7.869079] number of CFI chips: 1 [ 7.872528] 3 cmdlinepart partitions found on MTD device phys_mapped_flash [ 7.879455] Creating 3 MTD partitions on "phys_mapped_flash": [ 7.885264] 0x000000000000-0x000000080000 : "boot0" [ 7.891308] 0x000000080000-0x000000100000 : "boot1" [ 7.897270] 0x000000100000-0x000000110000 : "eeprom" [ 7.906735] OF: fdt: not creating '/sys/firmware/fdt': CRC check failed [ 7.913850] Waiting for root device /dev/sda2... [ 8.114076] usb 1-1: new high-speed USB device number 2 using octeon-hcd [ 8.617826] usb-storage 1-1:1.0: USB Mass Storage device detected [ 8.626066] scsi host0: usb-storage 1-1:1.0 [ 9.665268] scsi 0:0:0:0: Direct-Access USB DISK 2.0 PMAP PQ: 0 ANSI: 6 [ 9.676295] sd 0:0:0:0: [sda] 7831552 512-byte logical blocks: (4.01 GB/3.73 GiB) [ 9.684786] sd 0:0:0:0: [sda] Write Protect is off [ 9.690522] sd 0:0:0:0: [sda] No Caching mode page found [ 9.695914] sd 0:0:0:0: [sda] Assuming drive cache: write through [ 9.706804] sda: sda1 sda2 [ 9.713859] sd 0:0:0:0: [sda] Attached SCSI removable disk [ 9.727893] VFS: Mounted root (squashfs filesystem) readonly on device 8:2. [ 9.736061] Freeing unused kernel memory: 1308K [ 9.740609] This architecture does not have kernel memory protection. [ 9.747111] Run /sbin/init as init process [ 10.194963] init: Console is alive [ 10.198886] init: - watchdog - [ 10.548991] kmodloader: loading kernel modules from /etc/modules-boot.d/* [ 10.579466] kmodloader: done loading kernel modules from /etc/modules-boot.d/* [ 10.598221] init: - preinit - [ 11.568606] random: jshn: uninitialized urandom read (4 bytes read) [ 11.629237] random: jshn: uninitialized urandom read (4 bytes read) [ 11.670904] random: jshn: uninitialized urandom read (4 bytes read) Press the [f] key and hit [enter] to enter failsafe mode Press the [1], [2], [3] or [4] key and hit [enter] to select the debug level [ 14.327924] F2FS-fs (loop0): Mounted with checkpoint version = 8f5dc93 [ 14.336933] mount_root: switching to f2fs overlay [ 14.344884] overlayfs: "xino" feature enabled using 32 upper inode bits. [ 14.398807] FAT-fs (sda1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck. [ 14.420869] urandom-seed: Seeding with /etc/urandom.seed [ 14.567751] procd: - early - [ 14.570974] procd: - watchdog - [ 15.217042] procd: - watchdog - [ 15.221529] procd: - ubus - [ 15.282789] random: ubusd: uninitialized urandom read (4 bytes read) [ 15.291420] random: ubusd: uninitialized urandom read (4 bytes read) [ 15.298464] random: ubusd: uninitialized urandom read (4 bytes read) [ 15.309555] procd: - init - [ 15.314733] random: crng init done [ 15.318160] random: 15 urandom warning(s) missed due to ratelimiting Please press Enter to activate this console. [ 15.967652] urngd: v1.0.2 started. [ 16.145102] kmodloader: loading kernel modules from /etc/modules.d/* [ 16.241597] PPP generic driver version 2.4.2 [ 16.247556] NET: Registered protocol family 24 [ 16.261517] kmodloader: done loading kernel modules from /etc/modules.d/* [ 23.764888] br-lan: port 1(eth1) entered blocking state [ 23.770228] br-lan: port 1(eth1) entered disabled state [ 23.776345] device eth1 entered promiscuous mode [ 23.840645] br-lan: port 2(eth2) entered blocking state [ 23.846045] br-lan: port 2(eth2) entered disabled state [ 23.851770] device eth2 entered promiscuous mode [ 23.856810] br-lan: port 2(eth2) entered blocking state [ 23.862098] br-lan: port 2(eth2) entered forwarding state [ 23.868022] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready [ 24.807443] br-lan: port 2(eth2) entered disabled state [ 26.864172] eth1: 1000 Mbps Full duplex, port 1, queue 1 [ 26.869563] br-lan: port 1(eth1) entered blocking state [ 26.874880] br-lan: port 1(eth1) entered forwarding state BusyBox v1.35.0 (2022-07-28 13:17:04 UTC) built-in shell (ash) _______ ________ __ | |.-----.-----.-----.| | | |.----.| |_ | - || _ | -__| || | | || _|| _| |_______|| __|_____|__|__||________||__| |____| |__| W I R E L E S S F R E E D O M ----------------------------------------------------- OpenWrt SNAPSHOT, r20176-a63aeaecf1 -----------------------------------------------------


1. Plug the USB drive into a computer and verify it is actually functional. Sometimes USB drives die. If the drive is at least recognized by the computer, proceed to next step.

2. Download the factory-shipped image from Ubiquiti here:

 Ubiquiti: https://dl.ubnt-ut.com/cmb/USG-4_2_0-shipped.img.bz2
 Internet Archive: https://archive.org/details/usg-4-2-0-shipped.img 

3. Use your favorite image flashing utility to write the downloaded firmware onto the USB drive.

Note: I like to use *balenaEtcher*, but *Rufus* is a good alternative on Windows (> choco install rufus).
Attention: The firmware writing procedure can take 10+ minutes, so do not get frustrated and remove the   drive mid-write.

4. Once the factory image is flashed onto the USB drive and the image is verified, plug the USB drive back into the USG device. Turn on the device.

Note: The initial boot process can taken several minutes, but the light in the middle of the board will come on once it is running.

5. Reassemble the USG (and do not forget to reapply the sticky pads).

Note: Do not reattach it to the network yet.

6. Login to the Ubiquiti Network Manager Controller and forget the old USG.

7. Plug the USG back into the network and more than likely the Ubiquiti Network Manager Controller will automatically adopt it and reconfigure it.

Note: Make sure to apply all applicable updates to the USG, because the factory image is now out-of-date. 
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
  • Last modified: 2022/08/03 22:19
  • by hudsonfas