You are not logged in.

#1 2020-12-03 11:56:23

ricco75
Member
Registered: 2020-11-11
Posts: 22

dhcp server ?

Hello
I have 2 ethernet cards (enp0s10, enp0s4f1u4) in static ip in my computer
i have use netctl to setup them


Network 1 : (enp0s10)

Description='Static ethernet connection enp0s10'
Interface=enp0s10
Connection=ethernet
IP=static
Address=('192.168.0.90/24')
Gateway='192.168.0.254'
DNS=('192.168.0.254')

Network 2 : (enp0s4f1u4)

Description='Static ethernet connection enp0s4f1u4'
Interface=enp0s4f1u4
Connection=ethernet
IP=static
Address=('192.168.2.90/24')
#Gateway='192.168.2.254'
#DNS=('192.168.2.254')

I would like to have the network 2 (enp0s4f1u4)
in DHCP server from 192.168.2.100 ti 192.168.2.200

How to do that ??

Thanks

Offline

#2 2020-12-03 12:28:22

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,361

Re: dhcp server ?

All of this smells XY Problem to me: http://xyproblem.info/

What do you actually want to do? What is your end goal here?

Last edited by V1del (2020-12-03 12:29:06)

Offline

#3 2020-12-03 12:37:11

ricco75
Member
Registered: 2020-11-11
Posts: 22

Re: dhcp server ?

Sorry
I don't understand ?

I have try this post
https://bbs.archlinux.org/viewtopic.php?id=91666


dhcp.conf:

option domain-name-servers 192.168.2.90;
default-lease-time 86400;
max-lease-time 604800;
authoritative;
subnet 192.168.2.0 netmask 255.255.255.0 {
range 192.168.2.100 192.168.2.200;
filename "pxelinux.0";        # the PXELinux boot agent
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.2.255;
option routers 192.168.2.90;
}

I have no return error
but no dhcp too

/etc/rc.d/dhcpd start

Last edited by ricco75 (2020-12-03 12:37:43)

Offline

#4 2020-12-03 13:44:58

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,685

Re: dhcp server ?

You're asking about a dhcp configuration but use a static one - that makes no sense.

First, let's see whether there's a dhcp server in the network:

Edit, two NICs.

sudo nmap -e enp0s10 --script broadcast-dhcp-discover
sudo nmap -e enp0s4f1u4 --script broadcast-dhcp-discover

Post the outputs

Last edited by seth (2020-12-03 13:46:42)

Offline

#5 2020-12-03 13:57:14

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,515
Website

Re: dhcp server ?

ricco75 wrote:

I have no return error
but no dhcp too

/etc/rc.d/dhcpd start

If /etc/rc.d/dhcpd start returned no error, you are either not using arch linux, or there are some very important details of your system you have failed to mention.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#6 2020-12-03 14:17:59

ricco75
Member
Registered: 2020-11-11
Posts: 22

Re: dhcp server ?

Sorry Seth  i don't understand

On my enp0s10 card there is a dhcp on the network (this network is totally different)

but other card : enp0s4f1u4  is alone : no DHCP in this network
I would like my computer make addressing range 192.168.2.100 to 192.168.2.200 to elements in this network

Last edited by ricco75 (2020-12-03 14:18:52)

Offline

#7 2020-12-03 14:25:11

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,685

Re: dhcp server ?

Output of "ip route"?
And elaborate on the dhcp client situation - the thread you linked is a decade old and vastly outdated - the information there is useless.

Offline

#8 2020-12-03 14:32:12

ricco75
Member
Registered: 2020-11-11
Posts: 22

Re: dhcp server ?

I'am not at home but if try to access to the computer by my iphone

sudo nmap -e enp0s10 --script broadcast-dhcp-discover 

return the dhcp server on this network : 192.168.0.254 : ok

sudo nmap -e enp0s4f1u4  --script broadcast-dhcp-discover 

return 0

Offline

#9 2020-12-03 14:33:27

ricco75
Member
Registered: 2020-11-11
Posts: 22

Re: dhcp server ?

nothing connected to the network 2 actually... this card is down now....

Offline

#10 2020-12-03 14:35:06

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,685

Re: dhcp server ?

Well, yes - you've to add a routing table entry.
This has nothing to do w/ the dhcp server (your OP was a bit vague/ambigious/misleading there) - notably since this subnet is not configured via dhcp itfp.

Offline

#11 2020-12-03 14:40:51

ricco75
Member
Registered: 2020-11-11
Posts: 22

Re: dhcp server ?

I would like to have 2 differents networks.

home network :
192.168.0.x it's working well with a dhcp inside this.


IOT network :
192.168.2.x without any dhcp server inside for the moment, i would like the computer make adressing  192.168.2.100 to 192.168.2.200 to elements in this network
I don't want a route to the home network
Only this computer to access

Last edited by ricco75 (2020-12-03 14:43:00)

Offline

#12 2020-12-03 14:42:42

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,685

Re: dhcp server ?

You still have to route traffic to 192.168.2.0/24 over enp0s4f1u4
This has nothing to do with yoru dhcp server…

Offline

#13 2020-12-03 14:49:22

ricco75
Member
Registered: 2020-11-11
Posts: 22

Re: dhcp server ?

behind this computer i have a long range external wifi Access Point. Unfortunally this wifi AP is no DHCP server.... its why i need this functionnality on this machine

Offline

#14 2020-12-03 15:05:45

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,685

Re: dhcp server ?

What does that have to do with anything?

You've to configure the routing table to direct requests over the relevant NICs.
How exactly you do that depends (well, to some extent - you can always use "ip r add …") on how you actually configure the network, a question  you've not yet answered (and it's certainly not by "/etc/rc.d/dhcpd start")

Offline

#15 2020-12-03 17:09:42

ricco75
Member
Registered: 2020-11-11
Posts: 22

Re: dhcp server ?

Ok i'am at home near my computer.
Everything are connected.
Now  to resume :

i have created this file :

sudo nano /etc/dhcpd.conf{/quote]


ption domain-name-servers 8.8.8.8, 8.8.4.4;
option subnet-mask 255.255.255.0;
option routers 192.168.2.90;
subnet 192.168.90.0 netmask 255.255.255.0 {
  range 192.168.2.150 192.168.2.250;
}

i do :

sudo systemctl start dhcpcd.service

no error but no dhcp server working

sudo nmap -e enp0s4f1u4 --script broadcast-dhcp-discover
no dhcp
[WARNING: No targets were specified, so 0 hosts scanned.
Nmap done: 0 IP addresses (0 hosts up) scanned in 11.62 seconds

Last edited by ricco75 (2020-12-03 17:11:51)

Offline

#16 2020-12-03 21:40:53

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,685

Re: dhcp server ?

sudo nano /etc/dhcpd.conf{/quote]

Typos aside, this is a dhcpd config for a dhcp *server* which is …

sudo systemctl start dhcpcd.service

… not the same as dhcpcd - a dhcp *client* that you're launching here.

behind this computer i have a long range external wifi Access Point. Unfortunally this wifi AP is no DHCP server.... its why i need this functionnality on this machine

For clarification: do you want to turn this computer™ into a router or do you (ultimately) just want to forward the other dhcp server (and likely router) to provide clients of the AP with internet access?

https://wiki.archlinux.org/index.php/Router
https://wiki.archlinux.org/index.php/Network_bridge

Offline

#17 2020-12-04 07:43:49

ricco75
Member
Registered: 2020-11-11
Posts: 22

Re: dhcp server ?

Hello seth
For clarification : 2 ethernets card on my computer.
Network 1 : (enp0s10)
Network 2 : (enp0s4f1u4)

The network 1 is my home.
The network 2 is my IOT Objects

Acces of my IOT objects are ONLY on this computer : no route needed. No linked to the network1

On this network 2 i need a dhcp server because not possible to enter manually a adress on y IOT objetcs.

Thanks

Last edited by ricco75 (2020-12-04 07:49:58)

Offline

#18 2020-12-04 07:58:55

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,685

Re: dhcp server ?

'key - then you need a dhcp server and to understand that dhcpd and dhcpcd are different things.
https://www.archlinux.org/packages/extra/x86_64/dhcp/

Offline

Board footer

Powered by FluxBB