frazer.network

Category: Network Management

  • Configure Dynamic DNS Updater on Cisco IOS

    Step-by-step instructions to configure a DDNS using dynu.com.

    1 – Register an account on dynu.com

    Be sure to use a password you are happy to leave in the router config.

    https://dynu.com

    Once registered, navigate to Control Panel, DDNS Services:

    dynu-1

    Click ‘Add’.

    dynu-2

    Create your domain name of choice.

    dynu-3

    2 – Login to the Cisco router and configure DDNS

    Enable IP Domain Lookup

    ip name-server 1.1.1.1
    ip name-server 8.8.8.8
    ip domain lookup

    Configure DDNS updater to run at an interval of 90 seconds.

    Be sure to add your chosen domain name and the password used when registering your account to the below config.

    To insert a ‘?’ on the router CLI, press “ctrl+v” then “?”.

    ip ddns update method dynu.com
    HTTP
    add http://api.dynu.com/nic/update?hostname=example.loseyourip.com&password=s3cr3tPA55w0rd
    remove http://api.dynu.com/nic/update?hostname=example.loseyourip.com&password=s3cr3tPA55w0rd
    interval maximum 0 0 1 30

    3 – Enable DDNS Updater on Outside Interface

    interface Gi0/0
    ip ddns update hostname example.loseyourip.com
    ip ddns update dynu.com

    Troubleshoot

    If you encounter any issues, try “debug ip ddns update” and check through the logs.

    Ensure any ACLs/ZBFW have been configured to permit the DDNS traffic. (UDP/53 and TCP/80).

  • Configure FreeRADIUS on a Raspberry Pi

    free-radius-image

    This guide provides step-by-step instructions for installing and configuring a basic FreeRADIUS service on a Raspberry Pi, enabling it to authenticate logins for Cisco equipment.

    1. Update the System

    First, ensure that your system is up to date with the latest software packages:

    sudo apt update

    sudo apt upgrade -y

    2. Install FreeRADIUS

    Install FreeRADIUS from the official Ubuntu repositories. The package freeradius provides the RADIUS server and all the necessary utilities:

    sudo apt install freeradius freeradius-utils -y

    This command installs FreeRADIUS and some helpful utilities for managing RADIUS clients and users.

    3. Check FreeRADIUS Service Status

    After installation, the FreeRADIUS service should automatically start. To confirm it is running, check the status:

    sudo systemctl status freeradius

    You should see an output indicating that the service is active and running. If it’s not running, start it with:

    sudo systemctl start freeradius

    To enable FreeRADIUS to start at boot time:

    sudo systemctl enable freeradius

    4. Configure FreeRADIUS

    FreeRADIUS configuration files are located in /etc/freeradius/3.0/ (the version may vary depending on your Ubuntu version). The most important configuration files are:

    • /etc/freeradius/3.0/radiusd.conf: Main configuration file for the server.
    • /etc/freeradius/3.0/clients.conf: Used to configure clients (devices or servers that will use RADIUS).
    • /etc/freeradius/3.0/users: Used to configure user authentication.

    You can edit these files to suit your requirements.

    To configure clients, open the clients.conf file:

    sudo nano /etc/freeradius/3.0/clients.conf

    A simple example of a client configuration would look like this, where the ip address can be a host or the management subnet of the Cisco device. Add the following to the very top of the file:

    client Cisco {

        ipaddr = 172.16.255.0/24

        secret = SuperSecretPassword#2025

        require_message_authenticator = no

    }

    You can configure users by editing the users file:

    sudo nano /etc/freeradius/3.0/users

    Add new users at the very top of the file, for example:

    testuser Cleartext-Password := “password”

    Cisco-AVPair = “shell:priv-lvl=15”

    Formatting is very important here, the Cisco-AVPair line must be “tabbed”.

    5. Configure Cisco device:

    The following commands will configure radius for authentication and authorization, falling back to local credentials.

    This will configure the “default” group, so there’s no need to specify a AAA group on the VTY/Console lines.

    The console line will receive authorization upon authentication.

    Accounting has been configured to log locally to the device.

    Enable AAA

    aaa new-model

    aaa authentication login default group radius local line

    aaa authorization console

    aaa authorization exec default group radius local

    aaa accounting exec default start-stop logger

    Specify Radius Server

    radius server RADIUS-SERVER-01

     address ipv4 x.x.x.x auth-port 1812 acct-port 1813

     timeout 3

     retransmit 3

     key 0 SuperSecretPassword#2025

    Specify radius source interface

    ip radius source-interface Loopback1

    6. Verify radius server is reachable:

    show aaa servers

    7. Troubleshoot

    If you’re still encountering issues, try stopping the radius service and starting it in debug mode:

    sudo systemctl stop freeradius

    sudo freeradius -X

    It is worth noting that any changes to the users file will require a restart of the service to take affect.

    8. Enable FreeRADIUS to Start on Boot (Optional)

    If you haven’t already done so, enable FreeRADIUS to start on boot:

    sudo systemctl enable freeradius

  • Copying files via SCP from Cisco IOS device to a Windows client

    Follow the below process to copy files from a Cisco IOS device (server) to a Windows PC (client) using Secure Copy Protocol (SCP).

    SCP is based on the RCP protocol but uses SSH to encrypt the file transfer between source and destination. Like SSH, SCP listens on TCP port 22.

    Method

    1. Ensure SSH is working on the router/switch.
    2. Enabled SCP server – “ip scp server enable”.
    3. Ensure Putty is installed on your Windows device.
    4. Open CMD and run the following:

    pscp.exe -v -scp -2 username@172.31.255.10:/flash:example.txt .\

    scp-copy-01

    You will be prompted to enter your login password.

    Once authenticated, the file should copy to CMD’s working directory.

    scp-copy-02
  • Configuring SNMPv3

    This uses V3 with AUTHPRIV.

    ! Create ACL to restrict inbound SNMP requests to a host IP of 10.50.50.1

    ip access-list standard SECURE_SNMP

    permit host 10.50.50.1

    ! Create SNMP Group

    snmp-server group GROUP-NMS01 v3 priv

    ! Create SNMP User and apply ACL

    snmp-server user USER-NMS01 GROUP-NMS01 v3 auth md5 AUTHPASS1 priv aes 128 PRIVPASS1 access SECURE_SNMP

    ! Create SNMP host and associate user

    snmp-server host 10.50.50.1 traps version 3 priv USER-NMS01

    Here’s how it marries up:

    As of 2020, AES 128 encryption is as high as PRTG can go.