Confusion on networking service start/stop in Ubuntu

Posted by Daniel Ball on Server Fault See other posts from Server Fault or by Daniel Ball
Published on 2011-07-19T20:42:19Z Indexed on 2012/06/15 21:18 UTC
Read the original article Hit count: 597

Filed under:
|

I'm preparing to move and took down two of my servers, leaving only one with some essential services running. What I neglected to consider was that one was the DHCP server(which I realized when somebody contacted me saying they couldn't connect. Whups). So because I only have a few hosts on this small network, I opted to just statically configure them for now. One of these is a new Ubuntu 11.04 server, where I have very little experience.

I edited /etc/network/interfaces and /etc/hosts to reflect my changes.

I ran

$sudo /etc/init.d/networking stop
 *deconfiguring network interfaces ...

So yay. Then I try to start, it gives me the mumbo jumbo about using services (why didn't it do that for the stop?) So instead I run ...

$sudo service networking start
networking stop/waiting

Now, to me that says the status of the service is stopped. But when I ping another computer, I get a successful reply. So is it not actually stopped? More importantly, am I doing something wrong?

Edit

daniel@FOOBAR:~$ sudo service networking status
networking stop/waiting

daniel@FOOBAR:~$ sudo service networking stop
stop: Unknown instance:

daniel@FOOBAR:~$ sudo service networking status
networking stop/waiting

daniel@FOOBAR:~$ sudo service networking start
networking stop/waiting

daniel@FOOBAR:~$ sudo service networking status
networking stop/waiting

So you can see why I ran /etc/init.d/networking stop instead. For some reason upstart (that is what "services" is, right?) isn't working with stop.

cat /etc/hosts

127.0.0.1       localhost
127.0.1.1       FOOBAR
198.3.9.2       FOOBAR #Added entry July 19 2011

# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters

cat /etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#auto eth0
#iface eth0 inet dhcp
#       hostname FOOBAR

auto eth0
iface eth0 inet static
        address 198.3.9.2
        netmask 255.255.255.0
        network 198.3.9.0
        broadcast 198.3.9.255
        gateway 198.3.9.15

No I didn't save backups, it was just a minor change so I just commented out the old DHCP setting.

Edit I set everything back to original settings and set up a DHCP server. "starting" networking does the same thing. I can only assume this is normal, I just don't know WHY. It can't be anything to do with the configuration files, since they've been restored.

© Server Fault or respective owner

Related posts about service

Related posts about ubuntu-11.04