|
|
@ -8,13 +8,14 @@ from . import base |
|
|
def get_onu_template(vlan_id: int, mac_addr: str): |
|
|
def get_onu_template(vlan_id: int, mac_addr: str): |
|
|
template = ( |
|
|
template = ( |
|
|
'switchport mode hybrid vport 1', |
|
|
'switchport mode hybrid vport 1', |
|
|
'switchport vlan %d tag vport 1' % vlan_id, |
|
|
|
|
|
|
|
|
'service-port 1 vport 1 user-vlan 100 vlan %d' % vlan_id, |
|
|
'port-location format flexible-syntax vport 1', |
|
|
'port-location format flexible-syntax vport 1', |
|
|
'port-location sub-option remote-id enable vport 1', |
|
|
'port-location sub-option remote-id enable vport 1', |
|
|
'port-location sub-option remote-id name %s vport 1' % mac_addr, |
|
|
'port-location sub-option remote-id name %s vport 1' % mac_addr, |
|
|
'dhcp-option82 enable vport 1', |
|
|
'dhcp-option82 enable vport 1', |
|
|
'dhcp-option82 trust true replace vport 1', |
|
|
'dhcp-option82 trust true replace vport 1', |
|
|
'ip dhcp snooping enable vport 1' |
|
|
|
|
|
|
|
|
'ip dhcp snooping enable vport 1', |
|
|
|
|
|
'ip-service ip-source-guard enable sport 1' |
|
|
) |
|
|
) |
|
|
return template |
|
|
return template |
|
|
|
|
|
|
|
|
|