LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-01-2004, 01:21 AM   #1
thinkninja
LQ Newbie
 
Registered: Aug 2003
Posts: 13

Rep: Reputation: 0
Routing to switch


My problem is practially identical to Entropius' but, unfortunately, there was no resolution offered in that thread. I too feel like an idiot

With ppp0 down and eth0 up, I can connect to the router/switch/WAP fine via 192.168.0.1 (configured using DHCP). With ppp0 up and eth0 down, I can connect to my ISP and use the internet. With both interfaces up, I can't do anything. I can't talk to the router and domains will not resolve.

This is the routing table by default when both interfaces are up:
Code:
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
195.92.168.41   *               255.255.255.255 UH    0      0        0 ppp0
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
default         192.168.0.1     0.0.0.0         UG    0      0        0 eth0
default         195.92.168.41   0.0.0.0         UG    0      0        0 ppp0
The IP on ppp0 is updated automatically whenever I dial in to my ISP. 'route del default dev eth0' lets me resolve domains but I can't get to 192.168.0.1. How can I add a route to it?

Any help would be much appreciated
 
Old 07-01-2004, 01:45 AM   #2
maxut
Senior Member
 
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
Re: Routing to switch

Quote:
Originally posted by thinkninja

Code:
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
195.92.168.41   *               255.255.255.255 UH    0      0        0 ppp0
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
default         192.168.0.1     0.0.0.0         UG    0      0        0 eth0
default         195.92.168.41   0.0.0.0         UG    0      0        0 ppp0
this routing table seems ok instead of loopback. where is it? i think if u add loopback, your trouble can be solved.
 
Old 07-01-2004, 01:49 AM   #3
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Well it's not going to be workable if you have two default routes each with an equal metric. The poor kernel will probably try to split packets evenly between them, or something ridiculous like that. You should alter your netstart scripts so that if-up'ing eth0 does not add a default gateway.

As for the WAP, you don't mention what subnet it's on. I'm assuming it's not on 192.168.0.0/24, because you already have a route to that pointing to the local ethernet segment. Deleting the default route won't destroy the route to 192.168/24. Find out what subnet your wireless clients are on and have that added when eth0 is brought up. You just want to do a route add for the -net of whatever the WAP is on and use a gw of 192.168.0.1.
 
Old 07-01-2004, 12:22 PM   #4
charon79m
Member
 
Registered: Oct 2003
Distribution: Just about anything... so long as it is Debain based.
Posts: 297

Rep: Reputation: 30
There's no need for a gateway on any network unless you are trying to get to another ip scheme.

You need a default gw to tell you computer how to get to any network that is not otherwise stated in your route table, or if you have multiple pipes to the internet.

I'd check you DHCP server and remove the default gateway offer from its config.

You could also just address your ethernet interface statically. That would also solve the problem.

You state that once you do a 'route del default dev eth0' you can not get to 192.168.0.1. The only entry you need in your routing table to get to that address is what is already in your list:
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0

MrKnisely
 
Old 07-01-2004, 12:45 PM   #5
thinkninja
LQ Newbie
 
Registered: Aug 2003
Posts: 13

Original Poster
Rep: Reputation: 0
Trying just eth0:
Code:
fire:/home/ninja# ifup eth0
(LICENSE SNIPPED)
sit0: unknown hardware address type 776
sit0: unknown hardware address type 776
Listening on LPF/eth0/00:50:8d:f9:44:f0
Sending on   LPF/eth0/00:50:8d:f9:44:f0
Sending on   Socket/fallback/fallback-net
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6
DHCPOFFER from 192.168.0.1
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPACK from 192.168.0.1
bound to 192.168.0.3 -- renewal in 129600 seconds.
fire:/home/ninja# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.0.0     *               255.255.255.0   U     0      0        0 eth0
default         192.168.0.1     0.0.0.0         UG    0      0        0 eth0
Okay, I'm making progress. I can't connect to the router (192.168.0.1?) at all now, and yes, I have pushed the reset button + plus power-cycled it. I also tried deleting the route to 192.168.0.0 and re-adding one to 192.168.0.1. Probably a stupid idea.

Chort, I knew (even though I readily admit I know nothing about networking...as is patently obvious) that having two default routes just wasn't going to work. I couldn't connect to anything on the internet like that until I did 'route del default dev eth0'.

Regarding WAP, I have no wireless clients, nor is anything else connected to the switch...yet. So that's an issue for another day. I am, however, super keen to reconnect to the router itself with a view to attempting further configuration. As it stands, I can't even ping it.

I've reset it again, disconnected the cable, and turned it off while I take a shower. This is making me hot and bothered.
 
Old 07-01-2004, 04:11 PM   #6
newpenguin
Member
 
Registered: Sep 2002
Location: lahore pakistan
Distribution: slackware,redhat, FreeBSD,openbsd
Posts: 219

Rep: Reputation: 30
kernel always applies first match in routing table

so in caseDestination Gateway Genmask Flags Metric Ref Use Iface
195.92.168.41 * 255.255.255.255 UH 0 0 0 ppp0
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
default 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
default 195.92.168.41 0.0.0.0 UG 0 0 ppp0


192.168.0.1 is your default gw.

simply just do
route del default gw 192.168.0.1
before dialing or after dialing.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
why switch? NOT because it's not MS titanium_geek Linux - News 61 10-12-2006 10:50 PM
thread switch results in kernel stack switch superstition Linux - General 1 05-17-2005 11:48 PM
set up DSL thru SWITCH - winXp connected to SWITCH too husz Linux - Newbie 5 04-22-2004 12:08 AM
real routing under nat routing nothingmuch Linux - Networking 4 10-27-2003 03:11 PM
how to switch off ... Xing Linux - Software 4 10-13-2003 07:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration