edoput / netjsonconfig

Network configuration management library based on NetJSON DeviceConfiguration
http://netjsonconfig.openwisp.org/
Other
1 stars 0 forks source link

route section #10

Open edoput opened 7 years ago

edoput commented 7 years ago

Available keys

route.1.devname
route.1.gateway
route.1.ip
route.1.netmask
route.1.status
route.status

As a static route in netjson has only destination and next I'm a little confused about what is what?

edoput commented 7 years ago

after talking with @gabri94 I got all the information that I needed

// route object
{
    "destination": "192.168.1.0/24",
    "next": "192.168.1.1"
}

produces

# this could be the interface that has the ip
route.1.devname=
route.1.gateway=192.168.1.1
route.1.ip=192.168.1.0
route.1.netmask=255.255.255.0
route.1.status=enabled
route.status=enabled
edoput commented 7 years ago

The only important part to remember is that the management interface produces a route like this.

Edit: It's not the management interface but the interface with a gateway defined

{
    "interfaces": [
        {
            "name": "ifname",
            ...,
            "addresses": [
                {
                    "address": "192.168.1.20",
                    "family": "ipv4",
                    "gateway": "192.168.1.1",
                    "management": true,
                    "proto": "static"
                }
           ]
       }
    ]
}

produces

route.1.devname=ifname
route.1.gateway=192.168.1.1
route.1.ip=192.168.1.0
route.1.netmask=255.255.255.0
route.1.status=enabled
route.status=enabled