All of lore.kernel.org
 help / color / mirror / Atom feed
* ifconfig appears to also add entry to routing table
@ 2002-09-01 19:20 Jim Earl
  2002-09-01 19:41 ` pa3gcu
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Jim Earl @ 2002-09-01 19:20 UTC (permalink / raw)
  To: Linux Newbie

Hello all,

I have been configuring a linux box to function as a router, ran into some
problems, and think that I traced the problem to a faulty routing table.  So
I brought down all my interfaces and routing table ( except lo ) and
attempted to add them manually.

I was able to add an interface manually, assigning my eth0 device the IP
addr 192.168.1.2.  ifconfig verifys that this if is good to go.

However, I found that I was unable to give a simple "route" command, for
example:

route add 192.168.1.2

gives the response:

SIOCADDRT: No such device

the man page for route implies that you can specify the device in the route
command also:

route add 192.168.1.2 dev eth0

Still no good.  Various stabs at syntax based on the route man page also
yield nothing


I have also found that after issuing the ifconfig command, the routing table
is automatically updated with an entry for a route to that network:

Destination  Gateway   Genmask     Flags    Metric   REf  Use   Iface
192.168.1.0     *    255.255.255.0   U        0       0     0   eth0

Though this seems sloppy- note that Flags column lacks an "N" for Network.

This is undocumented behavior, as everywhere I have looked it has been
implied that one has to bring up an interface and also independently
establish the route to it.  I would like to be able to add a route to the
host itself, indicating that it is its own gateway ( I believe this is the
root of my router problem- no pun intended .  Can someone verify this?)

Of course, Thanks in advance,

Jim


-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ifconfig appears to also add entry to routing table
  2002-09-01 19:20 ifconfig appears to also add entry to routing table Jim Earl
@ 2002-09-01 19:41 ` pa3gcu
  2002-09-01 20:04 ` Ray Olszewski
  2002-10-04 16:26 ` Make Linux bootdisk Abhijit Vijay
  2 siblings, 0 replies; 7+ messages in thread
From: pa3gcu @ 2002-09-01 19:41 UTC (permalink / raw)
  To: Jim Earl, Linux Newbie

On Sunday 01 September 2002 19:20, Jim Earl wrote:
> Hello all,
>
> I have been configuring a linux box to function as a router, ran into some
> problems, and think that I traced the problem to a faulty routing table. 
> So I brought down all my interfaces and routing table ( except lo ) and
> attempted to add them manually.

A complete routing table would have been of more help here;

>
> I was able to add an interface manually, assigning my eth0 device the IP
> addr 192.168.1.2.  ifconfig verifys that this if is good to go.
>
> However, I found that I was unable to give a simple "route" command, for
> example:
>
> route add 192.168.1.2

There is nothing wrong there as what would a route to "yourself" be of any 
use to you.
 
>
> gives the response:
>
> SIOCADDRT: No such device

Yup thats normal with that command.

>
> the man page for route implies that you can specify the device in the route
> command also:
>
> route add 192.168.1.2 dev eth0
>
> Still no good.  Various stabs at syntax based on the route man page also
> yield nothing

As above, you cant and dont need a route to you "own interface".

> I have also found that after issuing the ifconfig command, the routing
> table is automatically updated with an entry for a route to that network:
>
> Destination  Gateway   Genmask     Flags    Metric   REf  Use   Iface
> 192.168.1.0     *    255.255.255.0   U        0       0     0   eth0
>
> Though this seems sloppy- note that Flags column lacks an "N" for Network.

No not sloppy at all, note your netmask 255.255.255.0
So ifconfig adds a route accordingly.
If you dislike the above use the netmask option with "ifconfig"

>
> This is undocumented behavior, as everywhere I have looked it has been
> implied that one has to bring up an interface and also independently
> establish the route to it.  I would like to be able to add a route to the
> host itself, indicating that it is its own gateway ( I believe this is the
> root of my router problem- no pun intended .  Can someone verify this?)

Not at all, a route is assigned according to the netmask used with ifconfig.

I think it would be better if you stated your router problem and supply 
details of the routing table and output of ifconfig.
route -ne
ifconfig -a
+ of course a description of just what you want to do.

The problem which most folks have is that they need to define a default route 
via an interface.
Simply upping an interface on a machine does not automaticly mean you have a 
working routing table.

>
> Of course, Thanks in advance,
>
> Jim
>

-- 
Regards Richard
pa3gcu@zeelandnet.nl
http://people.zeelandnet.nl/pa3gcu/

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ifconfig appears to also add entry to routing table
  2002-09-01 19:20 ifconfig appears to also add entry to routing table Jim Earl
  2002-09-01 19:41 ` pa3gcu
@ 2002-09-01 20:04 ` Ray Olszewski
  2002-10-04 16:26 ` Make Linux bootdisk Abhijit Vijay
  2 siblings, 0 replies; 7+ messages in thread
From: Ray Olszewski @ 2002-09-01 20:04 UTC (permalink / raw)
  To: Jim Earl, Linux Newbie

Jim --

First, the basics: What Linux distro, what kernel version? Does it use ifup 
and ifdown, or do its init scripts call ifconfig and route directly?

Second, when you say " ifconfig verifys that this if is good to go" ... are 
you sufficiently expert to be sure of this? If not, please repost with the 
actual output if "ifconfig -a" as it appears just before you run the 
unsuccessful "route" command.

Third, in my experience, I've found "route" to be a bit picky in ways that 
the man page doesn't warn about. In your case, I'd suggest you try this 
form of the command

         route add -host 192.168.1.2 dev eth0

and see if it does any better for you.

(Of course, I can't comment on the "various stabs" that you do not 
describe... it may be that you already tried this, without success.)

Finally, you write:

         Destination  Gateway   Genmask     Flags    Metric   REf  Use   Iface
         192.168.1.0     *    255.255.255.0   U        0       0     0   eth0

         Though this seems sloppy- note that Flags column lacks an "N" for 
Network.

If you look at the list of flags in the man page for "route", you will 
notice that N is not a choice. There is an H for host and a G for gateway, 
but routes are assumed to be networks by default, so not specially labeled. 
So no, it is not "sloppy".

As to the "undocumented" addition of this route ... I'm so used to this 
stuff happening in the background that I don't recall offhand what command 
does what (ifup and ifdown, the commands used on most modern, full-size 
Linux distros, does handle both, and their man pages do say so). So you 
might be more specific about the details of what you did (for example, was 
the routing table empty *before* you brought the interface up?).

As to the source of your router problem, I wouldn't hazard a guess. Your 
guess seems implausible, though ... routers do not usually need to be told 
that they are their own gateways; indeed, I find it hard to imagine a 
circumstance under which this would even work ... but you offer so little 
description of your setup, any comments here are wild guesses. IF you want 
help at that level, please tell us

         what you want this system to route between (2 Ethernets?
                 an Ethernet LAN and a dialup connection
                 to the Internet? something else?) what interfaces
                 does it have (probably eth* and/or ppp*)?
         whether the hosts on the LAN(s) have "real" (routable) IP
                 addresses or you want the router to use IP Masquerading
                 to NAT them for connections to the Internet
         what "ifconfig -a" shows when the router does not route
         what "netstat -nr" shows when the router does not route
         what "cat /proc/sys/net/ipv4/ip_forward" shows when the
                 router does not route
         if this is a connection to the Internet, how the interface to the
                 ISP is supposed to get its IP address (static? DHCP?
                 PPPoE?) and what the ISP says you are supposed to use
                 as a gateway address.
         if this is a connection to the Internet, can you ping the gateway
                 address above? If not, HOW does ping fail (yes, there are
                 many different errors it can report, and they are diagnostic).
         what the routing failures are? For EXAMPLE, can the router itself
                 make Internet connections, but not hosts on the LAN it is
                 supposed to route?

There may be more we need to know, but that will make a good start.

At 01:20 PM 9/1/02 -0600, Jim Earl wrote:
>Hello all,
>
>I have been configuring a linux box to function as a router, ran into some
>problems, and think that I traced the problem to a faulty routing table.  So
>I brought down all my interfaces and routing table ( except lo ) and
>attempted to add them manually.
>
>I was able to add an interface manually, assigning my eth0 device the IP
>addr 192.168.1.2.  ifconfig verifys that this if is good to go.
>
>However, I found that I was unable to give a simple "route" command, for
>example:
>
>route add 192.168.1.2
>
>gives the response:
>
>SIOCADDRT: No such device
>
>the man page for route implies that you can specify the device in the route
>command also:
>
>route add 192.168.1.2 dev eth0
>
>Still no good.  Various stabs at syntax based on the route man page also
>yield nothing
>
>
>I have also found that after issuing the ifconfig command, the routing table
>is automatically updated with an entry for a route to that network:
>
>Destination  Gateway   Genmask     Flags    Metric   REf  Use   Iface
>192.168.1.0     *    255.255.255.0   U        0       0     0   eth0
>
>Though this seems sloppy- note that Flags column lacks an "N" for Network.
>
>This is undocumented behavior, as everywhere I have looked it has been
>implied that one has to bring up an interface and also independently
>establish the route to it.  I would like to be able to add a route to the
>host itself, indicating that it is its own gateway ( I believe this is the
>root of my router problem- no pun intended .  Can someone verify this?)
>
>Of course, Thanks in advance,
>
>Jim




--
-------------------------------------------"Never tell me the odds!"--------
Ray Olszewski					-- Han Solo
Palo Alto, California, USA			  ray@comarre.com
-------------------------------------------------------------------------------

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Make Linux bootdisk
  2002-09-01 19:20 ifconfig appears to also add entry to routing table Jim Earl
  2002-09-01 19:41 ` pa3gcu
  2002-09-01 20:04 ` Ray Olszewski
@ 2002-10-04 16:26 ` Abhijit Vijay
  2002-10-04 18:45   ` Ray Olszewski
                     ` (2 more replies)
  2 siblings, 3 replies; 7+ messages in thread
From: Abhijit Vijay @ 2002-10-04 16:26 UTC (permalink / raw)
  To: Linux Newbie

Hi All,

Could anyone please tell me how to make a linux
bootdisk? Is it true that a linux bootdisk made for
one computer cannot be used to boot another linux
machine?

Regards,
Thanks in Advance,
Abhijit.



__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Make Linux bootdisk
  2002-10-04 16:26 ` Make Linux bootdisk Abhijit Vijay
@ 2002-10-04 18:45   ` Ray Olszewski
  2002-10-04 20:06   ` Chuck Gelm
  2002-10-05  8:08   ` pa3gcu
  2 siblings, 0 replies; 7+ messages in thread
From: Ray Olszewski @ 2002-10-04 18:45 UTC (permalink / raw)
  To: Abhijit Vijay, Linux Newbie

At 09:26 AM 10/4/02 -0700, Abhijit Vijay wrote:
>Hi All,
>
>Could anyone please tell me how to make a linux
>bootdisk? Is it true that a linux bootdisk made for
>one computer cannot be used to boot another linux
>machine?


At the level of generality you ask, there is no simple answer, other than 
suggesting you read the Bootdisk HowTo (available at ibiblio.org, for 
example).

There are many types of bootdisks. Some (rescue disks like tomsrtbt, for 
example, or floppy-based distros like LEAF) are quite general and can boot 
on most any machine. Others, designed to boot a specific configuration on a 
particular machine, will work on a different machine only with luck (the 
two machines need not be identifal, but they need to be quite similar).

So ... read the HowTo for general advice. Repost here with more specific 
questions.


--
-------------------------------------------"Never tell me the odds!"--------
Ray Olszewski					-- Han Solo
Palo Alto, California, USA			  ray@comarre.com
-------------------------------------------------------------------------------

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Make Linux bootdisk
  2002-10-04 16:26 ` Make Linux bootdisk Abhijit Vijay
  2002-10-04 18:45   ` Ray Olszewski
@ 2002-10-04 20:06   ` Chuck Gelm
  2002-10-05  8:08   ` pa3gcu
  2 siblings, 0 replies; 7+ messages in thread
From: Chuck Gelm @ 2002-10-04 20:06 UTC (permalink / raw)
  To: Abhijit Vijay; +Cc: Linux Newbie

Howdy, Abhijit Vijay:

Can you please tell use which distribution of linux that you have?

Chuck

Abhijit Vijay wrote:
> 
> Hi All,
> 
> Could anyone please tell me how to make a linux
> bootdisk? Is it true that a linux bootdisk made for
> one computer cannot be used to boot another linux
> machine?
> 
> Regards,
> Thanks in Advance,
> Abhijit.
> 
> __________________________________________________
> Do you Yahoo!?
> New DSL Internet Access from SBC & Yahoo!
> http://sbc.yahoo.com
> -
> To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.linux-learn.org/faqs
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Make Linux bootdisk
  2002-10-04 16:26 ` Make Linux bootdisk Abhijit Vijay
  2002-10-04 18:45   ` Ray Olszewski
  2002-10-04 20:06   ` Chuck Gelm
@ 2002-10-05  8:08   ` pa3gcu
  2 siblings, 0 replies; 7+ messages in thread
From: pa3gcu @ 2002-10-05  8:08 UTC (permalink / raw)
  To: Abhijit Vijay, Linux Newbie

On Friday 04 October 2002 16:26, Abhijit Vijay wrote:
> Hi All,
>
> Could anyone please tell me how to make a linux
> bootdisk? Is it true that a linux bootdisk made for
> one computer cannot be used to boot another linux
> machine?

Ray explained in great detail, however to expand on what he said about 
booting other computers, the created bootdisk will only boot another machine 
to start with if it has the same root partition, for example /dev/hda3 would 
be the root partition, if another machine has /dev/hda2 as it root partition 
then it would boot the other machine as is, you would need to use 'rdev' to 
change the boot params of the disk.

'man rdev' and 'rdev -h' will help you more.

Then as Ray said the machines would need to be somewhat the same.


>
> Regards,
> Thanks in Advance,
> Abhijit.
>

-- 
Regards Richard
pa3gcu@zeelandnet.nl
http://people.zeelandnet.nl/pa3gcu/

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2002-10-05  8:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-09-01 19:20 ifconfig appears to also add entry to routing table Jim Earl
2002-09-01 19:41 ` pa3gcu
2002-09-01 20:04 ` Ray Olszewski
2002-10-04 16:26 ` Make Linux bootdisk Abhijit Vijay
2002-10-04 18:45   ` Ray Olszewski
2002-10-04 20:06   ` Chuck Gelm
2002-10-05  8:08   ` pa3gcu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.