LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   net connection (https://www.linuxquestions.org/questions/debian-26/net-connection-426520/)

ekdya 03-20-2006 04:59 AM

net connection
 
Hi

I am running debian testing with 2.6.15, being connected to the net with adsl/router modem connected to my eth0, the adsl modem is 192.168.1.1
My /etc/resolv.conf is
Nameserver 192.168.1.1

And my /etc/network/interfaces is

Auto eth0
Iface eth0 inet dhcp


I am able to ping www.google.com but not able to apt-get, it gives
#apt-get update
0% [Conncting to http.us.debian.org (1.0.0.0)] …

I have resolvconf installed, I can only fix this if I change the IP in my /etc/resolvconf to my ISP DNS. which is worthless because on ipdown and ipup or reboot, it gets overwritten to 192.168.1.1

Any one can help with this problem.

Thanks

b0nd 03-20-2006 05:38 AM

Quote:

Originally Posted by ekdya
Hi

My /etc/resolv.conf is
Nameserver 192.168.1.1

And my /etc/network/interfaces is

Auto eth0
Iface eth0 inet dhcp


I am able to ping www.google.com but not able to apt-get, it gives
#apt-get update
0% [Conncting to http.us.debian.org (1.0.0.0)] …

I have resolvconf installed, I can only fix this if I change the IP in my /etc/resolvconf to my ISP DNS. which is worthless because on ipdown and ipup or reboot, it gets overwritten to 192.168.1.1

Any one can help with this problem.

Thanks

your resolv.conf is getting changed because some script on running is changing it. I think it must be the pppoe-script in which you must have specified the DNS server as 192.168.1.1
either run the pppoe-setup again or check out for the script in /etc/ppp.
(i don't know about debian.........i'm slacker)

and one more thing....DNS in /etc/resolv.conf must be changed to the DNS of your ISP. It should not be 192.168.1.1. I don't know how are you pinging to google.com.

regards

dracae 03-20-2006 10:07 AM

You should be able to specify the dns servers you dhcp server gives out on the router. The router ip should work, if you are able to ping google then it definitely is. It may have a corrupt cache, try bouncing the router.

ekdya 03-20-2006 10:56 AM

what is "bouncing the router" mean?

dracae 03-21-2006 12:20 PM

reboot, power cycle, unplug power cable.

ekdya 03-21-2006 12:45 PM

I tried unplugging and re-connecting the power cable, which did not realy change any thing.
I am able to ping my modem on 192.168.1.1, in my modem setting it uses the correct isp DNS.

b0nd 03-21-2006 09:31 PM

Quote:

Originally Posted by ekdya

I have resolvconf installed, I can only fix this if I change the IP in my /etc/resolvconf to my ISP DNS. which is worthless because on ipdown and ipup or reboot, it gets overwritten to 192.168.1.1

does it mean that on changing the setting in /eyc/resolv.conf everything is working fine ???


regards

ekdya 03-21-2006 10:01 PM

"every thing" yes, in this end, it is only the browser and the apt-get and pining, they all work fine when I change the 192.168.1.1 "the adsl modem/router" address to the ISP primary address.

b0nd 03-21-2006 10:05 PM

Quote:

Originally Posted by ekdya
"every thing" yes, in this end, it is only the browser and the apt-get and pining, they all work fine when I change the 192.168.1.1 "the adsl modem/router" address to the ISP primary address.

thats what i adviced you to do in my first post.
as you said that something is re-writing your entries in /etc/resolv.conf, so i adviced you to look out for that script. In my case its always the /etc/ppp script. So either look for that script and change the DNS there or setup again the internet connection.

regards

ekdya 03-22-2006 09:56 AM

it would be nice if someone can tell us a command line hack to search for a give "string" in all files in the this dir and subdirs under it since I am looking for a certain ip-address in
# ls -l /etc/ppp/
total 30
-rw------- 1 root root 80 2006-03-19 03:49 chap-secrets
-rwxr-xr-x 1 root root 1749 2005-05-06 03:32 ip-down
drwxr-xr-x 2 root root 1024 2006-03-20 02:46 ip-down.d
-rwxr-xr-x 1 root root 1887 2005-05-06 03:32 ip-up
drwxr-xr-x 2 root root 1024 2006-03-19 21:21 ip-up.d
-rwxr-xr-x 1 root root 779 2005-05-06 03:32 ipv6-down
drwxr-xr-x 2 root root 1024 2005-05-06 03:32 ipv6-down.d
-rwxr-xr-x 1 root root 917 2005-05-06 03:32 ipv6-up
drwxr-xr-x 2 root root 1024 2005-05-06 03:32 ipv6-up.d
-rw-r--r-- 1 root root 13208 2005-05-06 03:32 options
-rw------- 1 root root 1626 2006-03-19 03:49 pap-secrets
drwxr-s--- 2 root dip 1024 2006-03-19 03:49 peers
-rwxr-x--- 1 root dip 118 2004-09-30 12:13 ppp_on_boot.dsl
drwxr-xr-x 2 root root 1024 2005-03-24 05:04 resolv

ekdya 03-22-2006 05:09 PM

# grep -FHrn 192.168.1.1 /etc/ppp/*
/etc/ppp/options:12:# ms-dns 192.168.1.1

notice it is the only entry and it is commented with #, so that tell us there is nothing under /etc/ppp/files that is using the string "192.168.1.1" unless it is being passed-by-ref and not by-value.

b0nd 03-22-2006 07:55 PM

If you are not getting the script this way then its better to run the setup for internet connection again.

ekdya 03-27-2006 03:58 PM

the fix:
I wrote a script which I ran ever time I wanted to connect to the Internet.
here it is
************************************************************
ifup -a
sleep 4
perl -pi -e 's/192.168.1.1/xxx/e' /etc/resolv.conf
/etc/init.d/ntpdate start
where xxx is the primary dns of my isp
************************************************************
now for what ever reason I noticed that it connects and all works find with out runing the script any more, furthermore I noticed after I run the script "which is not really needed anymore" that I get

/etc/resolvconf/update.d/libc: Warning: /etc/resolv.conf is not a symbolic link to /etc/resolvconf/run/resolv.conf

ok, maybe by breaking the sym.link as above this problem would have been fixed long time ago. I don't know, I guss I can reinstall the sym.link and see if that breaks it.


All times are GMT -5. The time now is 06:58 AM.