# openrc: netifrc -> newnet: failed

## CaptainBlood

Just tried flipping netifrc & newnet @openrc without  any change anywhere else.

```
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
```

```
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.

----------

## Hu

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?

----------

## Ionen

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.

----------

## CaptainBlood

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.

----------

## CaptainBlood

Got everything fine,

```
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?  :Laughing: 

Thks 4 ur attention, interest & support

----------

## Ionen

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  :Smile: 

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:

```
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.

----------

## CaptainBlood

Everything remains unchanged when flipping.

```
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.

----------

## Ionen

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)

----------

