LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 03-01-2013, 11:03 AM   #1
jddancks
LQ Newbie
 
Registered: Jan 2013
Location: Central NY
Distribution: Mac, debian
Posts: 21

Rep: Reputation: Disabled
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.
 
Old 03-01-2013, 11:10 AM   #2
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,565

Rep: Reputation: 410Reputation: 410Reputation: 410Reputation: 410Reputation: 410
What is happening with the interface before you restart it? Have you looked at whether the IP is even being assigned by the system?
 
Old 03-01-2013, 12:07 PM   #3
suicidaleggroll
Senior Member
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 2,657

Rep: Reputation: 951Reputation: 951Reputation: 951Reputation: 951Reputation: 951Reputation: 951Reputation: 951Reputation: 951
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.
 
Old 03-01-2013, 12:18 PM   #4
goumba
Member
 
Registered: Dec 2009
Location: New Jersey, USA
Distribution: Debian Wheezy (7.0), Jessie (future 8) and Sid (unstable)
Posts: 513
Blog Entries: 2

Rep: Reputation: 55
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.
 
Old 03-01-2013, 12:20 PM   #5
tredegar
Guru
 
Registered: May 2003
Location: London, UK
Distribution: Ubuntu 10.04, mostly
Posts: 6,007

Rep: Reputation: 366Reputation: 366Reputation: 366Reputation: 366
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.
 
1 members found this post helpful.
Old 03-02-2013, 12:11 PM   #6
jddancks
LQ Newbie
 
Registered: Jan 2013
Location: Central NY
Distribution: Mac, debian
Posts: 21

Original Poster
Rep: Reputation: Disabled
Last guy got it. Thanks
 
  


Reply

Tags
eth0, network


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
eth0 does not work after shutdown/start, but works when restart sT331h0rs3 Linux - Networking 2 09-14-2010 12:35 AM
Production server with static IPs on eth0 and eth0:1 - need private LAN on eth1 stardotstar Linux - Networking 8 07-03-2010 12:27 AM
Have to manually restart /etc/init.d/network after pm-suspend GamerX Fedora 2 10-18-2008 10:55 PM
Routing for eth0 and wlan0 with static IPs on the same network. kelvinlo Linux - Wireless Networking 3 10-15-2007 04:54 PM
How come I have to restart my computer for network changes to work? lowpro2k3 Slackware 3 10-17-2005 10:33 AM


All times are GMT -5. The time now is 06:07 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration