DHCP Server and Client on same interface

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

DHCP Server and Client on same interface

Sumant Gupta
Hi,
My machine has 2 interfaces tap0 and eth0.
Is it possible to run the dhcp server on tap0 interface and client on eth0.

I know this might be an odd case but i require this 
For my some sort of POC.
Regards
Sumant

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

Re: DHCP Server and Client on same interface

Eugene Grosbein
22.08.2017 22:26, Sumant Gupta wrote:

> Hi,
> My machine has 2 interfaces tap0 and eth0.
> Is it possible to run the dhcp server on tap0 interface and client on eth0.

Of course it is possible, why not? You will need another DHCP server reachable via eth0.


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

Re: DHCP Server and Client on same interface

Sumant Gupta
Thanks Eugene for quick response.

I didnt understand the below:
You will need another DHCP server reachable via eth0.

Also i have another query that is it possible to run dhcp server and dhcp client on same machine on same interface tap0?
Also do u have information that does dhcp server validate that source MAC address of in coming dhcp solicit packet?
-sumant

On Tuesday, August 22, 2017, Eugene Grosbein <[hidden email]> wrote:
22.08.2017 22:26, Sumant Gupta wrote:

> Hi,
> My machine has 2 interfaces tap0 and eth0.
> Is it possible to run the dhcp server on tap0 interface and client on eth0.

Of course it is possible, why not? You will need another DHCP server reachable via eth0.


_______________________________________________
dhcp-users mailing list
<a href="javascript:;" onclick="_e(event, &#39;cvml&#39;, &#39;dhcp-users@lists.isc.org&#39;)">dhcp-users@...
https://lists.isc.org/mailman/listinfo/dhcp-users

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

Re: DHCP Server and Client on same interface

Patrick Trapp
It sounds like you want the DHCP server to be getting its address from itself - if that's correct, I have to ask what you are hoping to accomplish, because I'm not creative enough to understand why that would be desirable.

I believe Eugene is assuming that you want the server to obtain an address from a different DHCP server on one interface while providing DHCP service on a second interface.

On Aug 22, 2017, at 10:53 AM, Sumant Gupta <[hidden email]> wrote:

Thanks Eugene for quick response.

I didnt understand the below:
You will need another DHCP server reachable via eth0.

Also i have another query that is it possible to run dhcp server and dhcp client on same machine on same interface tap0?
Also do u have information that does dhcp server validate that source MAC address of in coming dhcp solicit packet?
-sumant

On Tuesday, August 22, 2017, Eugene Grosbein <[hidden email]> wrote:
22.08.2017 22:26, Sumant Gupta wrote:

> Hi,
> My machine has 2 interfaces tap0 and eth0.
> Is it possible to run the dhcp server on tap0 interface and client on eth0.

Of course it is possible, why not? You will need another DHCP server reachable via eth0.


_______________________________________________
dhcp-users mailing list
<a href="javascript:;" onclick="_e(event, 'cvml', 'dhcp-users@lists.isc.org')">dhcp-users@...
https://lists.isc.org/mailman/listinfo/dhcp-users
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users

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

Re: DHCP Server and Client on same interface

Sumant Gupta
Actually i am writing an application that reads the data from client which is connected serially to linux machine where dhcp server is running,so i read the dhcp solicit from the serial interface and write to the TAP0 interface where dhcp server is running.
Now to write the data to TAP0 interface my application needs to populate the source MAC ,destination MAC i .Destination MAC I can populate but how to fill the Source MAC?.

Purpose is to provide Dhcp address to the serially connected Client?
Am i thinking the right way..

Hoping that you got my view

On Tuesday, August 22, 2017, Patrick Trapp <[hidden email]> wrote:
It sounds like you want the DHCP server to be getting its address from itself - if that's correct, I have to ask what you are hoping to accomplish, because I'm not creative enough to understand why that would be desirable.

I believe Eugene is assuming that you want the server to obtain an address from a different DHCP server on one interface while providing DHCP service on a second interface.

On Aug 22, 2017, at 10:53 AM, Sumant Gupta <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;sumantgupta@gmail.com&#39;);" target="_blank">sumantgupta@...> wrote:

Thanks Eugene for quick response.

I didnt understand the below:
You will need another DHCP server reachable via eth0.

Also i have another query that is it possible to run dhcp server and dhcp client on same machine on same interface tap0?
Also do u have information that does dhcp server validate that source MAC address of in coming dhcp solicit packet?
-sumant

On Tuesday, August 22, 2017, Eugene Grosbein <<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;eugen@grosbein.net&#39;);" target="_blank">eugen@...> wrote:
22.08.2017 22:26, Sumant Gupta wrote:

> Hi,
> My machine has 2 interfaces tap0 and eth0.
> Is it possible to run the dhcp server on tap0 interface and client on eth0.

Of course it is possible, why not? You will need another DHCP server reachable via eth0.


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
_______________________________________________
dhcp-users mailing list
<a href="javascript:_e(%7B%7D,&#39;cvml&#39;,&#39;dhcp-users@lists.isc.org&#39;);" target="_blank">dhcp-users@...
https://lists.isc.org/mailman/listinfo/dhcp-users

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

Re: DHCP Server and Client on same interface

Eugene Grosbein
In reply to this post by Sumant Gupta
22.08.2017 22:51, Sumant Gupta wrote:
> I didnt understand the below:
> You will need another DHCP server reachable via eth0.
>
> Also i have another query that is it possible to run dhcp server and dhcp client on same machine on same interface tap0?

If you want same machine to be dhcp server for itself and client for this server,
this depends on your operating system and not on DHCP software.

Some operating systems allow you to virtualize network stack instances,
so you could have two distinct network stacks within single kernel (FreeBSD's VNETs).

Or you could use full-blown Virtual Machine that has its own network stack.

You generally cannot run both of DHCP client and server within single network stack
using same interface.

> Also do u have information that does dhcp server validate that source MAC address of in coming dhcp solicit packet?

This depends of DHCP server software and its version too. You did not specify it.


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

Re: DHCP Server and Client on same interface

Sumant Gupta
Eugene can please comment in my below scenario,it would be really helpful.
.........
 i am writing an application on host machine that reads the data from client which is connected serially via COM port to host machine where dhcp server is running,so i read the dhcp solicit from the serial interface from client and my application writes  to the TAP0 interface where dhcp server is running.
Now to write the data to TAP0 interface my application needs to populate the source MAC ,destination MAC i .Destination MAC I can populate but how to fill the Source MAC?.

Purpose is to provide Dhcp address to the serially connected Client?

Sumant
On Tuesday, August 22, 2017, Eugene Grosbein <[hidden email]> wrote:
22.08.2017 22:51, Sumant Gupta wrote:
> I didnt understand the below:
> You will need another DHCP server reachable via eth0.
>
> Also i have another query that is it possible to run dhcp server and dhcp client on same machine on same interface tap0?

If you want same machine to be dhcp server for itself and client for this server,
this depends on your operating system and not on DHCP software.

Some operating systems allow you to virtualize network stack instances,
so you could have two distinct network stacks within single kernel (FreeBSD's VNETs).

Or you could use full-blown Virtual Machine that has its own network stack.

You generally cannot run both of DHCP client and server within single network stack
using same interface.

> Also do u have information that does dhcp server validate that source MAC address of in coming dhcp solicit packet?

This depends of DHCP server software and its version too. You did not specify it.


_______________________________________________
dhcp-users mailing list
<a href="javascript:;" onclick="_e(event, &#39;cvml&#39;, &#39;dhcp-users@lists.isc.org&#39;)">dhcp-users@...
https://lists.isc.org/mailman/listinfo/dhcp-users

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

Re: DHCP Server and Client on same interface

Eugene Grosbein
22.08.2017 23:43, Sumant Gupta wrote:

>  i am writing an application on host machine that reads the data
>  from client which is connected serially via COM port to host machine
>  where dhcp server is running,so i read the dhcp solicit from the serial interface
>  from client and my application writes  to the TAP0 interface where dhcp server is running.
> Now to write the data to TAP0 interface my application needs to populate the source MAC ,
> destination MAC i .Destination MAC I can populate but how to fill the Source MAC?.
>
> Purpose is to provide Dhcp address to the serially connected Client?

I cannot imagine why are you trying to use serial connection here.
Why can't you normally read incoming packet using network interface,
extract client's MAC address from the request and use it for reply?

You still do not mention your operating system name and version and you should.

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

Re: DHCP Server and Client on same interface

Sumant Gupta
Actually the client is some  embedded linux board and has only serial interface link and no Ethernet interface so I need to give dhcpv6 address to that client.

On my host machine it is linux Ubuntu 14.05 and o am using ISC DHCP server on Ubuntu machine


~
Sumant

On Tuesday, August 22, 2017, Eugene Grosbein <[hidden email]> wrote:
22.08.2017 23:43, Sumant Gupta wrote:

>  i am writing an application on host machine that reads the data
>  from client which is connected serially via COM port to host machine
>  where dhcp server is running,so i read the dhcp solicit from the serial interface
>  from client and my application writes  to the TAP0 interface where dhcp server is running.
> Now to write the data to TAP0 interface my application needs to populate the source MAC ,
> destination MAC i .Destination MAC I can populate but how to fill the Source MAC?.
>
> Purpose is to provide Dhcp address to the serially connected Client?

I cannot imagine why are you trying to use serial connection here.
Why can't you normally read incoming packet using network interface,
extract client's MAC address from the request and use it for reply?

You still do not mention your operating system name and version and you should.

_______________________________________________
dhcp-users mailing list
<a href="javascript:;" onclick="_e(event, &#39;cvml&#39;, &#39;dhcp-users@lists.isc.org&#39;)">dhcp-users@...
https://lists.isc.org/mailman/listinfo/dhcp-users

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

Re: DHCP Server and Client on same interface

Eugene Grosbein
23.08.2017 0:10, Sumant Gupta пишет:
> Actually the client is some  embedded linux board and has only serial interface link and no Ethernet interface so I need to give dhcpv6 address to that client.
>
> On my host machine it is linux Ubuntu 14.05 and o am using ISC DHCP server on Ubuntu machine

Then why do you use DHCP protocol in first place?
Serial interface is not Ethernet and have no MAC address.
You should better use some standard PPP software and assign IP to the board via PPP.

PPP will give you more less overhead and more speed then Ethernet over serial emulation.
It also supports transparent compression of IP packets that would be benefit for low-speed serial interface.



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

Re: DHCP Server and Client on same interface

Sumant Gupta
The thing is in my environment no manually interference is possible since it would be going as bundled package.so was trying to dhcp approach.

One way I can think is create raw socket on eth0 in my application  with dhcpv6 solicit packet received from client  send to tap0 interface where dhcp server is running..
What's your view?
Sumant

On Tuesday, August 22, 2017, Eugene Grosbein <[hidden email]> wrote:
23.08.2017 0:10, Sumant Gupta пишет:
> Actually the client is some  embedded linux board and has only serial interface link and no Ethernet interface so I need to give dhcpv6 address to that client.
>
> On my host machine it is linux Ubuntu 14.05 and o am using ISC DHCP server on Ubuntu machine

Then why do you use DHCP protocol in first place?
Serial interface is not Ethernet and have no MAC address.
You should better use some standard PPP software and assign IP to the board via PPP.

PPP will give you more less overhead and more speed then Ethernet over serial emulation.
It also supports transparent compression of IP packets that would be benefit for low-speed serial interface.



_______________________________________________
dhcp-users mailing list
<a href="javascript:;" onclick="_e(event, &#39;cvml&#39;, &#39;dhcp-users@lists.isc.org&#39;)">dhcp-users@...
https://lists.isc.org/mailman/listinfo/dhcp-users

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

Re: DHCP Server and Client on same interface

Eugene Grosbein
23.08.2017 0:26, Sumant Gupta wrote:
> The thing is in my environment no manually interference is possible since it would be going as bundled package.so was trying to dhcp approach.

I don't think this will work well with serial connection.
Just use automatic passwordless PPP with PAP for the task of assigning IP address and route
to the board. That will work much better.
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users