Vieri l33t
Joined: 18 Dec 2005 Posts: 877
|
Posted: Mon Apr 26, 2021 6:23 am Post subject: DHCP relay agent and DHCP leases |
|
|
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 |
|