From a83ecd5956f5cb08bac7455d2136866ef4f0d9c3 Mon Sep 17 00:00:00 2001 From: marc <> Date: Tue, 8 Sep 1998 20:26:42 +0000 Subject: [PATCH] dhcp client stuff. "Angelos D. Keromytis" --- src/etc/Makefile | 4 ++-- src/etc/dhclient.conf | 17 +++++++++++++++++ src/etc/netstart | 15 ++++++++++----- src/etc/rc.conf | 3 ++- 4 files changed, 31 insertions(+), 8 deletions(-) create mode 100644 src/etc/dhclient.conf diff --git a/src/etc/Makefile b/src/etc/Makefile index de3ad1b7..e5957d12 100644 --- a/src/etc/Makefile +++ b/src/etc/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.89 1998/08/20 03:21:45 form Exp $ +# $OpenBSD: Makefile,v 1.90 1998/09/08 20:26:40 marc Exp $ TZDIR= /usr/share/zoneinfo LOCALTIME= US/Pacific @@ -19,7 +19,7 @@ BIN1= aliases bootptab changelist ccd.conf csh.cshrc csh.login csh.logout \ myname ipnat.rules netstart networks newsyslog.conf passwd.conf \ phones printcap protocols rbootd.conf rc rc.conf rc.local \ rc.securelevel remote rpc security services shells syslog.conf weekly \ - etc.${MACHINE}/disktab + etc.${MACHINE}/disktab dhclient.conf # -rw-rw-r-- BIN2= motd diff --git a/src/etc/dhclient.conf b/src/etc/dhclient.conf new file mode 100644 index 00000000..bab65904 --- /dev/null +++ b/src/etc/dhclient.conf @@ -0,0 +1,17 @@ +# $OpenBSD: dhclient.conf,v 1.1 1998/09/08 20:26:41 marc Exp $ +# +# DHCP Client Configuration +# +# See dhclient.conf(5) for possible contents of this file. +# When empty default values are used: +# +# Example: +# +# send dhcp-lease-time 3600; +# send host-name "myhost"; +# supersede host-name "myhost"; +# supersede domain-name "my.domain"; +# request subnet-mask, broadcast-address, time-offset, routers, +# domain-name, domain-name-servers, host-name, lpr-servers, ntp-servers; +# require subnet-mask, domain-name-servers, routers; +# media "link0 link1", "link0 link1", "link0 link1", "-link0 link1"; diff --git a/src/etc/netstart b/src/etc/netstart index c8aa280d..9e32f7dc 100644 --- a/src/etc/netstart +++ b/src/etc/netstart @@ -1,6 +1,6 @@ #!/bin/sh - # -# $OpenBSD: netstart,v 1.40 1998/08/24 09:32:50 downsj Exp $ +# $OpenBSD: netstart,v 1.41 1998/09/08 20:26:41 marc Exp $ # /etc/myname contains my symbolic name # @@ -38,6 +38,10 @@ ifconfig lo0 inet localhost route -n add -host $hostname localhost route -n add -net 127 127.0.0.1 -reject +if [ "X${dhcp_client}" != X"NO" ]; then +# Do DHCP discovery + dhclient ${dhcp_client} +else # configure all of the non-loopback interfaces which we know about. # do this by reading /etc/hostname.* files, where * is the name # of a given interface. @@ -61,7 +65,7 @@ route -n add -net 127 127.0.0.1 -reject # the only required contents of the file are the addr_family field # and the hostname. -( + ( tmp="$IFS" IFS="$IFS." set -- `echo /etc/hostname*` @@ -91,16 +95,17 @@ route -n add -net 127 127.0.0.1 -reject ) < /etc/hostname.$1 shift done -) + ) # /etc/mygate, if it exists, contains the name of my gateway host # that name must be in /etc/hosts. -if [ -f /etc/mygate ]; then + if [ -f /etc/mygate ]; then route -n add -host default `cat /etc/mygate` # default multicast route for hosts with a gateway route -n add -net 224.0.0.0 -interface default -else + else # default multicast route route -n add -net 224.0.0.0 -interface $hostname + fi fi diff --git a/src/etc/rc.conf b/src/etc/rc.conf index 9c8be2ad..eec60edc 100644 --- a/src/etc/rc.conf +++ b/src/etc/rc.conf @@ -1,6 +1,6 @@ #!/bin/sh - # -# $OpenBSD: rc.conf,v 1.27 1998/08/25 18:19:41 marc Exp $ +# $OpenBSD: rc.conf,v 1.28 1998/09/08 20:26:42 marc Exp $ # set these to "NO" to turn them off. otherwise, they're used as flags routed_flags=NO # for 'normal' use: routed_flags="-q" @@ -17,6 +17,7 @@ mopd_flags=NO # for 'normal' use: mopd_flags="-a" httpd_flags=NO # for 'normal' use: httpd_flags="" apmd_flags=NO # for 'normal' use: apmd_flags="" dhcpd_flags=NO # for 'normal' use: dhcpd_flags="-q" +dhcp_client=NO # for 'normal' use: dhcp_client="" # On some architectures, you must also disable console getty in /etc/ttys xdm_flags=NO # for 'normal' use: xdm_flags=""