LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   editing /etc/network/int... for static IP. have to manually restart eth0 to work? (http://www.linuxquestions.org/questions/linux-newbie-8/editing-etc-network-int-for-static-ip-have-to-manually-restart-eth0-to-work-4175452269/)

jddancks 03-01-2013 12:03 PM

editing /etc/network/int... for static IP. have to manually restart eth0 to work?
 
so I edited /etc/network/interfaces like so:

Quote:

# 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
#allow-hotplug eth0
#iface eth0 inet dhcp

auth eth0
iface eth0 inet static
address 192.168.1.105
network 192.168.0.0
netmask 255.255.255.0
gateway 192.168.1.1
When I tried it it seemed to work when I shut down and restarted the interface. Problem is when my machine starts up I have to go over, log in as root and I do ifdown eth0, ifup eth0 to get it to work. It won't set up correctly upon startup. This isn't good as I prefer to ssh into the machine as I'm not always home.

Kustom42 03-01-2013 12:10 PM

What is happening with the interface before you restart it? Have you looked at whether the IP is even being assigned by the system?

suicidaleggroll 03-01-2013 01:07 PM

It sounds like your network might be currently managed by something like NetworkManager, which doesn't use the /etc/network/interfaces config file. You might be able to go into the system settings to switch it to the "legacy" network management, which would then use your config with ifup and ifdown like you expect. Otherwise, you edited it in the wrong place and instead need to look into what your distro is currently uses for network management and set up the static ip there.

goumba 03-01-2013 01:18 PM

If it turns out the interface is being managed by NetworkManager, Changed the line "managed=true" for the interface if it exists to "managed=false" in /etc/NetworkManager/NetworkManager.conf.

tredegar 03-01-2013 01:20 PM

Please try checking / editing your interfaces file here:
Code:

# 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
#allow-hotplug eth0
#iface eth0 inet dhcp

auto eth0
iface eth0 inet static
address 192.168.1.105
network 192.168.0.0
netmask 255.255.255.0
gateway 192.168.1.1

It looks like you have a typo.

jddancks 03-02-2013 01:11 PM

Last guy got it. Thanks


All times are GMT -5. The time now is 10:30 PM.