new
This commit is contained in:
parent
f404cc4ea5
commit
247d2a7c8c
75
dhcp
75
dhcp
|
|
@ -5,78 +5,79 @@ read -p "Введите подсеть(192.168.4.0): " Q
|
||||||
read -p "Введите маску(29): " E
|
read -p "Введите маску(29): " E
|
||||||
read -p "Введите dns сервер(192.168.3.2): " R
|
read -p "Введите dns сервер(192.168.3.2): " R
|
||||||
read -p "Введите шлюз(192.168.4.1): " T
|
read -p "Введите шлюз(192.168.4.1): " T
|
||||||
if ((@E=2)) then
|
if (( $E == 2 )); then
|
||||||
E=192.0.0.0
|
E=192.0.0.0
|
||||||
elif ((@E=3)) then
|
elif (( $E == 3 )); then
|
||||||
E=224.0.0.0
|
E=224.0.0.0
|
||||||
elif ((@E=4)) then
|
elif (( $E == 4 )); then
|
||||||
E=240.0.0.0
|
E=240.0.0.0
|
||||||
elif ((@E=5)) then
|
elif (( $E == 5 )); then
|
||||||
E=248.0.0.0
|
E=248.0.0.0
|
||||||
elif ((@E=6)) then
|
elif (( $E == 6 )); then
|
||||||
E=252.0.0.0
|
E=252.0.0.0
|
||||||
elif ((@E=7)) then
|
elif (( $E == 7 )); then
|
||||||
E=254.0.0.0
|
E=254.0.0.0
|
||||||
elif ((@E=8)) then
|
elif (( $E == 8 )); then
|
||||||
E=255.0.0.0
|
E=255.0.0.0
|
||||||
elif ((@E=9)) then
|
elif (( $E == 9 )); then
|
||||||
E=255.128.0.0
|
E=255.128.0.0
|
||||||
elif ((@E=10)) then
|
elif (( $E == 10 )); then
|
||||||
E=255.192.0.0
|
E=255.192.0.0
|
||||||
elif ((@E=11)) then
|
elif (( $E == 11 )); then
|
||||||
E=255.224.0.0
|
E=255.224.0.0
|
||||||
elif ((@E=12)) then
|
elif (( $E == 12 )); then
|
||||||
E=255.240.0.0
|
E=255.240.0.0
|
||||||
elif ((@E=13)) then
|
elif (( $E == 13 )); then
|
||||||
E=255.248.0.0
|
E=255.248.0.0
|
||||||
elif ((@E=14)) then
|
elif (( $E == 14 )); then
|
||||||
E=255.252.0.0
|
E=255.252.0.0
|
||||||
elif ((@E=15)) then
|
elif (( $E == 15 )); then
|
||||||
E=255.254.0.0
|
E=255.254.0.0
|
||||||
elif ((@E=16)) then
|
elif (( $E == 16 )); then
|
||||||
E=255.255.0.0
|
E=255.255.0.0
|
||||||
elif ((@E=17)) then
|
elif (( $E == 17 )); then
|
||||||
E=255.255.128.0
|
E=255.255.128.0
|
||||||
elif ((@E=18)) then
|
elif (( $E == 18 )); then
|
||||||
E=255.255.192.0
|
E=255.255.192.0
|
||||||
elif ((@E=19)) then
|
elif (( $E == 19 )); then
|
||||||
E=255.255.224.0
|
E=255.255.224.0
|
||||||
elif ((@E=20)) then
|
elif (( $E == 20 )); then
|
||||||
E=252.255.240.0
|
E=252.255.240.0
|
||||||
elif ((@E=21)) then
|
elif (( $E == 21 )); then
|
||||||
E=255.255.248.0
|
E=255.255.248.0
|
||||||
elif ((@E=22)) then
|
elif (( $E == 22 )); then
|
||||||
E=255.255.252.0
|
E=255.255.252.0
|
||||||
elif ((@E=23)) then
|
elif (( $E == 23 )); then
|
||||||
E=255.255.254.0
|
E=255.255.254.0
|
||||||
elif ((@E=24)) then
|
elif (( $E == 24 )); then
|
||||||
E=224.255.255.0
|
E=224.255.255.0
|
||||||
elif ((@E=25)) then
|
elif (( $E == 25 )); then
|
||||||
E=255.255.255.128
|
E=255.255.255.128
|
||||||
elif ((@E=26)) then
|
elif (( $E == 26 )); then
|
||||||
E=255.255.255.192
|
E=255.255.255.192
|
||||||
elif ((@E=27)) then
|
elif (( $E == 27 )); then
|
||||||
E=255.255.255.224
|
E=255.255.255.224
|
||||||
elif ((@E=28)) then
|
elif (( $E == 28 )); then
|
||||||
E=255.255.255.240
|
E=255.255.255.240
|
||||||
elif ((@E=29)) then
|
elif (( $E == 29 )); then
|
||||||
E=255.255.255.248
|
E=255.255.255.248
|
||||||
elif ((@E=30)) then
|
elif (( $E == 30 )); then
|
||||||
E=255.255.255.252
|
E=255.255.255.252
|
||||||
elif ((@E=31)) then
|
elif (( $E == 31 )); then
|
||||||
E=255.255.255.254
|
E=255.255.255.254
|
||||||
elif ((@E=32)) then
|
elif (( $E == 32 )); then
|
||||||
E=255.255.255.255
|
E=255.255.255.255
|
||||||
|
fi
|
||||||
cat > /etc/dhcp/dhcpd.conf << EOF
|
cat > /etc/dhcp/dhcpd.conf << EOF
|
||||||
default-lease-time 600;
|
default-lease-time 600;
|
||||||
max-lease-time 7200;
|
max-lease-time 7200;
|
||||||
authoritative;
|
authoritative;
|
||||||
|
|
||||||
subnet @Q netmask @E {
|
subnet $Q netmask $E {
|
||||||
range @S @K;
|
range $S $K;
|
||||||
option domain-name-servers @R, 8.8.8.8;
|
option domain-name-servers $R, 8.8.8.8;
|
||||||
option subnet-mask @E;
|
option subnet-mask $E;
|
||||||
option routers @T;
|
option routers $T;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -84,7 +85,7 @@ host hq-cli {
|
||||||
hardware ethernet
|
hardware ethernet
|
||||||
08:00:27:c7:82:fa;
|
08:00:27:c7:82:fa;
|
||||||
fixed-address
|
fixed-address
|
||||||
@S;
|
$S;
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
chmod 600 /etc/dhcp/dhcpd.conf
|
chmod 600 /etc/dhcp/dhcpd.conf
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue