Fwd: Re[4]: How to - DHCP Relay and Server on same machine (FreeBSD)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Fwd: Re[4]: How to - DHCP Relay and Server on same machine (FreeBSD)

test24



Simon Hobson WROTE

test24 <test24 at mail.ru> wrote: > man dhcp relay says: >> -p PORT > Listen and transmit on port PORT. This is mostly useful for > debugging purposes. Default is port 67 for DHCPv4/BOOTP That changes the port the relay agent uses - but **NOT** the port it assumes the server is using. Checking the man page I see nothing to suggest it can talk to a server via a non-standard port - you could try "nnn.nnn.nnn.nnn:77" for server IP, but I suspect that's not implemented. If not, I imagine it might be "relatively" simple to edit the code and hard code a different server port to use.


For dhcp relay next server is written in rc.conf as the

dhcrelay_servers="10.10.10.1"         # v4 dhcrelay server(s)

and option -P says ONLY ! one port - for clients and for next server

This port is the same for clients and for next server


In my case dhcp relay MUST listen one port (standart 67/68 for clients side) and send requests to NEXT server on OTHER port.
It is one the SAME machine, than I can not say ! dhcpD ! listen 67 port too. And as a result - dhcpd server not see requests on 77 port because dhcp relay uses only ONE port
for clients side and for servers side.

It is generally unneded if the relay and server placed on different machines, but if machine is same - it is actual needed feature... because i want to add option 82 packets
by relay and send replies on this requests by dhcpd server without using second machine.

Second reason - my machine acts as router and vlans back end. Than option 82 must be added on this machine ().
And on this machine dhcpd must say replies for unknown client MACs but known client vlans








_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: How to - DHCP Relay and Server on same machine (FreeBSD)

Simon Hobson
Firstly, could you please fix your email client and get it to quote text properly !

test24 <[hidden email]> wrote:

>  Simon Hobson WROTE
>
>> test24 <test24 at mail.ru
>> > wrote:
>>
>> >
>>  man dhcp relay says:
>>
>> >>
>>  -p PORT
>>
>> >
>>                Listen  and  transmit  on  port PORT.  This is mostly useful for
>>
>> >
>>                debugging purposes.  Default is port  67  for  DHCPv4/BOOTP
>>
>>
>> That changes the port the relay agent uses - but **NOT** the port it assumes the server is using. Checking the man page I see nothing to suggest it can talk to a server via a non-standard port - you could try "nnn.nnn.nnn.nnn:77" for server IP, but I suspect that's not implemented.
>>
>> If not, I imagine it might be "relatively" simple to edit the code and hard code a different server port to use.


> For dhcp relay next server is written in rc.conf as the
>
> dhcrelay_servers="10.10.10.1"         # v4 dhcrelay server(s)
>
> and option -P says ONLY ! one port - for clients and for next server
>
> This port is the same for clients and for next server

You've already said that - we've seen it

> In my case dhcp relay MUST listen one port (standart 67/68 for clients side) and send requests to NEXT server on OTHER port.

You've already said that - it's been pointed out that it probably can't do it without editing the code.
I haven't looked at the code, but I suspect there's a constant defined which is used as the destination port for packets sent to the server. Changing this is likely to do what you want.
More elegantly, allowing the server to be specified as "IP:Port" (if it's not already) would be even better and would allow what you want from the command line without any editing or compiling.

> It is one the SAME machine, than I can not say ! dhcpD ! listen 67 port too. And as a result - dhcpd server not see requests on 77 port because dhcp relay uses only ONE port
> for clients side and for servers side.

Yes, I got that first time around.
Though actually it is not correct. It's not because the Relay agent only uses one port, it's because the relay agent doesn't appear to have a facility to talk to the server running on a non-standard port.

> It is generally unneded if the relay and server placed on different machines, but if machine is same - it is actual needed feature... because i want to add option 82 packets
> by relay and send replies on this requests by dhcpd server without using second machine.

Yes, and I got that first time around as well.

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users