Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Problem with changing IP
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
slycordinator
Advocate
Advocate


Joined: 31 Jan 2004
Posts: 3065
Location: Korea

PostPosted: Fri Jun 25, 2004 5:45 am    Post subject: Problem with changing IP Reply with quote

My IP address given by our router doesn't always seem to be the same. So today when I booted gentoo, it wouldn't boot because my IP was 192.168.0.3 whereas the line in /etc/hosts was:
192.168.0.2 tux tux.homenetwork

So if my IP changes how am I supposed to be able to boot given that I set up /etc/hosts manually for the old IP?
Back to top
View user's profile Send private message
Lawless
l33t
l33t


Joined: 03 Nov 2003
Posts: 638
Location: Germany

PostPosted: Fri Jun 25, 2004 5:59 am    Post subject: Reply with quote

So your router is using dhcp?
Most routers can be changed to fixed IPs - so go to your router configuration and deactivate dhcp - then set your local lan ip to a fixed number.
If you want to stick to dhcp then you can simply delete this line from your /etc/hosts just leaving the "127.0.0.1 localhost"
_________________
Kernel panic: I have no root and I want to scream
Back to top
View user's profile Send private message
barlad
l33t
l33t


Joined: 22 Feb 2003
Posts: 673

PostPosted: Fri Jun 25, 2004 1:56 pm    Post subject: Reply with quote

Indeed, you have to choose whether or not you want a fixed IP. If you do not care about the fixed IP then you can just add an alias to 127.0.0.1 and drop the line that reads "192.168.0.2 ..."
Your new line would be this:
Quote:

127.0.0.1 localhost tux
Back to top
View user's profile Send private message
tazsimon
n00b
n00b


Joined: 03 Dec 2002
Posts: 12

PostPosted: Fri Jun 25, 2004 3:51 pm    Post subject: Reply with quote

is it possible to just write up a script to change your hostname and ip in your /etc/host by sed and then add it into your net.eth0 at /etc/init.d/ so that every time when it starts it would update your /etc/host.

I've written similar script before but just to add hosts for other remote machines which were dynamically connect for my own convience. Then I've putted this script as a cron job so that instead of checking its' ip all of the time I can connect it just by different names. Just my 2 cents.
Back to top
View user's profile Send private message
slycordinator
Advocate
Advocate


Joined: 31 Jan 2004
Posts: 3065
Location: Korea

PostPosted: Sat Jun 26, 2004 2:47 am    Post subject: Reply with quote

barlad wrote:
Indeed, you have to choose whether or not you want a fixed IP. If you do not care about the fixed IP then you can just add an alias to 127.0.0.1 and drop the line that reads "192.168.0.2 ..."
Your new line would be this:
Quote:

127.0.0.1 localhost tux


Problem with this is that gnome doesn't work correctly in this situation. When you log on in this case, it says "Gnome cannot find the address for tux [my computer's name]." The rest of the message indicates that gnome won't work correctly in this case.
Back to top
View user's profile Send private message
mahir
l33t
l33t


Joined: 05 Dec 2003
Posts: 725
Location: London

PostPosted: Sat Jun 26, 2004 3:03 am    Post subject: mm Reply with quote

when i used to use windows
i'd put all the ad sites in my hosts file, and set it to 127.0.0.1 so whenever the broswer/system tried to retreive an ad, it would look at 127.0.0.1 - and since there isnt anything there i had no ads :)

try the same.

rather then doing
[code]
127.0.0.1 localhost tux
[code]
which gives you the gnome-host error thing
try this
[code]
127.0.0.1 localhost
127.0.0.1 tux (or whatever name u want)
[/code]

tell us if this works..
enjoy.gentoo
_________________
"wa ma tawfiqi illah billah"
Mahir Sayar
Back to top
View user's profile Send private message
slycordinator
Advocate
Advocate


Joined: 31 Jan 2004
Posts: 3065
Location: Korea

PostPosted: Tue Jun 29, 2004 2:33 am    Post subject: Reply with quote

Well, I did actually make a startup script that would fix the file. Problem was I kept on powering down manually since it would freeze on logon for gnome, so it would no longer boot quite right.

So I started over and did a stage1 install (wasn't worried about trashing the disk; it's a new system so nothing important was on there). Now I'm using KDE and there's no problem like before as it doesn't use the /etc/hosts file.

Though I had tried using gnome at first when I did the new install but pygtk wouldn't compile (kept on looking for libGL.la in the default directory instead of the directory it's in if you do "opengl-update nvidia").
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum