LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-05-2009, 09:20 AM   #1
knobby67
Member
 
Registered: Mar 2006
Posts: 627

Rep: Reputation: 43
fixed IP for none root


Hi all,
I need to set up a static IP. So I went into /etc/networking/interfaces

and used

auto lo
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet dhcp

auto eth0
iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0


Worked a treat, however I've found when I run as non root (which I need to) I get no IP, ifconfig show no address. So root my interfaces works fine, as a user it doesn't can anyone advise. root runs and shows my address to be 192.168.1.1, user shows a large hex number. I can set manually by ifconfig, but need it from boot. Any advise? Thanks
 
Old 10-05-2009, 09:24 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
These config details are used before anyone logs in.

It makes no sense at all to relate this to which user you are at any given point.

Show us the output of ifconfig you're querying, but note that who you are has nothing whatsoever to do with your IP address.
 
Old 10-05-2009, 09:31 AM   #3
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
When using a static LAN IP I need a bit more than that in my interfaces file:
Code:
auto eth0
iface eth0 inet static
address 192.168.1.1
netmask 255.255.255.0
gateway IP.OF.MY.ROUTER
You'll probably also need to set your DNS:
Code:
tred@vaio:~$ cat /etc/resolv.conf
nameserver IP.OF.MY.ROUTER
tred@vaio:~$
Then restart networking.
 
  


Reply



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
Bug in 8.04, fixed in 8.10 - How to get fixed in 8.04 which is LTS? taylorkh Ubuntu 4 02-28-2009 05:17 PM
udev is fixed now dhave Slackware 14 03-10-2005 08:22 AM
2.6.9 and cdrtools, is it fixed? stelmed Slackware 7 11-05-2004 09:59 AM
root files: create as root:root or root:wheel? pcass Linux - Security 1 02-07-2004 04:14 PM
got it fixed thunderrooster Linux - General 0 12-13-2001 08:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:53 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration