Autoconfigure IOx App Network Settings

This simple tool gets your IOx app networking configuration automatically on your IOS XE device. You don't need to configure anything in the CLI!

  1. Enable NETCONF via webUI on the device (Administration > Management > HTTP/HTTPS/Netconf)
  2. Deploy your IOx application via webUI
  3. Put all information in data.json
  4. Run main.py script
  5. Done! - Activate your app

Standalone executables for Windows & macOS are in the making!

Getting Started

  1. Clone the repository or download main.py and data.json

  2. Install the required python libraries (depending on your python version):

pip install -r requirements.txt
pip3 install -r requirements.txt
  1. Run the script. The instructions on how to edit the data.json is given in the CLI:
python main.py
python3 main.py

Prerequisites

  • Python installed
  • IOS XE 17.1.x
  • Enabled NETCONF on the device:
    • via CLI: device(config)#netconf-yang
    • via GUI: Administration > Management > HTTP/HTTPS/Netconf

Supported & Tested Hardware

  • IR1101 with IOS XE 17.1.x

Versioning

1.0 - Inital release. Configure network settings via NETCONF.

Authors

  • Florian Pachinger - Initial work - flopach

License

This project is licensed under the Apache License 2.0 - see the LICENSE.md file for details

Further Links

Use Case

As a developer, you usually don't know how to configure IOS network settings. And that's okay! Especially, when you want to deploy your IOx application on your Cisco network device you need some CLI commands in order to access your container.

The good news is that this script takes care exactly of that: Via a simple JSON file you insert your desired configuration and these settings will simply be applied on the device via NETCONF. And you can enable NETCONF via the WebUI.

For example, in order to access the IOx file hosting application this IOS configuration would need to be applied:

interface VirtualPortGroup0 ip address 192.168.1.1 255.255.255.0 ip nat inside ip virtual-reassemblyinterface Vlan1 ip address 10.0.0.2 255.255.255.0 ip nat outside ip virtual-reassemblyip nat inside source static tcp 192.168.1.2 445 interface Vlan1 445ip nat inside source static tcp 192.168.1.2 5000 interface Vlan1 5000ip nat inside source static udp 192.168.1.2 136 interface Vlan1 136app-hosting appid filehosting app-vnic gateway0 virtualportgroup 0 guest-interface 0  guest-ipaddress 192.168.1.2 netmask 255.255.255.0 app-default-gateway 192.168.1.1 guest-interface 0

With the script, you just insert your data into the JSON file, run the script and you are good to go:

    "IOX": {        "appid": "filehosting",        "ip-iox-app": "192.168.1.2",        "ip-virtualportgroup0": "192.168.1.1",        "subnetmask": "255.255.255.0",        "port-mapping": ["tcp:445:445","tcp:5000:5000","udp:136:136"]    },    "OUTSIDE-INTERFACE": {        "vlan-id": 1,        "ip-address": "172.19.89.14",        "subnetmask": "255.255.255.0"    }

Right now, only the IR1101 is supported, however, more devices will be added in the future!

Demo

View code on GitHub
  • Owner

  • Contributors

    +1Github contributor
  • Categories

  • Products

    IOS XEIOx
  • Programming Languages

    Python
  • License

    Apache License 2.0

Code Exchange Community

Get help, share code, and collaborate with other developers in the Code Exchange community.View Community
Disclaimer:
Cisco provides Code Exchange for convenience and informational purposes only, with no support of any kind. This page contains information and links from third-party websites that are governed by their own separate terms. Reference to a project or contributor on this page does not imply any affiliation with or endorsement by Cisco.