feat: add network API and netplan configuration models with example usage
All checks were successful
Build and Deploy MITM Webserver / build (push) Successful in 8s
All checks were successful
Build and Deploy MITM Webserver / build (push) Successful in 8s
This commit is contained in:
@@ -34,3 +34,28 @@ class NetworkConfig(BaseModel):
|
||||
renderer: Optional[str] = "networkd"
|
||||
ethernets: Dict[str, EthernetConfig] = Field(default_factory=dict)
|
||||
bridges: Dict[str, BridgeConfig] = Field(default_factory=dict)
|
||||
|
||||
|
||||
'''Example usage:
|
||||
{
|
||||
"version": 2,
|
||||
"renderer": "networkd",
|
||||
"ethernets": {
|
||||
"eth0": {
|
||||
"dhcp4": false,
|
||||
"addresses": ["192.168.10.20/24"],
|
||||
"gateway4": "192.168.10.1",
|
||||
"nameservers": {
|
||||
"addresses": ["1.1.1.1", "8.8.8.8"]
|
||||
}
|
||||
},
|
||||
"eth1": {},
|
||||
"eth2": {}
|
||||
},
|
||||
"bridges": {
|
||||
"br0": {
|
||||
"interfaces": ["eth1", "eth2"],
|
||||
"dhcp4": true
|
||||
}
|
||||
}
|
||||
}'''
|
||||
|
||||
Reference in New Issue
Block a user