Solved Freebsd 16 , How do I completely disable Auto DHCP on VLANs ?

HI

By setting :

ifconfig_em0="up"

in /etc/rc.conf auto DHCP does not trigger and I can configure IPv4 manually
this seems to be harder when setting up VLANs.

during startup of server, entries are added automagically to /etc/rc.conf , and I see

ifconfig_vlan0="DHCP"
ifconfig_vlan1="DHCP"

in rc.conf after every reboot.

Where in the boot sequence can this behavior be turned off ? and DHCP client activities be fully stopped ?
the DHCP operations casuses the CISCO switch to put the port in shutdown down mode.
So I need to turn this "feature " off.
 
Topics about unsupported FreeBSD versions

during startup of server, entries are added automagically to /etc/rc.conf
No, it doesn't? What makes you think interfaces have been added automatically?

Maybe you are using net/cloud-init or something similar? There's nothing in the standard rc(8) scripts that 'automagically' adds interfaces to /etc/rc.conf, as a matter of fact nothing is added or removed from rc.conf at all.
 
What the fudge? Entries are added to /etc/rc.conf at boot? That'd be news.. So if you remove them, they come back at next boot if I'm understanding correctly. That should never happen unless you do something very custom yourself.
 
A common mistake I've seen newbies make, putting commands like sysrc(8) in rc.conf. Don't do that, don't put any command in rc.conf. This file is sourced countless times from within rc(8) scripts and your commands will get executed each and every time it is sourced. rc.conf should only contain variable assignments and nothing else.
 
Update:
#1 by removing BPF driver from the Kernel by recompiling custom Kernel , I made DHCLIENT shut up.
#2 when Lagg driver tries to start to set up the LAGG0 Etherchannel/Portchannel to the Cisco C3560-cx switch, the Switch reports PAGP-FLAP and disables the ports. This worked with no issues on FBSD-15 but does not work on FBSD 16-current. I replaced the patch cables but no change in status.
#3 I cant se any recent massive changes to the LAGG driver on the src tree , so no clue there. the machine have one EM and one IGB interface.
#4 the ports on computer and switch work fine when setup as " switchport access" and not configured for Etherchannel .

Any advise ?
 
#1 by removing BPF driver from the Kernel by recompiling custom Kernel , I made DHCLIENT shut up.
Yes, you pulled the rug from underneath dhclient(8). Still doesn't explain how you think those interface are set to DHCP in rc.conf in the first place. Those entries aren't created out of thin air.
 
you removed BPF from the kernel? so its userland would stop sending DHCP?

?_?

you realize this also breaks things like tcpdump, right?
 
HI, Agree that Im "experimenting" & living on the edge, with this machine.
Other machines run 14.3 and 15-stable.
Im not a developer , only been doing UNIX/LINUX support for the last 40 years, mostly Solaris & SUSE
So Im reporting what I find and experience. This "box" works now, while not using Lagg / Etherchannel and
reducing the Igb0 RX & TX queues from 4 to 2.
On small machines like laptops & barebones you are stuck with the network devices on the Motherboard.
On ATX style Tower_PC i much prefer to use a discrete DUAL I/F Network card like the Intel I-350 or Intel X710
thats known to work well.
 
There's some script or program which modify and add those interface configurations in your /etc/rc.conf and this script is NOT from the FreeBSD base. You should look what you have installed and running. Can you post the output of the following commands:
cat /etc/rc.conf
cat /etc/rc.conf.local
cat /etc/rc.local
 
Yes , looks like net-mgmt/networkmgr is starting automagically ......

from the README.md

-----------------------------
Then:

`cd networkmgr` and `python3.8 setup.py install`
Users of NetworkMgr must be members of the _wheel_ group. To add a user:
`pw groupmod wheel -m username`
## Starting NetworkMgr
If the desktop environment supports XDG then you can simply log out, or restart the computer. NetworkMgr should start automatically at login time.
-------------------
So its started in background by KDE6 with no user intervention requiered.
Ok so I will turn this thing off and restore the LAGG port and try again .

thanks ,
 
HI,

After de-installing net-mgmt/networkmgr , re-enableing kernel BPF module and activating LAGG configuration
this is the result:

Cisco C3560-cx: Ports are up , Ether- channel is up , and Vlan's are working .

Nov 22 08:41:03.152: %LINK-3-UPDOWN: Interface GigabitEthernet2/0/4, changed state to up
Nov 22 08:41:04.274: %LINK-3-UPDOWN: Interface GigabitEthernet2/0/3, changed state to up
Nov 22 08:41:08.755: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet2/0/3, changed state to up
Nov 22 08:41:09.752: %LINK-3-UPDOWN: Interface Port-channel3, changed state to up
Nov 22 08:41:09.773: %LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet2/0/4, changed state to up
Nov 22 08:41:10.755: %LINEPROTO-5-UPDOWN: Line protocol on Interface Port-channel3, changed state to up
Nov 22 08:41:37.767: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up
Nov 22 08:41:37.771: %LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan5, changed state to up

-----------------------

/etc/rc.conf

#
# Setting up Network Trunk"
#
ifconfig igb0 up
ifconfig em0 up
cloned_interfaces="lagg0"
ifconfig_lagg0="laggproto lacp laggport igb0 laggport em0"
vlans_lagg0="linkA0 linkB0"
create_args_linkA0="vlan 4"
ifconfig_linkA0="inet 10.10.5.111/24"
create_args_linkB0="vlan 5"
ifconfig_LinkB0="inet 10.18.230.99/24"

--------------------------------------

Conclusion:

Network manager does not understand LAGG setups.
But instead tries to solicit DHCP responces for the interfaces
 
fwiw a large part of what drove us off of linux was networkmanager deciding it knew better about what to do with our interfaces than we did. freebsd's default networking stuff is reliable and doesn't randomly countermand commands that we make.
 
fwiw a large part of what drove us off of linux was networkmanager deciding it knew better about what to do with our interfaces than we did. freebsd's default networking stuff is reliable and doesn't randomly countermand commands that we make.
Networkmanager can have a nice in switching between WIFI and Wired on a laptop , but now I understand that its logic is limited .......
not fit for desktops with multiple aggregated ports.
 
Back
Top