# What's the purpose of the net.lo vs net.eth0 script??

## drvik

Let me elaborate....

I'm trying to understand the relative functions of net.lo vs net.eth0 (as an example)...

My understanding is that net.lo provides the local loopback network (127.0.0.1) for other scripts such as mysql, which may only need a local loopback device rather than a "real" network connection... it provides "net" to the other scripts that have this dependency...

Net.eth0 also provides "net" to the other scripts by bringing up a "real" network connection...

Therefore, if I stop net.eth0, any scripts that depend on "net" should continue to run, even though they no longer have access to a "real" network connection...

If I stop net.eth0, why does /etc/init.d/mythbackend also stop when I am connecting to a local mysql server and may not have any remote frontends??  This means if for some reason my network service is stopped, then mythbackend will no longer be able to record...

NUT scripts including upsdrv, upsd, and upsmon (I'm using a USB UPS), also rely on "net" even if you are monitoring a local USB UPS... so if my net.eth0 is stopped I no longer have the ability to shutdown the system automatically if there's a power failure and my UPS is running low...

If I delete net.eth0, why does the ntpd script start but the ntp-client script does not?  Why doesn't mysql start (this is probably why mythbackend doesn't start)??

Why does mysql depend on netmount and nfsmount and therefore on a "real" net connection?? isn't it enough to just depend on "net"?

Why does nxserver only depend on "net" and therefore will start up when only net.lo is available, therefore being pointless (no real network access)??

"netmount" depends on "net" but "net.eth0" is shutdown before "netmount"

Am I just showing a really poor understanding of how these dependencies are supposed to work or is there some kind of problem here???  Shouldn't essentially everything that depends on "net" start, as long as I have successfully started net.lo???  And therefore, shouldn't everything that depends on net, also remain running even if I stop the net.eth0 service as long as net.lo continues to run???  Are these just limitations of the current init system design?  Script errors?  Is this what "SystemD" is trying to address??

Apologies for my rambling and lack of understanding...

drvik

----------

## jormartr

net.lo does not provide network, but net.eth0 does.

For example, I have some tap's and bridges in my network, and I define them with:

```

...

rc_provide_tap0="!net"

...

rc_provide_br0="!net"

...

```

that way, scripts that depend on "network" know that these interfaces does not provide networking to them. Only net.eth0 provides external networking on my computer.

This way, I guess that the loopback interface is internally defined with not providing network.

I hope I may explained it somewhat.

----------

## NeddySeagoon

drvik,

The network service is only considered to be available when all network interfaces are up, by defualt.

If you don't want this behaviour, you need to edit /etc/rc.conf 

Its well commented.

Laptop users often have other wlan0 and eth0 defined but want either on its own to provide networking.

----------

## MickKi

Can someone please confirm if net.lo should be enabled by default?  On two of my boxen it isn't:

```
# rc-update -s -v | grep net.lo

               net.lo |         
```

----------

## NeddySeagoon

MickKi,

Maybe.

It will be started by other things that depend on it even if its not started explictily.

Here, its 

```
net.lo | boot
```

----------

