fix ip adress in linux?
#1
How do I fix my ip-adress in Linux? I need it for Winscp and XBMCremote, now it keeps changing.

I installed Ubuntu with this script: http://forum.xbmc.org/showthread.php?tid=55282 and then followed those steps to install XBMC. Within XBMC I can't select fixed ip (as in the old xbox days) so I guess it has to be done through linux. I searched the forums for fix(ed) ip adress but couldnt find anyting.

Running Asrock 330.
Reply
#2
I don't know where you searched...
this is linux stuff, so you'd find 1000s of howtos with google. Anyways, there's a file in ubuntu: /etc/network/interfaces

There are the entries regarding your network...you guessed it! interfaces.
You need an entry like
auto eth0
iface eth0 inet static
address 192.168.1.11
netmask 255.255.255.0
gateway 192.168.1.1


that's it.
let the other stuff there be, specially "lo".

then with
sudo invoke-rc.d networking restart
you load the new config, and test it with
ifconfig.

this should get you going, but there's still dns to configure. That's a bit more complicated, so for now I stop and let's see if it helps. Nerd
Reply
#3
Thanks. I found this description through google and got quite fare before I posted here:

http://www.ubuntugeek.com/change-ubuntu-...dress.html

I didnt know what network and broadcast stand for - so couldnt fill that in. I guess network shows my ip range (hence the 0 at the end) and from your post I see I don't need broadcast. So I skipped both

Also I didnt know how to exit vi and save. As I was scared to mess up I already rebooted once, which now gave me a swap file (guess vi saved my last edit). Anyway I got it working now with your help.

Do I now need to do soemthing with DNS?
Reply
#4
good you solved things for this first step!
an ip network has values from 0 to 255, but the first and the last value of a network (like 0 and 255 are in a class c network) are reserved: 0 is reserved for the network itself, 255 for the broadcast address. But a computer knows, so you don't have to tell him Rolleyes unless you use some weird netmask...so usually you need just the 3 entries above (address=ip address, netmask, gateway).

if you started to use vi, I'd suggest installing and using the advanced/enhanced version which is called vim.

The file for dns entries is /etc/resolv.conf.
entries are rows with "nameserver ip-address" in it. Max. 3 if I remember right...
problem could be: entries are removed/reset on restart.

so:
1) try a nslookup www.xbmc.org which tests your dns capabilities. if that works and never gives problems, you're done
2) otherwise try adding a row to resolv.conf
3) if that is removed after restart, look for a file /etc/dhcp3/dhclient.conf where there are options to let resolv.conf unchanged on start...but google for that at this point.
Reply

Logout Mark Read Team Forum Stats Members Help
fix ip adress in linux?0