diff --git a/configs/debian/bookworm_server.json b/configs/debian/bookworm_server.json index 91c8e8e..c1d25ef 100644 --- a/configs/debian/bookworm_server.json +++ b/configs/debian/bookworm_server.json @@ -6,7 +6,7 @@ "repositories": [], "replace_repositories": "False", "keyrings": [], - "packages": "nginx grub-pc linux-image-amd64 docker.io make curl openssl nano", + "packages": "nginx grub-pc linux-image-amd64 docker.io make curl openssl nano isc-dhcp-server", "create_ca": "True", "preinstall_scripts": [ "configs/scripts/ca.sh" diff --git a/configs/scripts/server.sh b/configs/scripts/server.sh index 65dd83f..51ee988 100755 --- a/configs/scripts/server.sh +++ b/configs/scripts/server.sh @@ -21,3 +21,11 @@ while true; do break fi done + +ip addr flush dev eth0 +ip addr add 192.168.1.1/24 dev eth0 + +echo -e "\nauto eth0\niface eth0 inet static\n address 192.168.1.1\n netmask 255.255.255.0\n gateway 192.168.1.1" | tee -a /etc/network/interfaces + +cp dhcpd.conf /etc/dhcp/dhcpd.conf +sed -i 's/^INTERFACES=.*/INTERFACES="eth0"/' /etc/default/isc-dhcp-server diff --git a/configs/ubuntu/noble_server.json b/configs/ubuntu/noble_server.json index 7970840..0cc935e 100644 --- a/configs/ubuntu/noble_server.json +++ b/configs/ubuntu/noble_server.json @@ -6,7 +6,7 @@ "repositories": [], "replace_repositories": "False", "keyrings": [], - "packages": "nginx grub-pc linux-image-generic docker.io make curl openssl nano", + "packages": "nginx grub-pc linux-image-generic docker.io make curl openssl nano isc-dhcp-server", "create_ca": "True", "preinstall_scripts": [ "configs/scripts/ca.sh" @@ -17,6 +17,7 @@ ], "package_manager": "apt", "extra_files": [ + "resources/dhcpd.conf", "downloads/deployment.tar.gz" ] } \ No newline at end of file diff --git a/resources/dhcpd.conf b/resources/dhcpd.conf new file mode 100644 index 0000000..c97fb01 --- /dev/null +++ b/resources/dhcpd.conf @@ -0,0 +1,7 @@ +subnet 192.168.1.0 netmask 255.255.255.0 { + range 192.168.1.10 192.168.1.100; + option routers 192.168.1.1; + option subnet-mask 255.255.255.0; + option domain-name-servers 192.168.1.1; + option domain-name "interstellarnet.com"; +} \ No newline at end of file