Static routing on green DHCP

Hi,

I set the gateway in dhcpd.conf.local to another gateway.
That works for both GREEN and BLUE.

And then set in ipfire GUI in STATIC ROUTES for some clients an alternate gateway.
That works fine for BLUE but not for GREEN??

Anyone having any clue why?

Hello E. - Welcome to the IPFire Community!

Without knowing more details it would be near impossible to help.

  • What version are you using?

  • Did everything work OK before making the changes?

  • What did you add to dhcpd.conf.local?

  • What are the new static routes?

1 Like

Hi Jon,
Thanks for the quick resonse.

What version are you using?

IPFire version |IPFire 2.29 (x86_64) - core185|
Pakfire version |2.29-x86_64|

Did everything work OK before making the changes?

Yes, it did.

What did you add to dhcpd.conf.local?

#subnet 192.168.1.0 netmask 255.255.255.0 #BLUE
#{
option domain-name-servers 192.168.178.251;
option routers 192.168.178.250;
#} #BLUE

subnet 192.168.178.0 netmask 255.255.255.0 #GREEN
{
option domain-name-servers 192.168.178.251;
option routers 192.168.178.250;
} #GREEN

What are the new static routes?

Routing Table Entries

192.168.1.42 via 192.168.1.1 dev blue0 proto static
192.168.1.150 via 192.168.1.1 dev blue0 proto static
192.168.178.29 via 192.168.178.1 dev green0 proto static
192.168.178.100 via 192.168.178.1 dev green0 proto static
192.168.178.134 via 192.168.178.1 dev green0 proto static
192.168.178.135 via 192.168.178.1 dev green0 proto static
192.168.178.136 via 192.168.178.1 dev green0 proto static
192.168.178.140 via 192.168.178.1 dev green0 proto static
192.168.178.181 via 192.168.178.1 dev green0 proto static
192.168.178.251 via 192.168.178.1 dev green0 proto static

Cheers
Erik

Ok,
to complete the information, could give

  • green and blue network defined in dhcp.cgi
  • devices of 192.1268.178.250 and 192.1268.178.251
  • IP of IPFire

please?

Hi Bernhard,

Sorry no clue what you are looking for in DHCP.CGI?

De devices are linux based ESX virtual machines.
250 is the alternate (VPN) gateway.
251 is a DNS server.

The IP is 192.168.178.1 (green) 192.168.1…1 (BLUE)

Cheers
Erik

dhcp.cgi shows the networks defined in IPFire.
A save operation transfers this information to dhcpd.conf.
Why do you this network definition for dhcpd in dhcpd.conf.local?

BTW: from a shell you can check the dhcpd config with dhcpd -t

Hi,

This is the output:
dhcpd -t
Internet Systems Consortium DHCP Server 4.4.3-P1
Copyright 2004-2022 Internet Systems Consortium.
All rights reserved.
For info, please visit ISC DHCP - ISC
Config file: /etc/dhcp/dhcpd.conf
Database file: /var/state/dhcp/dhcpd.leases
PID file: /var/run/dhcpd.pid

In the forum someone said to to do that in the .local so it will stay persistent?

Cheers
Erik

The output of dhcpd -t shows that the config is ok.
How are the definitions of the subnets in dhcpd.conf?
With your settings in dhcpd.conf.local you may have double DNS / router definitions. I think the last definition is active.

Hi again,

deny bootp;     #default
authoritative;
ddns-update-style none;

subnet 192.168.178.0 netmask 255.255.255.0 #GREEN
{
pool {
        range 192.168.178.30 192.168.178.90;
     }
        option subnet-mask 255.255.255.0;
        option domain-name "cte.local";
        option routers 192.168.178.1;
        option domain-name-servers 192.168.178.251;
        option ntp-servers 192.168.178.1;
        default-lease-time 3600;
        max-lease-time 7200;
        allow bootp;
} #GREEN

subnet 192.168.1.0 netmask 255.255.255.0 #BLUE
{
pool {
        range 192.168.1.170 192.168.1.250;
     }
        option subnet-mask 255.255.255.0;
        option domain-name "cte.local";
        option routers 192.168.1.1;
        option domain-name-servers 192.168.178.251;
        option ntp-servers 192.168.1.1;
        default-lease-time 3600;
        max-lease-time 7200;
        allow bootp;
} #BLUE

But if there is a better way to set static routing for some of the DHCP clients then the ,LOCAL, I am all ears… :slight_smile:
Cheers
Erik


EDIT: moderator formatted code