Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Syntax for prevent routing to be set by dhcp?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
pgu
l33t
l33t


Joined: 30 Jul 2009
Posts: 721
Location: Oslo, Norway

PostPosted: Tue Mar 05, 2024 8:53 am    Post subject: Syntax for prevent routing to be set by dhcp? Reply with quote

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
View user's profile Send private message
pgu
l33t
l33t


Joined: 30 Jul 2009
Posts: 721
Location: Oslo, Norway

PostPosted: Thu Mar 07, 2024 7:35 am    Post subject: Reply with quote

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
View user's profile Send private message
flexibeast
Guru
Guru


Joined: 04 Apr 2022
Posts: 324
Location: Naarm/Melbourne, Australia

PostPosted: Thu Mar 07, 2024 8:04 am    Post subject: Reply with quote

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
View user's profile Send private message
pgu
l33t
l33t


Joined: 30 Jul 2009
Posts: 721
Location: Oslo, Norway

PostPosted: Fri Mar 08, 2024 6:28 am    Post subject: Reply with quote

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
View user's profile Send private message
devanichol87
n00b
n00b


Joined: 08 Mar 2024
Posts: 1

PostPosted: Fri Mar 08, 2024 1:04 pm    Post subject: Reply with quote

Edit /etc/network/interfaces with static IP details.
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1660

PostPosted: Fri Mar 08, 2024 1:20 pm    Post subject: Reply with quote

devanichol87 wrote:
Edit /etc/network/interfaces with static IP details.

Nothing uses this file on Gentoo so this is bad advice.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum