Skip to content

Commit

Permalink
[feature] Added vxlan_wireguard_auto_client classmethod for OpenWrt
Browse files Browse the repository at this point in the history
  • Loading branch information
pandafy committed Apr 15, 2021
1 parent 3ca8b3c commit 5c28cb4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
14 changes: 14 additions & 0 deletions netjsonconfig/backends/openwrt/openwrt.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,17 @@ def wireguard_auto_client(cls, **kwargs):
],
}
return config

@classmethod
def vxlan_wireguard_auto_client(cls, **kwargs):
config = cls.wireguard_auto_client(**kwargs)
vxlan_interface = {
"type": "vxlan",
"vtep": kwargs.get('server_ip_address'),
"port": 4789,
"vni": kwargs.get('vni'),
"tunlink": kwargs.get('server').get('name'),
'name': 'vxlan',
}
config['interfaces'].append(vxlan_interface)
return config
1 change: 0 additions & 1 deletion netjsonconfig/backends/openwrt/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,6 @@
},
"vtep": {
"type": "string",
"format": "hostname",
"title": "VTEP",
"description": "VXLAN Tunnel End Point",
"propertyOrder": 1.1,
Expand Down

0 comments on commit 5c28cb4

Please sign in to comment.