Bluehost.com Web Hosting $6.95

DHCP server and client on same mashine

This is a discussion on DHCP server and client on same mashine within the Linux General forums, part of the Linux Forums category; is it possible to run both clien and server on same mashine, so that linux would serve as kind of ...


Go Back   Usenet Forums > Linux Forums > Linux General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2005
Carramba
 
Posts: n/a
Default DHCP server and client on same mashine


is it possible to run both clien and server on same mashine, so that linux
would serve as kind of gateway ?

thanx in advance
Reply With Quote
  #2 (permalink)  
Old 02-27-2005
John Hasler
 
Posts: n/a
Default Re: DHCP server and client on same mashine

Carramba writes:
> is it possible to run both clien and server on same mashine, so that
> linux would serve as kind of gateway ?


Guessing at what problem you are trying to solve:

Package: dhcp3-relay
Priority: optional
Section: net
Installed-Size: 548
Maintainer: Eloy A. Paris <peloy@debian.org>
Architecture: i386
Source: dhcp3
Version: 3.0.1-1
Depends: debconf, debianutils (>= 2.8.2), dhcp3-common (= 3.0.1-1), libc6 (>= 2.3.2.ds1-4)
Conflicts: dhcp-relay
Filename: pool/main/d/dhcp3/dhcp3-relay_3.0.1-1_i386.deb
Size: 314468
MD5sum: 79d483e57cca4e94be998b3bd7cfe674
Description: DHCP Relay
This is the DHCP relay from version 3 of the Internet Software
Consortium DHCP package. For more information visit the ISC web
site at http://www.isc.org.
Reply With Quote
  #3 (permalink)  
Old 02-28-2005
Baho Utot
 
Posts: n/a
Default Re: DHCP server and client on same mashine

On Sun, 27 Feb 2005 20:54:26 +0100, Carramba wrote:


> is it possible to run both clien and server on same mashine, so that
> linux would serve as kind of gateway ?
>
> thanx in advance


If your talking about a NAT firewall machine that has 2 NICs one for the
internet (DHCP client) and one on your private LAN side that does DHCP
(DHCPd server) then the answer is Yes. Which is exactly what I have done.
Reply With Quote
  #4 (permalink)  
Old 02-28-2005
Carramba
 
Posts: n/a
Default Re: DHCP server and client on same mashine

thanx for software tips, and yes answer...
but to by more specific how to I bind eth0 to DHCP client and eth1 to
DHCPd server?


On Sun, 27 Feb 2005 14:03:41 -0600, John Hasler <john@dhh.gt.org> wrote:

> Carramba writes:
>> is it possible to run both clien and server on same mashine, so that
>> linux would serve as kind of gateway ?

>
> Guessing at what problem you are trying to solve:
>
> Package: dhcp3-relay
> Priority: optional
> Section: net
> Installed-Size: 548
> Maintainer: Eloy A. Paris <peloy@debian.org>
> Architecture: i386
> Source: dhcp3
> Version: 3.0.1-1
> Depends: debconf, debianutils (>= 2.8.2), dhcp3-common (= 3.0.1-1),
> libc6 (>= 2.3.2.ds1-4)
> Conflicts: dhcp-relay
> Filename: pool/main/d/dhcp3/dhcp3-relay_3.0.1-1_i386.deb
> Size: 314468
> MD5sum: 79d483e57cca4e94be998b3bd7cfe674
> Description: DHCP Relay
> This is the DHCP relay from version 3 of the Internet Software
> Consortium DHCP package. For more information visit the ISC web
> site at http://www.isc.org.
> .
> Installing this package will make the machine it is installed on to
> a dhcp relay. You need to have a DHCP or BOOTP server reachable in
> order
> to use the relay.
> .
> Documentation (apart from manpages) can be found in the dhcp package.
> .
> Note: This package _requires_ a 2.2.x or later Linux kernel. 2.0.x
> kernels
> are _not_ supported.
>





On Sun, 27 Feb 2005 23:20:51 GMT, Baho Utot
<baho-utot+NOSPAM+@columbus.rr.com> wrote:

> On Sun, 27 Feb 2005 20:54:26 +0100, Carramba wrote:
>
>
>> is it possible to run both clien and server on same mashine, so that
>> linux would serve as kind of gateway ?
>>
>> thanx in advance

>
> If your talking about a NAT firewall machine that has 2 NICs one for the
> internet (DHCP client) and one on your private LAN side that does DHCP
> (DHCPd server) then the answer is Yes. Which is exactly what I have
> done.




--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
Reply With Quote
  #5 (permalink)  
Old 02-28-2005
linnix
 
Posts: n/a
Default Re: DHCP server and client on same mashine


Carramba wrote:
> thanx for software tips, and yes answer...
> but to by more specific how to I bind eth0 to DHCP client and eth1 to


> DHCPd server?
>


Is this a trick question? If not, I would have guessed "dhcpcd eth0"
and "dhcpd eth1". One of them need "-i" and you need to read the
manual.

>
> On Sun, 27 Feb 2005 14:03:41 -0600, John Hasler <john@dhh.gt.org>

wrote:
>
> > Carramba writes:
> >> is it possible to run both clien and server on same mashine, so

that
> >> linux would serve as kind of gateway ?

> >
> > Guessing at what problem you are trying to solve:
> >
> > Package: dhcp3-relay
> > Priority: optional
> > Section: net
> > Installed-Size: 548
> > Maintainer: Eloy A. Paris <peloy@debian.org>
> > Architecture: i386
> > Source: dhcp3
> > Version: 3.0.1-1
> > Depends: debconf, debianutils (>= 2.8.2), dhcp3-common (=

3.0.1-1),
> > libc6 (>= 2.3.2.ds1-4)
> > Conflicts: dhcp-relay
> > Filename: pool/main/d/dhcp3/dhcp3-relay_3.0.1-1_i386.deb
> > Size: 314468
> > MD5sum: 79d483e57cca4e94be998b3bd7cfe674
> > Description: DHCP Relay
> > This is the DHCP relay from version 3 of the Internet Software
> > Consortium DHCP package. For more information visit the ISC web
> > site at http://www.isc.org.
> > .
> > Installing this package will make the machine it is installed on

to
> > a dhcp relay. You need to have a DHCP or BOOTP server reachable

in
> > order
> > to use the relay.
> > .
> > Documentation (apart from manpages) can be found in the dhcp

package.
> > .
> > Note: This package _requires_ a 2.2.x or later Linux kernel.

2.0.x
> > kernels
> > are _not_ supported.
> >

>
>
>
>
> On Sun, 27 Feb 2005 23:20:51 GMT, Baho Utot
> <baho-utot+NOSPAM+@columbus.rr.com> wrote:
>
> > On Sun, 27 Feb 2005 20:54:26 +0100, Carramba wrote:
> >
> >
> >> is it possible to run both clien and server on same mashine, so

that
> >> linux would serve as kind of gateway ?
> >>
> >> thanx in advance

> >
> > If your talking about a NAT firewall machine that has 2 NICs one

for the
> > internet (DHCP client) and one on your private LAN side that does

DHCP
> > (DHCPd server) then the answer is Yes. Which is exactly what I

have
> > done.

>
>
>
> --
> Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


Reply With Quote
  #6 (permalink)  
Old 02-28-2005
Tauno Voipio
 
Posts: n/a
Default Re: DHCP server and client on same mashine

Carramba wrote:
>
> is it possible to run both clien and server on same mashine, so that
> linux would serve as kind of gateway ?
>


I have.

There are two configurations hidden in your question:

1. The gateway forwards client requests to an upstream
server and the answers back. Here, the sensible usage
of the acquired address may create routing problems
in the gateway, as the both interfaces may be assigned
to the same subnet. The forwarding is handled by a
DHCP realy daemon in the gateway.

2. The gateway gets its upstream settings from the ISP
with DHCP, and distributes other (usually RFC 1918)
subnet addresses to the internal network server. For
outside connectivity of the internal network clients,
the gateway acts as a NAT address-translating router.
Usually, the gateway provides also firewalling services
for the internal network.

DHCP is here handled by two daemons: the DHCP daemon
to serve the internal network, and the DHCP client
daemon for obtaining the external interface settings.

My set-up is of the type 2 above. The DHCP daemons are
from the DHCP consortium package DHCP3.

--

Tauno Voipio
tauno voipio (at) iki fi

Reply With Quote
  #7 (permalink)  
Old 02-28-2005
Tauno Voipio
 
Posts: n/a
Default Re: DHCP server and client on same mashine

Carramba wrote:
> thanx for software tips, and yes answer...
> but to by more specific how to I bind eth0 to DHCP client and eth1 to
> DHCPd server?
>


This depends somewhat on your DHCP packace and Linux
dsitribution start-up scripts. Most daemons take the
interface as an argument on the command line.

For details, see the manpage of the daemon.

--

Tauno Voipio
tauno voipio (at) iki fi

Reply With Quote
  #8 (permalink)  
Old 02-28-2005
Baho Utot
 
Posts: n/a
Default Re: DHCP server and client on same mashine

On Mon, 28 Feb 2005 19:34:14 +0100, Carramba wrote:

> thanx for software tips, and yes answer...
> but to by more specific how to I bind eth0 to DHCP client and eth1 to
> DHCPd server?
>


This is my script that starts DHCPD
Have a look at www.linuxfromscratch.org use the BLFS (Beyond Linux From
Scratch) the DHCPD entries

#!/bin/sh
# Begin $rc_base/init.d/dhcpd

# Based on sysklogd script from LFS-3.1 and earlier.
# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org

.. /etc/sysconfig/rc
.. $rc_functions

case "$1" in
start)
echo "Starting DHCP Server..."
loadproc dhcpd -q eth1
;;

stop)
echo "Stopping DHCP Server..."
killproc dhcpd
;;

reload)
echo "Reloading DHCP Server..."
reloadproc dhcpd
;;

restart)
$0 stop
sleep 1
$0 start
;;

status)
statusproc dhcpd
;;

*)
echo "Usage: $0 {start|stop|reload|restart|status}"
exit 1
;;
esac

# End $rc_base/init.d/dhcpd

And for the dhcp client
#/etc/sysconfig/network-devices/ifconfig.eth0
ONBOOT=yes
DHCP_PROG=/sbin/dhclient
DHCP_START=
DHCP_STOP=-r

Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 08:35 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0