|
Revision 103, 0.8 KB
(checked in by root, 6 years ago)
|
|
A better DMZ configuration, part 1.
|
-
Property svn:executable set to
*
|
| Line | |
|---|
| 1 | #!/bin/sh |
|---|
| 2 | |
|---|
| 3 | # $Id:$ |
|---|
| 4 | |
|---|
| 5 | . /etc/config |
|---|
| 6 | . /etc/dmz.info |
|---|
| 7 | |
|---|
| 8 | DHCPDDOMAIN=`for DOMAINS in $(grep search /etc/resolv.conf | sed 's/^search//'); do echo $DOMAINS; break; done` |
|---|
| 9 | |
|---|
| 10 | cat >> /etc/dmz-udhcpd.conf <<EOF |
|---|
| 11 | interface $DMZ_DEVICE |
|---|
| 12 | start $DMZ_DHCP_RANGE_START |
|---|
| 13 | end $DMZ_DHCP_RANGE_END |
|---|
| 14 | # max_leases 103 |
|---|
| 15 | lease_file /var/state/dmz-udhcpd.leases |
|---|
| 16 | pidfile /var/run/dmz-udhcpd.pid |
|---|
| 17 | option dns $DMZ_IP |
|---|
| 18 | option subnet $DMZ_NETMASK |
|---|
| 19 | option broadcast $DMZ_BROADCAST |
|---|
| 20 | option router $DMZ_IP |
|---|
| 21 | option domain $DHCPDDOMAIN |
|---|
| 22 | option lease 864000 |
|---|
| 23 | $OPS |
|---|
| 24 | EOF |
|---|
| 25 | |
|---|
| 26 | # Adding the /etc/ethers file: |
|---|
| 27 | # I'll use the same file for both. shouldn't matter. |
|---|
| 28 | sed -e '/^#/d;/^$/d;s/^/static_lease /' /etc/ethers >> /etc/dmz-udhcpd.conf |
|---|