Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cant Statically set an IP & Resolv.conf is gone after reboot
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
Chickenbro
n00b
n00b


Joined: 03 Apr 2013
Posts: 4
Location: Herkimer

PostPosted: Wed Apr 03, 2013 9:39 pm    Post subject: Cant Statically set an IP & Resolv.conf is gone after re Reply with quote

I've been having this problem with this on my Gentoo for a week and yet idk what to do. Im setting up my Gentoo box for a class for college. My machine is suppose to get an IP address of 192.168.1.37 and its getting 169.245.245.206.
My resolve.conf is suppose to be nameserver 192.168.1.20 but after a reboot it keeps erasing it.
my /etc/init.d/net is...
dns_domain_eth0="homenetwork"
config_eth0="192.168.1.37 netmask 255.255.255.0 brd 192.168.1.255"
routes_eth0="default via 192.168.1.1"
dns_servers_eth0="192.168.1.20"

Can anyone help me? My instructor told me I should know why I have that IP and I should know how to change it but I've been trying to change it but failed. hes not really helping me out on this.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 33926
Location: 56N 3W

PostPosted: Wed Apr 03, 2013 9:48 pm    Post subject: Reply with quote

Chickenbro,

Welcome to Gentoo.

Your instructor is asking the right questions.

169.245.245.206 is an address in the link local range. dhcpcd can be made to make up an IP address in this range when it cannot get an IP address either statically or from a dhcp server (your router). Link local addresses are only useful for a group of isolated computers, such as an ad-hoc wireless network. They are not routable.

A static configuration, such as your net file provides for eth0 should work.
However, it might not be called and eth0 is being started somehow else.

What does
Code:
rc-update -v show
produce?
Code:
net.eth0 |      default
should be in the output somewhere.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 6936
Location: Goose Creek SC

PostPosted: Wed Apr 03, 2013 9:53 pm    Post subject: Reply with quote

dns_domain_eth0="homenetwork" causes an overwrite of /etc/resolv.conf where resolv does not have an e on the end. remove dns_domain_eth0="homenetwork" from /etc/conf.d/net.
run
Code:
 ifconfig -a
ifconfig
both should show eth0 if the device exists and has a driver (-a) and if the device exists and has a driver and has been started (no -a).
there is a possibility that your first ethernet NIC has been given a uinique name instead of eth0
_________________
Defund the FCC.


Last edited by DONAHUE on Wed Apr 03, 2013 10:05 pm; edited 1 time in total
Back to top
View user's profile Send private message
Chickenbro
n00b
n00b


Joined: 03 Apr 2013
Posts: 4
Location: Herkimer

PostPosted: Wed Apr 03, 2013 9:59 pm    Post subject: Reply with quote

I used rc-update -v show | less to look at all and I see a net.lo but no net.eth0. I tried to do as much as everyone else in my class had in their files but I probably did something different and yet did not know what I did wrong.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 33926
Location: 56N 3W

PostPosted: Wed Apr 03, 2013 10:09 pm    Post subject: Reply with quote

Chickenbro,

What interfaces does
Code:
ifconfig -a
show?

If eth0 is listed, check that you have a symlink called /etc/init.d/net.eth0 that points to net.lo
Make the simlink if you need to.
Now add net.eth0 to your default runlevel, so its started every boot.

Lastly, run
Code:
/etc/init.d/net.eth0 start
to attempt to start eth0.

I suspect you have other problems, as you have dhcpcd, and it gave you a link local address. It only does this if it cannot contact a dhcp server.
If you have several wired network interfaces, your network cable may not be connected to the one that is now eth0.

As DONAHUE says - you might not even have an eth0
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Chickenbro
n00b
n00b


Joined: 03 Apr 2013
Posts: 4
Location: Herkimer

PostPosted: Wed Apr 03, 2013 10:27 pm    Post subject: Reply with quote

I found out I didnt use the rc-update add net.eth0. after doing that I have my static IP. Now I have to get access from another machine. That's my only problem now to work on my website. thanks for all your guys help and if you can help me with this, I would really appreciate it!
I now have it that when I ping my default gateway and my DNS to be unreachable then not able to reach it when I ping.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 33926
Location: 56N 3W

PostPosted: Wed Apr 03, 2013 10:47 pm    Post subject: Reply with quote

Chickenbro,

You should start sshd on your Gentoo.

Add sshd to the default runlevel
Start it with
Code:
/etc/init.d/sshd start
This may take minutes as it has to make keys on the first start. Move the mouse and press random keys while it starts. This suppies 'randomness' to the random number generator. Its required to make sure you get good keys.

With sshd running, you can ssh into Gentoo.

On another system on the network, run
Code:
ssh root@192.168.1.37
to connect to your Gentoo.
Give the root password at the challenge.

Its a very bad thing to allow connections like this as root but thats another topic. Do not permit it on a system accessable from the internet.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Chickenbro
n00b
n00b


Joined: 03 Apr 2013
Posts: 4
Location: Herkimer

PostPosted: Wed Apr 03, 2013 10:54 pm    Post subject: Reply with quote

I already have sshd started. I know I got that started a while back when I was doing the IP set but when I ping those 2 addresses says Destination Host Unreachable. I have a classmate who he assigned us the IP addresses that was giving by my instructor and I might ask him what I need help with tomorrow during class when we develop more in class.
Back to top
View user's profile Send private message
solamour
Guru
Guru


Joined: 21 Dec 2004
Posts: 522
Location: San Diego, CA

PostPosted: Thu Apr 04, 2013 12:00 am    Post subject: Reply with quote

Colleges have a class that teaches you how to setup Gentoo? How cool is that? It should be a mandatory class for all engineering students. Seriously.
__
sol
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 6936
Location: Goose Creek SC

PostPosted: Thu Apr 04, 2013 12:12 am    Post subject: Reply with quote

can you ping the router?
Code:
ping -c2 192.168.1.1

_________________
Defund the FCC.
Back to top
View user's profile Send private message
krinn
Advocate
Advocate


Joined: 02 May 2003
Posts: 4883

PostPosted: Thu Apr 04, 2013 1:04 am    Post subject: Reply with quote

solamour wrote:
Colleges have a class that teaches you how to setup Gentoo?

I'm not sure about the "teaching" seeing how the instructor behave :)
Or is another "sleepy student" that cheat with gentoo forum to make his work ?
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