View previous topic :: View next topic |
Author |
Message |
slycordinator Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/4334262804b30599e9bb30.jpg)
Joined: 31 Jan 2004 Posts: 3065 Location: Korea
|
Posted: Fri Jun 25, 2004 5:45 am Post subject: Problem with changing IP |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Lawless l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
Joined: 03 Nov 2003 Posts: 638 Location: Germany
|
Posted: Fri Jun 25, 2004 5:59 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
barlad l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/135629013340bb28ae939e4.jpg)
Joined: 22 Feb 2003 Posts: 673
|
Posted: Fri Jun 25, 2004 1:56 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
tazsimon n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 03 Dec 2002 Posts: 12
|
Posted: Fri Jun 25, 2004 3:51 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
slycordinator Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/4334262804b30599e9bb30.jpg)
Joined: 31 Jan 2004 Posts: 3065 Location: Korea
|
Posted: Sat Jun 26, 2004 2:47 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
mahir l33t
![l33t l33t](/images/ranks/rank_rect_4.gif)
![](images/avatars/193723190942986078c076c.jpg)
Joined: 05 Dec 2003 Posts: 725 Location: London
|
Posted: Sat Jun 26, 2004 3:03 am Post subject: mm |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
slycordinator Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/4334262804b30599e9bb30.jpg)
Joined: 31 Jan 2004 Posts: 3065 Location: Korea
|
Posted: Tue Jun 29, 2004 2:33 am Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
|