Re: [RFC] [nmstate] Linux routing in nmstate



Based on feedbacks, this is V2 scheme for review:

```
    {
        "routes": {
            "ipv4": [       # Sorted with 'table-id' then 'destination'
                {
                    "status": "up",
                        # up or absent(to be removed)
                        # If not defined, use 'up'
                    "table-name": "main",
                        # Empty if no name attached,
                    "table-id": 254,
                        # If not defined, use 'main' route table id
                    "protocol": "dhcp",     # "static" or "dhcp"
                        # If not defined, use 'static'
                    "metric": 100,
                        # If not defined, let NetworkManager to decided.
                    "destination": "0.0.0.0/0",
                        # Mandatory
                    "next-hop-iface": "eth0",
                        # Mandatory
                    "next-hop-address": "192.0.2.1"
                        # ^ Empty on point-to-point link
                },
            ],
            "ipv6": [    # Sorted with 'table-id' then 'destination'
                {
                    "status": "up",
                    "table-name": "main",
                    "table-id": 254,
                    "protocol": "router-advertisement",
                    # ^ "static" or "router-advertisement"
                    "metric": 100,
                    "destination": "::/0",
                    "next-hop-iface": "eth0",
                    "next-hop-address": "fe80::1"
                },
            ],
        }
    }
```

Changes since V1:

 * Top tree is 'routes', and subtree is 'ipv4' and 'ipv6'.
   Even the IPv4 and IPv6 route entry are mostly identical, but we need
   schema to differentiate the 'destination' address type in a simple
   way.

 * Add 'status: absent' to simplify the route deletion.

 * Add comments to show the default value if not defined.

Thank you very much!
Best regards.

-- 
Gris Ge

Attachment: signature.asc
Description: PGP signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]