# [solved] /etc/conf.d/net question

## dab_s_bad

my apologies for such bad title for a topic.

what I'm having problems is that on /etc/conf.d/net I specify something like:

config_eth0="null"

but after I save the file and reboot, eth0 still has/have a designated and valid IP address.

how can I remove auto addressing eth0 if the above cant control it?

the reason why I want eth0 to have no IP address is that I have added it to my OVS bridge.

if I remove the IP address of eth0, the IP address will go automatically to the bridge and it is the right behaviour.

care to share some insights?

thanks in advance.Last edited by dab_s_bad on Sun Jan 10, 2016 7:49 pm; edited 1 time in total

----------

## NeddySeagoon

dab_s_bad,

It works for me.  

```
# eth interfaces for firewall

# we don't want them getting IP addresses

# as they are being donated to bridges

config_eth0="null"

config_eth1="null"

config_eth2="null"

config_eth3="null"

config_eth4="null"

# the DMZ

bridge_br1="eth2"

config_br1="192.168.10.254/24"
```

Do you really have a eth0 or is it being renamed by udev?

```
dmesg | grep renamed
```

----------

## dab_s_bad

hello and good day Neddy!,

my problem seems too trivial  :Sad: , tried your approach with null/noop but still the same.

I ran:

```
dmesg | grep -i renamed
```

and it returned nothing

anyways, I tried also with: config_eth0="0.0.0.0" and it works but it will get apipa address [connection works but have junk display like 169...  for eth0]

edit:

got dozens of nics here for a particular machine..., and yes..., I can vouch I have eth0 to eth5 and they are not renamed as per dmesg suggests...

----------

## NeddySeagoon

dab_s_bad,

How do you start networking?

I had my netbook in a mess the other day and discovered that netmount brings up all the interfaces when it starts.

The netbook has dhcpcd installed too, so everything was getting an IP address all the time.

I was wanting manual control of interfaces for debugging VPN.

Anyway, removing netmount from the default runlevel restored normality.

I rarely use NFS on the netbook, so it works for me.

If you have /etc/init.d/net.* symlinks, remove them for interfaces that you want to configure with ="null"

You should have  /etc/init.d/net.br0 and friends.

```
$ ls /etc/init.d/net*

/etc/init.d/net.br0  /etc/init.d/net.br2  /etc/init.d/net.eth0  /etc/init.d/net.ppp0

/etc/init.d/net.br1  /etc/init.d/net.br3  /etc/init.d/net.lo 
```

Hmm ... I don't need net.eth0 there.  It must be a leftover.

That box does not have any automatics installed.  Its the bare metal host for my KVMs

----------

## dab_s_bad

Neddy,

I'll try to elaborate what I'm doing with this particular system.

I have an Intel XEON E5520 with an Intel DX58SO mobo and with a couple of intel nics (1x dual pci nic, 3x single pci-e nics)

currently, its with gentoo with this system, and wanting this to be a KVM host.

from my standpoint, its better for the host server to have static IP address which it does btw.

some VM's will be static also and others will be dhcp, should I 'remove' dhcpcd from the host server? is it safe to do so?

and a thing to note, I just followed out gentoo's installation, and the system indeed also has dhcpcd installed and started

what my /etc/conf.d/net looks like ATM:

```
dns_domain_lo="ddomain"

config_eth0="0.0.0.0"

config_eth1="0.0.0.0"

config_eth3="0.0.0.0"

config_eth2="192.168.1.155 netmask 255.255.255.0 brd 192.168.1.255"

routes_eth2="default via 192.168.1.1"
```

I also have link like: /etc/init.d/net.eth2

other note: majority of these nics might be associated with OVS via bridge or bond

----------

## NeddySeagoon

dab_s_bad,

There is no need to start dhcpcd.  If its called from the net file it will be used.

If you start it, I think it tries to run on all detected interfaces, which is not what you want.

On the bare metal host, you might not even want an IP on all the bridges.

My KVM host is a HP Microserver with an Intel 4 port NIC.  I don't use the on board NIC.

Everything is static and dhcpcd is not installed. 

```
$ emerge -pv dhcpcd

 * Last emerge --sync was 57d 14h 8m 52s ago.

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild  N     ] net-misc/dhcpcd-6.9.3::gentoo  USE="embedded ipv6 udev" 173 KiB
```

Beware of busybox, that provides dhcpcd too.

Its harmless to have dhcpcd installed and not running.

Stop netmount too.

The link local IPv6 addresses everywhere are something you get for free for having IPv6 in the kernel.

I do have native IPv6 and its configured on two of the interfaces.

My net file is at http://codepad.org/QHHhjaH1 and ifconfig -a at http://codepad.org/kKK0GvaU

I did make a half hearted attempt to remove public IPs.

----------

## dab_s_bad

many thanks!,

anyways, further question(s)

I have netmount removed from default run level.

but..., when I try to stop the dhcpcd service, it also stops libvirtd of which makes sense since its default virbr0 uses dhcp also.

edit:

edited /etc/conf.d/libvirtd and I can disable dhcpcd without affecting libvirtd with this.

however, even with my static entries for my eth2 in /etc/conf.d/net, it does not show in ifconfig -a, and no internet/network access... weird  :Sad: 

----------

## NeddySeagoon

dab_s_bad,

I don't have a virbr0 and my libvirtd seems quite happy.

On the bare metal, my nics are donated to bridges and the bridges all have an IP.

They don't need to have an IP unless the bare metal system meeds to talk to that subnet.

My router is in a KVM.

On the bare metal, IPs are assigned to the bridges statically. See my net file.

On the KVMs the network sources are set to the bridges and the driver virtio is used.  There is no point in using hardware emulation unless you are installing something that does not understand virtio.

Come to think of it, all my KVMs have statically assigned IPv4 addresses.  One is faked, in that dhcpd assigns it an IP based on its MAC address.

Then, the KVMs are all servers of one sort or another ...

Router, Mail, MediaServer and a development system.  They are all headless and normally administered via ssh, so IP addresses that changed would not be very useful.

-- edit --

dhcpd used to fill in /etc/resolv.conf for you.  It will be blank now.

----------

## dab_s_bad

many thanks sir,

off topic question. since what I'm doing is I believe is almost similar to your system...

I'll assume these things as for my understanding.

--you have a router as a vm

--the router vm is using eth1 connected/binded to br0

--the hardware physical modem is configured as bridge (aka dumb modem)

--router vm is using pppoe connection

am still testing my internal vm(router) via dhcp and later will change it to pppoe settings.

my modem is in bridge mode already and will be replacing my pfsense physical atom box to a virtual one.

will your config work with mine as well? if I configure it to use pppoe?

is your bridge a linux bridge or an openvswitch bridge?

```
# when we use the Zyxel Router

# the big bad internet - we may not need an IP here as all trafic goes to the router.

bridge_br0="eth1"

# this is meaninless when we use ppp0 in the router

# as we get pppoe packets here and all we can do is pass them on to ppp0 in the router.

config_br0="<public>/29"

##routes_br0="default via <public>"

#for ppp0 - fake IP 

#config_br0="1.1.1.1"
```

----------

## NeddySeagoon

dab_s_bad,

BT who run the UK Telecoms infrastructure provide a box that I am supposed to use that is the interface between the VDSL on the phone wire and a PPPoE endpoint.  For me, the PPPoE end point is in my KVM router.

I also have a router that connects to the phone line, provides the PPPoE end point and gives me four normal ethernet ports.  I can use one of those as my internet link from my KVM router in place of PPPoE.

Its some configuration settings is the router. The Internet moves between ppp0 and eth1?  I forget the number.

Change where my public IP is allocated.  With PPPoE it goes to ppp0, with the router, it gets the public IP but I have a /29, so I need to use another IP from my /29 on the internet interface on the KVM.

The router KVM runs shorewall, so there are some settings changes there too.  Both ways work.

All the bridges are Linux bridges.

 *Quote:*   

> --you have a router as a vm 

 

Yes

 *Quote:*   

> -router vm is using pppoe connection 

 

Yes

 *Quote:*   

> --the hardware physical modem is configured as bridge (aka dumb modem) 

 

It doesn't have a user interface at all.  Its VDSL in PPPoE out.

 *Quote:*   

> --the router vm is using eth1 connected/binded to br0 

 

eth2 in the router, MACAddr 52:54:00:ad:25:ea is bound to br0.

That does not have an IPv4 address, so it must be the interface used for ppp0

----------

## dab_s_bad

thanks for this!

back to topic..., removing dhcp service was one way to get what I needed.

--edit:

how to update with 'solve'???

----------

## NeddySeagoon

dab_s_bad,

Edit the title in the first post of the thread.  You can do that, its your post.

----------

## dab_s_bad

ok, just edited, thanks!

will ask another question in regards to pppoe on another thread

----------

