1
0
Fork 0

Use configs for iface

master
Alex Kotov 3 years ago
parent 67b698f982
commit 1fc2bbe8dc
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
  1. 5
      config_client.json
  2. 5
      config_server.json
  3. 8
      main.py

@ -3,5 +3,8 @@
"address": "127.0.0.1",
"port": 12345,
"iface_name": "tun0",
"iface_mtu": 1500
"iface_mtu": 1500,
"iface_addr": "10.0.0.1",
"iface_dstaddr": "10.0.0.2",
"iface_netmask": "255.255.255.0"
}

@ -3,5 +3,8 @@
"address": "0.0.0.0",
"port": 12345,
"iface_name": "tun1",
"iface_mtu": 1500
"iface_mtu": 1500,
"iface_addr": "10.0.0.2",
"iface_dstaddr": "10.0.0.1",
"iface_netmask": "255.255.255.0"
}

@ -35,10 +35,10 @@ def main():
print(tun_iface.name)
tun_iface.addr = '10.0.0.1'
tun_iface.dstaddr = '10.0.0.2'
tun_iface.netmask = '255.255.255.0'
tun_iface.mtu = 1500
tun_iface.addr = config['iface_addr']
tun_iface.dstaddr = config['iface_dstaddr']
tun_iface.netmask = config['iface_netmask']
tun_iface.mtu = config['iface_mtu']
tun_iface.up()