Home
Help
Search
Login
Register
OPNsense Forum
»
English Forums
»
General Discussion
»
Static DHCP lease on VLAN
« previous
next »
Print
Pages: [
1
]
Author
Topic: Static DHCP lease on VLAN (Read 2591 times)
posterberg
Newbie
Posts: 2
Karma: 0
Static DHCP lease on VLAN
«
on:
January 06, 2021, 12:58:02 am »
Hi
Version: OPNsense 20.7-amd64
I am brand new to OPNsense, have been running a pure iptables based fw for roughly 20yrs in my home network. Thought that it was a good idea to try out something new.
OPNsense is installed in a vm and it has been given two physical nics on my esxi host. One for the external interface and one for all internal vlans.
First thing I want to do is to set up all DHCP ranges and static leases before I decommission my old firewall so all existing hosts get a hiccup. I do however get into trouble right away.
Lets start with one of the vlans, 1003. I have the nic vmx1_VLAN1003 configured to 10.x.3.253/24. The DHCP scope configured is 10.x.3.20-100. I then try to set up a static lease for one host to be 10.x.3.186.
That gives me an error saying, "The IP address must lie in the TRUNK1003_MEDIA subnet.".
I really don't understand why this happens, the static lease is well in range of that subnet.
I also tried to do the same thing on vmx1, a subnet that isn't vlan tagged. It worked right away. Seems like this only happens on vlan interfaces.
Is there something OPNsenseish that a noob like me is bound to miss?
/p
Logged
posterberg
Newbie
Posts: 2
Karma: 0
Re: Static DHCP lease on VLAN
«
Reply #1 on:
January 06, 2021, 01:21:44 am »
I think I just solved it... I just had to click Apply on the interface settings, Save wasn't sufficient. A bit weird that I could define the DHCP scope and that it seemed to understand the ip range of the interface even though the interface settings weren't applied, but the static lease didn't understand it.
Anyway, that seemed to do it and I think I've learnt that Save isn't Apply. Rookie mistake... :-)
Logged
NoneSense
Newbie
Posts: 1
Karma: 0
Re: Static DHCP lease on VLAN
«
Reply #2 on:
September 10, 2023, 01:49:08 am »
No,
this is a bug
!
When I create a static DHCPv4 mapping (ie: 10.10.1.200) for a device on a XXX subnet in the range (10.10.1.100 - 10.10.1.254) I incorrectly get the error "The IP address must lie in the XXX subnet" when I press save.
Work around
: If I go to the Interfaces/[XXX] page and just press Save followed by Apply
(you may have to do this more than once)
, I am now able to save the static mapping without an error!
It seems like the static DHCP mapping page is comparing the entered IP to the IP range of the
last saved interface
, not the one associated with the page. I have two NICs with their own subnet ranges and DHCP assignments. I can only enter static IP mappings for the interface that I last saved and applied.
I noticed that if you go to the Interfaces/Overview page and open both interfaces (in my case, LAN and DMZ), you will see that only the last saved interface will have the "IPv4 address" row. The other interface will be missing it. For this reason, I would assume this bug effects the entire product. Maybe related to the "interfaces_primary_address" function? I have no idea.
Note: This problem seems to randomly occur, as I can't seem to reproduce it right now.
«
Last Edit: September 10, 2023, 02:06:00 am by NoneSense
»
Logged
Patrick M. Hausen
Hero Member
Posts: 6825
Karma: 572
Re: Static DHCP lease on VLAN
«
Reply #3 on:
September 10, 2023, 07:53:54 am »
@NoneSense you necroed an over two year old thread. If this still happens with with 23.7 then please file a bug report on github.
Logged
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do.
(Isaac Asimov)
franco
Administrator
Hero Member
Posts: 17661
Karma: 1611
Re: Static DHCP lease on VLAN
«
Reply #4 on:
September 10, 2023, 01:04:03 pm »
Static mappings check the running interface configuration. If you haven't applied your interface settings yet after changing to a new network address in another segment that's just what it is going to be.
Adding gateways has the same behaviour BTW.
Cheers,
Franco
Logged
Print
Pages: [
1
]
« previous
next »
OPNsense Forum
»
English Forums
»
General Discussion
»
Static DHCP lease on VLAN