Reorganising settings file
This commit is contained in:
parent
a4a046f786
commit
e8e49589ec
@ -301,10 +301,10 @@ class Packet():
|
|||||||
class DHCPServer(object):
|
class DHCPServer(object):
|
||||||
def __init__(self, SETTINGS_FILE):
|
def __init__(self, SETTINGS_FILE):
|
||||||
self.SETTINGS = yaml.load(open(SETTINGS_FILE), Loader=yaml.SafeLoader)
|
self.SETTINGS = yaml.load(open(SETTINGS_FILE), Loader=yaml.SafeLoader)
|
||||||
self.DHCP_SERVER_IP = self.SETTINGS.get('DHCP_SERVER_IP')
|
self.DHCP_SERVER_IP = self.SETTINGS['DHCP']['SERVER_IP']
|
||||||
self.DHCP_SERVER_PORT = self.SETTINGS.get('DHCP_SERVER_PORT')
|
self.DHCP_SERVER_PORT = self.SETTINGS['DHCP']['SERVER_PORT']
|
||||||
self.TFTP_SERVER_IP = self.SETTINGS.get('TFTP_SERVER_IP')
|
self.MAX_BYTES = self.SETTINGS['DHCP']['MAX_BYTES']
|
||||||
self.MAX_BYTES = self.SETTINGS.get('MAX_BYTES')
|
self.TFTP_SERVER_IP = self.SETTINGS['TFTP']['SERVER_IP']
|
||||||
|
|
||||||
|
|
||||||
def create_socket(self):
|
def create_socket(self):
|
||||||
|
@ -1,4 +0,0 @@
|
|||||||
DHCP_SERVER_IP: 192.168.1.7
|
|
||||||
DHCP_SERVER_PORT: 67
|
|
||||||
TFTP_SERVER_IP: 192.168.1.7
|
|
||||||
MAX_BYTES: 1024
|
|
3
midas
3
midas
@ -11,7 +11,7 @@ if __name__ == '__main__':
|
|||||||
topology.build()
|
topology.build()
|
||||||
provisioning = Provisioning()
|
provisioning = Provisioning()
|
||||||
provisioning.render(topology)
|
provisioning.render(topology)
|
||||||
dhcp_server = DHCPServer(SETTINGS_FILE='dhcp/settings.yaml')
|
dhcp_server = DHCPServer(SETTINGS_FILE='settings.yaml')
|
||||||
dhcp_server.run(topology)
|
dhcp_server.run(topology)
|
||||||
|
|
||||||
# Todo
|
# Todo
|
||||||
@ -22,4 +22,3 @@ if __name__ == '__main__':
|
|||||||
# 4. Make IP allocation & config var (YAML) generation automatic
|
# 4. Make IP allocation & config var (YAML) generation automatic
|
||||||
# 5. Implement socket.inet_aton() function
|
# 5. Implement socket.inet_aton() function
|
||||||
# 6. PCAP from PC to capture DHCP option values that are not yet printed in a human readable format
|
# 6. PCAP from PC to capture DHCP option values that are not yet printed in a human readable format
|
||||||
# 7. Mount lab Pi as NFS share on valykrie Pi to create automatic backups with duplicati
|
|
||||||
|
9
settings.yaml
Normal file
9
settings.yaml
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
DHCP:
|
||||||
|
SERVER_IP: 192.168.1.7
|
||||||
|
SERVER_PORT: 67
|
||||||
|
MAX_BYTES: 1024
|
||||||
|
TFTP:
|
||||||
|
SERVER_IP: 192.168.1.7
|
||||||
|
IP_Addressing:
|
||||||
|
MANAGEMENT_RANGE: 192.168.1.0/24
|
||||||
|
P2P_RANGE: 10.0.0.0/24
|
Loading…
x
Reference in New Issue
Block a user