Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
openrc: netifrc -> newnet: failed
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
CaptainBlood
Veteran
Veteran


Joined: 24 Jan 2010
Posts: 1860

PostPosted: Sun Jan 12, 2020 10:10 am    Post subject: openrc: netifrc -> newnet: failed Reply with quote

Just tried flipping netifrc & newnet @openrc without any change anywhere else.
Code:
ls /etc/init.d/net.br0  -la
lrwxrwxrwx 1 root root 18 avril  9  2019 /etc/init.d/net.br0 -> /etc/init.d/net.lo
Code:
cat /etc/conf.d/net
# Bridge setup
##############
 bridge_br0="enp1s0"
######################
config_br0="192.168.1.254 netmask 255.255.255.0"
routes_br0="default via 192.168.1.1"

 bridge_forward_delay_br0=0
 bridge_hello_time_br0=1000
Also using Networkmanager.
What's missing there?
Thks 4 ur attention.
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 15977

PostPosted: Sun Jan 12, 2020 4:49 pm    Post subject: Reply with quote

An error message or error description is missing. Your subject line says it failed. How did it fail? What happened that you did not expect, or failed to happen that you did expect?
Back to top
View user's profile Send private message
Ionen
Veteran
Veteran


Joined: 06 Dec 2018
Posts: 1251

PostPosted: Sun Jan 12, 2020 5:23 pm    Post subject: Reply with quote

Wait do you mean you've switched _from_ netifrc to newnet? But the configuration you're showing are for netifrc. newnet uses /etc/{init,conf}.d/network, and doesn't have those net.lo symlinks (well, you could set it up similarly if wanted). It's just a simplistic wrapper to ip/ifconfig/etc.. which does the job for me I might add, but both have their use cases.
Back to top
View user's profile Send private message
CaptainBlood
Veteran
Veteran


Joined: 24 Jan 2010
Posts: 1860

PostPosted: Sun Jan 12, 2020 7:59 pm    Post subject: Reply with quote

Yes, I'm showing how things where set when I tried to switch.
I had no /etc/{init,conf}.d/network.
Guess it's the part I was missing.

I was netless@reboot before flipping flags back.

Next time I will keep netirfc flag activated and remove the symlink to net.lo.

Thks 4 ur attention, interest & support.
Back to top
View user's profile Send private message
CaptainBlood
Veteran
Veteran


Joined: 24 Jan 2010
Posts: 1860

PostPosted: Mon Jan 13, 2020 2:02 am    Post subject: Reply with quote

Got everything fine,
Code:
defaultiproute="via 192.168.1.1"
ifconfig_enp1s0="192.168.1.254 netmask 255.255.255.0"
#ifup_enp1s0="ip link set \$int mtu 1500"
interfaces="br0"
ifup_br0="brctl addbr \$int; brctl addif \$int enp1s0"
ifdown_br0="ifconfig \$int down; brctl delbr \$int"
but DNS.
When doing the netirfc way, networkmanager takes over it, but not with newnet.

Any idea? Especially not requiring additional package? :lol:

Thks 4 ur attention, interest & support
Back to top
View user's profile Send private message
Ionen
Veteran
Veteran


Joined: 06 Dec 2018
Posts: 1251

PostPosted: Mon Jan 13, 2020 3:18 pm    Post subject: Reply with quote

All netifrc does is some printf nameserver ... > /etc/resolv.conf for you (or if you use it, dhcpcd does it)

In other words, just do it the normal way and have your own /etc/resolv.conf, with static settings there's certainly no need to rewrite a config file every boots :)

Edit: In case not already using one, would also take the occasion to recommend net-dns/dnsmasq for local DNS caching (it's tiny and will do its job without any configuration, can optionally serve as a simple DHCP server with just an extra command line option, I use that for VMs with tap devices), then you can have your resolv.conf like this:
Code:
nameserver 127.0.0.1
nameserver x.x.x.x # whichever normal DNS you use
nameserver x.x.x.x # fallback
#domain some.domain.if.wanted
dnsmasq will ignore 127.0.0.1 and resolve with x.x.x.x, and everything else will use 127.0.0.1 instead for some "dig gentoo.org" giving ";; Query time: 0 msec" response the 2nd time it gets used. You could also _only_ have 127.0.0.1 in there and pass the outside servers to dnsmasq directly, if okay with being reliant on it.
Back to top
View user's profile Send private message
CaptainBlood
Veteran
Veteran


Joined: 24 Jan 2010
Posts: 1860

PostPosted: Mon Jan 13, 2020 5:42 pm    Post subject: Reply with quote

Everything remains unchanged when flipping.
Code:
cat /etc/resolv.conf
# Generated by resolvconf
nameserver 208.67.222.222
nameserver 208.67.220.220
Doesn't seem taken into account, though.

Feeling quite cumbersome here, sorry.
Thks 4 ur attention, interest & support.
Back to top
View user's profile Send private message
Ionen
Veteran
Veteran


Joined: 06 Dec 2018
Posts: 1251

PostPosted: Mon Jan 13, 2020 5:52 pm    Post subject: Reply with quote

Oh right resolvconf, that's from openresolv I believe, requested by networkmanager if have resolvconf USE. I don't use either and can't really help much, netifrc normally calls it instead of printf if it exists. Maybe need to look at /etc/resolvconf.conf.

Edit: But if you have a static setup, I'd argue you don't need resolvconf. Many of those "automated" systems can be a burden, or worse, fight with other systems (netifrc/dhcpcd/networkmanager/systemd all kinda try to do everything at once and end up conflicting, netifrc does try to play nice with them, and newnet is more straight forward and sticks to the minimum to avoid conflicts in the first place)
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