Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
    
Okay, so we've established that I know nothing about Ubuntu configuration. ^_^ Let's try this on for size: What's your /etc/network/interfaces look like? –  Josh Blair Jul 20 '11 at 14:26
    
I'm pretty sure rc.conf is arch specific. I'm fairly certain hosts, interfaces, and resolv.conf are the only files I should be concerned with, unless this is an issue with upstart. There's an rc.local ... –  Daniel Ball Jul 20 '11 at 15:00
    
Edit you post with the information of these commands, in this order : 1 - service networking status 2 - service networking stop 3 - service networking status 4 - service networking start 5 -service networking status –  Anarko_Bizounours Jul 20 '11 at 15:27
    
btw, if you want to stop and start again your service, try running service networking restart. And you said that you edited your /etc/network/interfaces and /etc/hosts, can you show them? (did you made a backup for these before changing them?) –  Anarko_Bizounours Jul 20 '11 at 15:27
    
Yeah, I tried service networking restart first, it returned "restart: Unknown instance:" I'll post the rest in a sec. –  Daniel Ball Jul 20 '11 at 19:41

2 Answers 2

Use /sbin/ifconfig to see what your current networking state is.

Use /sbin/ifup <name> to bring up an interface defined in /etc/network/interfaces. Likewise use /sbin/ifdown <name> to bring the interface down.


If the actual state of the interface is different from that of ifconfig do the following:

DO NOT DO THIS OVER THE NETWORK. DO THIS FROM THE CONSOLE. IF YOU LOSE ACCESS TO YOUR BOX YOUR BLOOD IS ON YOUR OWN HEAD.

  1. Clear the entry from /etc/network/run/ifstate.
  2. For each IP on that interface run /sbin/ip addr del 1.2.3.4/24 dev eth0 (obviously using the appropriate IP & interface name).
  3. For the interface itself run /sbin/ip link set eth0 down (again, using the appropriate interface name).

After this is done you should be able to cleanly use /sbin/ifup <name> to bring the interface up.

share|improve this answer

try

sudo service network-interface restart INTERFACE=eth0

edit the command to use your interface instead of eth0 if necessary.

(I've checked mine with ifconfig, but mine is up.)

source: http://ubuntuforums.org/showthread.php?t=1706192

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.