mirror of
https://github.com/Ysurac/openmptcprouter-vps-admin.git
synced 2025-03-09 15:40:05 +00:00
Revert to fe80 for 6in4
This commit is contained in:
parent
238dd4262f
commit
5efabfa981
1 changed files with 6 additions and 6 deletions
12
omr-admin.py
12
omr-admin.py
|
@ -891,8 +891,8 @@ async def config(current_user: User = Depends(get_current_user)):
|
||||||
if 'ULA=' in line:
|
if 'ULA=' in line:
|
||||||
ula = line.replace(line[:4], '').rstrip()
|
ula = line.replace(line[:4], '').rstrip()
|
||||||
else:
|
else:
|
||||||
locaip6 = 'fd80::a00:1'
|
locaip6 = 'fe80::a00:1'
|
||||||
remoteip6 = 'fd80::a00:2'
|
remoteip6 = 'fe80::a00:2'
|
||||||
|
|
||||||
vpn = 'glorytun_tcp'
|
vpn = 'glorytun_tcp'
|
||||||
if 'vpn' in omr_config_data['users'][0][current_user.username]:
|
if 'vpn' in omr_config_data['users'][0][current_user.username]:
|
||||||
|
@ -1427,11 +1427,11 @@ def vpnips(*, vpnconfig: VPNips, current_user: User = Depends(get_current_user))
|
||||||
if localip6:
|
if localip6:
|
||||||
n.write('LOCALIP6=' + localip6 + "\n")
|
n.write('LOCALIP6=' + localip6 + "\n")
|
||||||
else:
|
else:
|
||||||
n.write('LOCALIP6=fd80::a0' + hex(userid)[2:] + ':1/126' + "\n")
|
n.write('LOCALIP6=fe80::a0' + hex(userid)[2:] + ':1/126' + "\n")
|
||||||
if remoteip6:
|
if remoteip6:
|
||||||
n.write('REMOTEIP6=' + remoteip6 + "\n")
|
n.write('REMOTEIP6=' + remoteip6 + "\n")
|
||||||
else:
|
else:
|
||||||
n.write('REMOTEIP6=fd80::a0' + hex(userid)[2:] + ':2/126' + "\n")
|
n.write('REMOTEIP6=fe80::a0' + hex(userid)[2:] + ':2/126' + "\n")
|
||||||
if ula:
|
if ula:
|
||||||
n.write('ULA=' + ula + "\n")
|
n.write('ULA=' + ula + "\n")
|
||||||
final_md5 = hashlib.md5(file_as_bytes(open('/etc/openmptcprouter-vps-admin/omr-6in4/user' + str(userid), 'rb'))).hexdigest()
|
final_md5 = hashlib.md5(file_as_bytes(open('/etc/openmptcprouter-vps-admin/omr-6in4/user' + str(userid), 'rb'))).hexdigest()
|
||||||
|
@ -1463,9 +1463,9 @@ def vpnips(*, vpnconfig: VPNips, current_user: User = Depends(get_current_user))
|
||||||
if not ('OMR_ADDR_USER' + str(userid) +'=' in line and not userid == 0) and not ('OMR_ADDR=' in line and userid == 0):
|
if not ('OMR_ADDR_USER' + str(userid) +'=' in line and not userid == 0) and not ('OMR_ADDR=' in line and userid == 0):
|
||||||
n.write(line)
|
n.write(line)
|
||||||
if not userid == 0:
|
if not userid == 0:
|
||||||
n.write('OMR_ADDR_USER' + str(userid) + '=fd80::a0' + hex(userid)[2:] + ':2/126' + '\n')
|
n.write('OMR_ADDR_USER' + str(userid) + '=fe80::a0' + hex(userid)[2:] + ':2/126' + '\n')
|
||||||
elif userid == 0:
|
elif userid == 0:
|
||||||
n.write('OMR_ADDR=fd80::a0' + hex(userid)[2:] + ':2/126' + '\n')
|
n.write('OMR_ADDR=fe80::a0' + hex(userid)[2:] + ':2/126' + '\n')
|
||||||
|
|
||||||
os.close(fd)
|
os.close(fd)
|
||||||
move(tmpfile, '/etc/shorewall6/params.vpn')
|
move(tmpfile, '/etc/shorewall6/params.vpn')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue