Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
DHCP relay agent and DHCP leases
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Vieri
l33t
l33t


Joined: 18 Dec 2005
Posts: 877

PostPosted: Mon Apr 26, 2021 6:23 am    Post subject: DHCP relay agent and DHCP leases Reply with quote

Hi,

My Gentoo router relays client DHCP requests to a server on another subnet with net-misc/dhcp-4.4.2-r2.
This is the conf.d file:

Code:
IFACE="lan.1 lan.13 ibs"
DHCRELAY_SERVERS="10.215.137.54"


This is my network config.:

Code:
# ip a s lan.1
26: lan.1@lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether ac:1f:6b:f5:b7:1b brd ff:ff:ff:ff:ff:ff
    inet 10.215.144.91/22 brd 10.215.147.255 scope global lan.1
       valid_lft forever preferred_lft forever
    inet 10.215.246.91/23 brd 10.215.247.255 scope global lan.1
       valid_lft forever preferred_lft forever
    inet 10.215.248.91/24 brd 10.215.248.255 scope global lan.1
       valid_lft forever preferred_lft forever
    inet 10.215.111.254/22 brd 10.215.111.255 scope global lan.1
       valid_lft forever preferred_lft forever
    inet 192.168.144.91/24 brd 192.168.144.255 scope global lan.1
       valid_lft forever preferred_lft forever
    inet 10.215.145.241/23 brd 10.215.145.255 scope global lan.1
       valid_lft forever preferred_lft forever
    inet 192.168.246.1/23 brd 192.168.247.255 scope global lan.1
       valid_lft forever preferred_lft forever
    inet 192.168.136.91/22 brd 192.168.139.255 scope global lan.1
       valid_lft forever preferred_lft forever
    inet 10.215.144.6/22 brd 10.215.147.255 scope global secondary lan.1
       valid_lft forever preferred_lft forever
    inet 10.215.145.242/23 brd 10.215.145.255 scope global secondary lan.1
       valid_lft forever preferred_lft forever
    inet 10.215.145.81/23 brd 10.215.145.255 scope global secondary lan.1
       valid_lft forever preferred_lft forever


Code:
# ip a s lan.13
28: lan.13@lan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc prio state UP group default qlen 1000
    link/ether ac:1f:6b:f5:b7:1b brd ff:ff:ff:ff:ff:ff
    inet 192.168.215.97/28 brd 192.168.215.111 scope global lan.13
       valid_lft forever preferred_lft forever



All's fine for DHCP clients in lan.1. The remote DHCP server log shows that the Relay Agent IP address is 10.215.144.91, and the replies are routed back appropriately.

The DHCP requests made from lan.13 get to the DHCP server, and the Relay Agent IP addr. is 192.168.215.97 as expected. However, 192.168.*.* addr. are unroutable in the remote subnet where the server resides, and I can't change that.

I need the clients in lan.13 to get addresses from the remote server which serves in the 10.215.*.* range.
I know dhcrelay accepts options such as -a and -m, but I have no idea how to use them.
Any ideas?
Maybe I should add a second IP addr. to lan.13 within the 10.215.*.* range, but I'm not sure how DHCP decides which downlink IP addr. to use.

I also tried to configure my own DHCP service on the Gentoo router, but I cannot serve leases in the 10.215.*.* range if dhcpd runs on the lan.13 interface. Maybe in that case too I would need to add a second IP addr. (even though I'd rather avoid that)?

In case you're wondering, I then set up route rules for traffic to/from 10.215.*.* hosts in lan.13.
In other words, the same way I set up manual IP addr. in 10.215.*.* for lan.13 and route them appropriately, I'd like to do the same for DHCP clients but somehow the DHP protolo is getting in my way.

Thanks in advance for any feedback.

Vieri
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 30907
Location: here

PostPosted: Mon Apr 26, 2021 6:51 am    Post subject: Reply with quote

Moved from Other Things Gentoo to Networking & Security.
_________________
Questions are guaranteed in life; Answers aren't.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum