You are not logged in.

#1 2009-08-26 14:09:16

XtrmGmr99
Member
Registered: 2009-04-14
Posts: 128

I borked my server... (can't get eth0 to connect to router)

Hello,

While trying to fix another problem, I inadvertently screwed up my entire server.

I went ahead an replaced my /etc/resolv.conf file to point to the OpenDNS servers; before, it was using my router as a nameserver (192.168.1.1), and the router then used the OpenDNS servers. Well, I restarted the server without thinking of the consequences (>.<), and now the networking on my server is useless...

I've tried to add my old nameserver (router) back to the resolv.conf file and run `/etc/rc.d/network restart`, only to have it hang for about a minute and finally fail, while also overwriting resolv.conf in the process to include nothing. I've also tried to restart the server (without restarting networking prior) with a new resolv.conf only to still have it fail.

I've tried creating a /etc/resolv.conf.head file, only to find that it seems to be useless.

I've tried multiple commands with `ifconfig` to try to bring my interface (eth0) to connect to the router, but it doesn't work.

My interface is supposed to get it's IP Address from the router via DHCP, however I have it set up to serve a static DHCP address via a MAC match, thus the server should always be 192.168.1.10. Currently, eth0 displays NO ip address (except a ipv6 ip address, which is useless for me...). Likewise, running `ping 192.186.1.1` it says (paraphrased) "No network connection", further supporting that eth0 doesn't even see the router...

I dunno what else to do. All I need it to do is connect to 192.168.1.1 to get it's IP Address via DHCP and it should be fine after that.

Any suggestions?

Offline

#2 2009-08-26 14:47:55

userlander
Member
Registered: 2008-08-23
Posts: 413

Re: I borked my server... (can't get eth0 to connect to router)

# dhcpcd eth0

Offline

#3 2009-08-26 16:23:04

XtrmGmr99
Member
Registered: 2009-04-14
Posts: 128

Re: I borked my server... (can't get eth0 to connect to router)

Tried it already. It said something about sending the command to the master process or something like that. I'm not physically at the server at the moment and I can't SSH in (obviously), so I can't say what the exact output is... <_<

Offline

#4 2009-08-26 16:49:45

neddie_seagoon
Member
Registered: 2009-08-23
Posts: 121

Re: I borked my server... (can't get eth0 to connect to router)

You can try to turn off dhcp services and try to set the IP manually:

ifconfig eth0 down
ifconfig eth0 192.168.1.10 netmask 255.255.255.0 up
route add default gw your.router.ip.address

Offline

#5 2009-08-26 17:09:53

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: I borked my server... (can't get eth0 to connect to router)

Changing DNS servers doesn't break networking - you're not using DNS on your internal subnet anyway, just IP addresses. Whenever you get to the server, check your logs for anything useful. If your router has logs, there might be something relevant there too.

To rule out a dhcp problem, reconfigure with a static address.

Offline

#6 2009-08-26 17:30:13

XtrmGmr99
Member
Registered: 2009-04-14
Posts: 128

Re: I borked my server... (can't get eth0 to connect to router)

neddie_seagoon wrote:

You can try to turn off dhcp services and try to set the IP manually:

ifconfig eth0 down
ifconfig eth0 192.168.1.10 netmask 255.255.255.0 up
route add default gw your.router.ip.address

woot! That works! Now how do I get it to do that automatically during start-up?

Offline

#7 2009-08-26 17:36:26

neddie_seagoon
Member
Registered: 2009-08-23
Posts: 121

Re: I borked my server... (can't get eth0 to connect to router)

Easiest would be to set it in your /etc/rc.conf:

HOSTNAME="yourhostname"
eth0="eth0 192.168.1.10 netmask 255.255.255.0 broadcast 192.168.1.255"
INTERFACES=(eth0)
gateway="default gw gw.ip"
ROUTES=(gateway)

Make sure to comment out any dhcp stuff in the networking section, and also prefix dhcp daemons with a ! in the DAEMONS array.

Offline

#8 2009-08-26 17:40:18

XtrmGmr99
Member
Registered: 2009-04-14
Posts: 128

Re: I borked my server... (can't get eth0 to connect to router)

Well, what I meant was how would I go about fixing the DHCP. =P

Offline

#9 2009-08-26 17:51:44

neddie_seagoon
Member
Registered: 2009-08-23
Posts: 121

Re: I borked my server... (can't get eth0 to connect to router)

XtrmGmr99 wrote:

Well, what I meant was how would I go about fixing the DHCP. =P

smile Haha, well in that case I am not 100% sure -- I don't use DHCP myself, but you could try switching dhcpcd for dhclient. Or stick to dhcpcd and try to gather info from log files as to why it's not properly getting an IP.

Offline

#10 2009-08-26 17:56:17

XtrmGmr99
Member
Registered: 2009-04-14
Posts: 128

Re: I borked my server... (can't get eth0 to connect to router)

Ugh. I hate log files. My log files are always in a disarray. Can anyone tell me which one specifically I need to look into.

I don't understand how DHCP could have broken. The only thing I changed was resolv.conf. I guess it won't hurt to go with the static method until I fix stuff or re-install Arch. smile dhcpcd keeps timing out when I try to use it.

Thanks for the help, btw.

Last edited by XtrmGmr99 (2009-08-26 18:03:05)

Offline

#11 2009-08-26 22:15:38

XtrmGmr99
Member
Registered: 2009-04-14
Posts: 128

Re: I borked my server... (can't get eth0 to connect to router)

Hmm... it seems that I can't get to any website from the server using the static IP. Every ping or web connection to a outside site returns a couldn't resolve host error. however, I can connect to the server via ssh and Apache works... =/

So, incoming works, outgoing doesn't... what the hell is going on? =3

Offline

#12 2009-08-27 02:03:46

neddie_seagoon
Member
Registered: 2009-08-23
Posts: 121

Re: I borked my server... (can't get eth0 to connect to router)

For logs, I would grep anything in /var/log for dhcp to see if you can find anything.

As for the no outgoing issue, maybe try the following:

Flush any iptables rules you may have.

dig @your.current.resolv.conf.nameserver google.com

If it returns a valid answer, then outgoing name resolution should work... if it doesn't try:
dig @208.67.222.222 google.com

If that works, do the whole resolv.conf switch until you have the dhcp issue figured out.

Offline

#13 2009-08-27 02:15:27

XtrmGmr99
Member
Registered: 2009-04-14
Posts: 128

Re: I borked my server... (can't get eth0 to connect to router)

I found the problem. The DHCP service on my router was turned off for some strange reason. I probably accidentally switched it when messing with my other problem... But now I can't seem to connect to my Samba shares... *sigh* Oh well, I'll figure it out.

Thanks to everyone who helped. smile

Last edited by XtrmGmr99 (2009-08-27 02:16:16)

Offline

#14 2009-08-27 04:22:10

tomd123
Developer
Registered: 2008-08-12
Posts: 565

Re: I borked my server... (can't get eth0 to connect to router)

General rule of thumb: if it doesn't work, check if it's turned on smile You don't know how many embarrassing moments I've had with related events.

Offline

#15 2009-08-27 04:42:22

XtrmGmr99
Member
Registered: 2009-04-14
Posts: 128

Re: I borked my server... (can't get eth0 to connect to router)

=P Thanks for that helpful advise xD

Offline

Board footer

Powered by FluxBB