routing help please
I have tried to figure this out myself with alot of reading, but no luck.
What I have is a laptop on a lan connected via adsl on eth0 (pcmcia card) and I also take it to work and connect via ppp on ppp0 The problem I am having is being able to ping anything when connected with ppp0 at work. I have internet connection. When I start the laptop, I shutdown eth0 with: ifconfig eth0 down Then I can connect fine with ppp. Here is the result's of route -n while connected with ppp: $>route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 161.184.255.205 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo 0.0.0.0 161.184.255.205 0.0.0.0 UG 0 0 0 ppp0 and the results of ifconfig: $>ifconfig lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:143 errors:0 dropped:0 overruns:0 frame:0 TX packets:143 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:12536 (12.2 Kb) TX bytes:12536 (12.2 Kb) ppp0 Link encap:Point-to-Point Protocol inet addr:161.184.200.91 P-t-P:161.184.255.205 Mask:255.255.255.255 UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 RX packets:46 errors:0 dropped:0 overruns:0 frame:0 TX packets:42 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:3 RX bytes:2992 (2.9 Kb) TX bytes:2022 (1.9 Kb) and ping: $>ping -c 5 www.linuxquestions.org PING www.linuxquestions.org (64.179.4.149) 56(84) bytes of data. From edtntnt10.agt.net (161.184.255.206) icmp_seq=1 Dest Unreachable, Bad Code: 9 From edtntnt10.agt.net (161.184.255.206) icmp_seq=2 Dest Unreachable, Bad Code: 9 From edtntnt10.agt.net (161.184.255.206) icmp_seq=3 Dest Unreachable, Bad Code: 9 From edtntnt10.agt.net (161.184.255.206) icmp_seq=4 Dest Unreachable, Bad Code: 9 From edtntnt10.agt.net (161.184.255.206) icmp_seq=5 Dest Unreachable, Bad Code: 9 --- www.linuxquestions.org ping statistics --- 5 packets transmitted, 0 received, +5 errors, 100% packet loss, time 4003ms Should I be adding my default gateway as my router ip, and eth0, and should anything be added to the tables for the ppp0 connection? Is this normal to have to shutdown the eth0 before being able to dial out with ppp? Thank's in advance for any help with this. chopp |
What does the routing table look like with ppp0 started and eth0 still up?
|
$>route -n
Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 161.184.255.205 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0 192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo 0.0.0.0 161.184.255.205 0.0.0.0 UG 0 0 0 ppp0 chopp |
can anyone offer any help on this?
chopp |
Everything with numbers looks ok..
In the ppp0 setup choose the debug option and watch the logfiles for some comments about failures.. It looks like the ip allocation is working, the default gateway is working, the new dns allocations are working, but the next router up the ppp link is saying there isn't a forward path.. It is possible for the adsl scripts to interfere with dns allocations, but the ping resolved ok.. Don't know which dns server it used tho'.. Do dig www.whatever.com after ppp0 is up but before you kill eth0 and see where the dns is being resolved from.. Also try with any iptables rules off. There may be rules being added by the scripts controlling ppp0 and the adsl.. |
dig
peter_robb, sorry for my ignorance, but do I need to be running a dns server to get the dig tool?
|
allright, I found and installed bind. ;)
Well if I start ppp with eth0 up (nothing plugged into pcmcia) I get an ip showing up with my gdesklet, but I get nowhere with dig, or ping. #ifconfig eth0 down: still nothing with ping or dig. #usr/sbin/ppp-off $dig www.google.com (I see my isp's DNS at the bottom) $ping -c 5 www.google.com: nothing now this bring's up another question: do I really need to reboot to get an ip again with eth0? I tried #ifconfig eth0 up (no go) and then #cardctl reset 1 (still nothing) |
What I am suggesting is a clean boot, without eth0 starting..
There will be stuff in the startup scripts that I would rather not have started. Better to start without this stuff than try to find them and stop them later.. What I am expecting to see is the dns server each setup uses is identified in the dig response. And then see if the ppp0 setup uses different dns servers than the eth0 setup.. which it should.. Somewhere in the Skackware startup scripts, the settings for the pcmcia, eth0 and dsl are preventing the ppp connection from operating cleanly.. But first it needs to be proven the setups are different.. It may be something like incompatible MTU settings.. So remove eth0 from the startup scripts and reboot without either eth0 or ppp0 starting. The, with ppp0 started with the debug option, do the dig thing... and route -n.. check the ppp logfiles, could be /var/log/syslog, messages or daemon.. Then stop ppp0.. start eth0... prob something like '/etc/init.d/~eth0~ start' and do the dig thing and route -n.. and compare the results with your problem setup.. and the logfiles. |
I think your problem is due to default GW when you move from one network to another.
If you set one gateway that is not up while you are on another network, of course you won't be able to "surf", cause your packets won't be able to "leave". |
Allright, I rebooted with rc.pcmcia not executable.
fired up ppp. route -n Kernel IP routing table Destination Gateway Genmask Flags Metric Ref Use Iface 161.184.255.205 0.0.0.0 255.255.255.255 UH 0 0 0 ppp0 127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo 0.0.0.0 161.184.255.205 0.0.0.0 UG 0 0 0 ppp0 dig www.google.com ;; Query time: 337 msec ;; SERVER: 199.185.220.52#53(199.185.220.52) ;; WHEN: Thu Dec 16 12:42:58 2004 ;; MSG SIZE rcvd: 365 my resolv.conf has this: search telus.net nameserver 199.185.220.52 /var/log/messages nothing unusual /var/log/syslog nothing wrong with the ppp connection, but this for dig: process 'dig' is using obsolete setsockopt SO_BSDCOMPAT I can't check eth0 because I'm at work. eantoranze, my defaulf gateway is eth0, with the ip of my router. Should it be set as the dns server in my resolv.conf instead? thank's alot for your help so far people, I really appreciate it. |
Let's do something interesting.... while at work, without having shutdown eth0 save the ifconfig, route output (and please, when you put them here, use "code" blocks so they are more readable). Something like:
Code:
Just a piece of code, guys. Code:
|
ok with eth0 still up:
Code:
$>ifconfig Code:
$>route -n |
now... without shutting down eth0, bring up ppp0 (that's when you get trouble, right?) and put the output of route and ifconfig here, ok?
|
with eth0 and ppp0 still up:
Code:
$>route -n |
Ok, so the default gw didn't change..
That means one of your ppp settings needs changing.. You need to use the 'defaultroute' option in ppp to make it change the gw to the ppp0 gw while eth0 is still running.. If the option is already selected, there's a bug/trick in the Slack scripts to make it work.. Now because your first post showed a good gateway number, I'd say a second problem comes with shutting down eth0.. ifconfig isn't the correct tool for that.. use the /etc/init.d/ script for the interface... or ifdown eth0 if it exists.. |
All times are GMT -5. The time now is 03:06 AM. |