A10

From Hurlster Wiki
Jump to navigation Jump to search
  • A10 Thunder 840 (TH840) Opnsense firewall

Direct write the opensense nano amd64 img to a SSD or a Compact Flash. Boot the appliance and you have <3minutes to create the file and execute it.

  • A10 Thunder 840 install of Opnsense:

Must create watchdog disable script with "vi"

  • vi /tmp/disarm_wdt.c
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <machine/cpufunc.h>

#define PORT_INDEX 0x4E
#define PORT_DATA  0x4F

int main(void) {
    int fd = open("/dev/io", O_RDONLY);
    if (fd < 0) {
        perror("Failed to open /dev/io");
        return 1;
    }

    /* Enter Extended Function Mode */
    outb(PORT_INDEX, 0x87);
    outb(PORT_INDEX, 0x87);

    /* Select Logical Device 8 (Watchdog Timer) */
    outb(PORT_INDEX, 0x07);
    outb(PORT_DATA, 0x08);

    /* Set timeout counter to 0 (CR F6) */
    outb(PORT_INDEX, 0xF6);
    outb(PORT_DATA, 0x00);

    /* Deactivate device (CR 30 = 0x00) */
    outb(PORT_INDEX, 0x30);
    outb(PORT_DATA, 0x00);

    /* Exit Extended Function Mode */
    outb(PORT_INDEX, 0xAA);

    close(fd);
    printf("NCT6776F hardware watchdog disarmed successfully.\n");
    return 0;
}
cc -O2 /tmp/disarm_wdt.c -o /usr/local/etc/rc.syshook.d/early/05-disarm_wdt
chmod 755 /usr/local/etc/rc.syshook.d/early/05-disarm_wdt
/usr/local/etc/rc.syshook.d/early/05-disarm_wdt