View previous topic :: View next topic |
Author |
Message |
pgu l33t
Joined: 30 Jul 2009 Posts: 721 Location: Oslo, Norway
|
Posted: Tue Mar 05, 2024 8:53 am Post subject: Syntax for prevent routing to be set by dhcp? |
|
|
Quote: |
# grep wlp2s0 /etc/conf.d/net
config_wlp2s0="dhcp"
dhcp_wlp2s0="release nodns nontp nonis nogateway nosendhost"
|
Is the above the correct syntax? I seem to get gateways from dhcp still? I would like to get the IP (or possibly hostname) only.
I also tried to disable the following options from the dhcp client as well:
Code: |
# grep option /etc/dhcpcd.conf
# A list of options to request from the DHCP server.
#option domain_name_servers, domain_name, domain_search
#option classless_static_routes
option interface_mtu
option host_name
#option ntp_servers
# Safe to enable by default because it requires the equivalent option set
option rapid_commit
|
But still I get routing table entries after some time for this interface. What is the correct syntax/method to disable this? |
|
Back to top |
|
|
pgu l33t
Joined: 30 Jul 2009 Posts: 721 Location: Oslo, Norway
|
Posted: Thu Mar 07, 2024 7:35 am Post subject: |
|
|
What seem to work is to set the nogateway option in the dhcpcd.conf file, even though it will then be global for all interfaces on the host. |
|
Back to top |
|
|
flexibeast Guru
Joined: 04 Apr 2022 Posts: 425 Location: Naarm/Melbourne, Australia
|
Posted: Thu Mar 07, 2024 8:04 am Post subject: |
|
|
You could try putting an "interface" line before the "nogateway" line, as described in the dhcpcd.conf man page:
Quote: | interface interface
Subsequent options are only parsed for this interface. |
|
|
Back to top |
|
|
pgu l33t
Joined: 30 Jul 2009 Posts: 721 Location: Oslo, Norway
|
Posted: Fri Mar 08, 2024 6:28 am Post subject: |
|
|
flexibeast wrote: |
You could try putting an "interface" line before the "nogateway" line.
|
Thank you. I was not aware of this type of context mode change option in the file. I will try to re-organize the contents of the file as I have multiple interfaces which should have different options. |
|
Back to top |
|
|
devanichol87 n00b
Joined: 08 Mar 2024 Posts: 1
|
Posted: Fri Mar 08, 2024 1:04 pm Post subject: |
|
|
Edit /etc/network/interfaces with static IP details. |
|
Back to top |
|
|
grknight Retired Dev
Joined: 20 Feb 2015 Posts: 1896
|
Posted: Fri Mar 08, 2024 1:20 pm Post subject: |
|
|
devanichol87 wrote: | Edit /etc/network/interfaces with static IP details. |
Nothing uses this file on Gentoo so this is bad advice. |
|
Back to top |
|
|
|