switching from dhcp to static lost internet
im using fedora 3 with a nic and a cable modem. I can ping the IP from both the box and from another box. the ip shows behind the modem on the network.
dhcp worked but when i switched to a static ip/gateway I lost the internet. I also had edited my host.conf file - if anyone has a sugguestion for what's in that file please. Code:
[root@br ~]# ifconfig eth0 when i ping a host: [root@br ~]# ping www.yahoo.com ping: unknown host www.yahoo.com when i ping an ip: it freezes and i have to ctrl c to get it to unfreeze. [root@br ~]# ping xx.xxx.xxx.xxx PING xx.xxx.xxx.xxx (xx.xxx.xxx.xxx) 56(84) bytes of data. --- xx.xxx.xxx.xxx ping statistics --- 7 packets transmitted, 0 received, 100% packet loss, time 5999ms any help is appreciated :) |
I suggest you stop packeting yourself and add your gateway to your ipsettings and DNS to your /etc/resolv.conf.
|
examples? im not to familiar with those files thx!!!
|
/etc/resolv.conf
nameserver xxx.xxx.xxx.xxx(ip of your DNS aka router IP) Gateway is is the router IP as well(the route out). You configure that in the same place you configure your static IP(control panel?) |
i was hoping to get exactly what goes into the host.conf and the resolv.conf as im away from the machine so i have to use the vi and the consol.
could you provide an actual example doesnt have to be real #'s. thx again. |
That was an actual eample. /etc/hosts has nothing to do with it. I think you should hire a $150/hr consultant to help you.
|
if you check your /etc/resolv.conf file you'll see it's just a list of nameservers. should be something like
nameserver 4.7.8.38 nameserver 192.168.1.1 your router probably acts as a caching nameserver, so you can put it in there if you want. otherwise, use your ISP's nameserver. note that if you use dhcp (and maybe sometimes if you don't) resolv.conf can be overwritten. as for setting your default gateway, in fedora i *believe* you set it in /etc/sysconfig/ifcfg-eth0, or something like that. wherever your static ip settings are...where did you configure that? there should be a line like Gateway="" and you want to put in Gateway="192.168.1.1" or whatever your router's ip address is. you can also do this with the command route add default gateway 192.168.1.1 but it won't be permanent. |
i was able to setup the ip, gateway, primary and secondary dns all through the gui on eth0.
ill try to edit the resolv.conf which do i need to put in without the router(getting it this week)? my ip? the gateway? both dns servers? thanks for clarifying the structure of the resovl.conf can you provide an example of the host.conf file since i hosed mine? sorry to be bothering so much but i have no examples to go off of. im new to linux but not new to computers. |
nice tutorial with examples!!!! thx!!!!!
|
All times are GMT -5. The time now is 02:25 AM. |