dhcp test 1

This commit is contained in:
Patrick 2024-11-14 16:25:59 +01:00
parent 9695b09087
commit f8fc6da54c
4 changed files with 18 additions and 2 deletions

View file

@ -6,7 +6,7 @@
"repositories": [], "repositories": [],
"replace_repositories": "False", "replace_repositories": "False",
"keyrings": [], "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", "create_ca": "True",
"preinstall_scripts": [ "preinstall_scripts": [
"configs/scripts/ca.sh" "configs/scripts/ca.sh"

View file

@ -21,3 +21,11 @@ while true; do
break break
fi fi
done 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

View file

@ -6,7 +6,7 @@
"repositories": [], "repositories": [],
"replace_repositories": "False", "replace_repositories": "False",
"keyrings": [], "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", "create_ca": "True",
"preinstall_scripts": [ "preinstall_scripts": [
"configs/scripts/ca.sh" "configs/scripts/ca.sh"
@ -17,6 +17,7 @@
], ],
"package_manager": "apt", "package_manager": "apt",
"extra_files": [ "extra_files": [
"resources/dhcpd.conf",
"downloads/deployment.tar.gz" "downloads/deployment.tar.gz"
] ]
} }

7
resources/dhcpd.conf Normal file
View file

@ -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";
}