>Date: Wed, 5 Jan 2000 01:38:08 +0530

>1. How do i traceroute out of a box which is behind a gateway ( actually a
>device with multiple modems which connects to the net and acts as a gateway
>for the LAN.)? i can ping out to servers on the net alright by specifying
>the device as eth0.

... you must specify device? seems you did not set routing.
Gateway does not matter if configured correctly. Firewall
can filter out ICMP packets in any direction (traceroute
uses ICMP packet telling TTL reached to get info).

>2. How do i use a Linux box to connect two subnets? I think the answer to
>this would be fairly long, so i expect just a pointer or a URL.

You need enable IP forwarding (/proc/sys/net/ipv4/ip_forward
contains 1 if enabled, 0 if disabled) and configure routing -
each routing entry says something like: if destination is in
range x.y.z.0 to x.y.z.255 forward the packet to interface
xyz [gateway x.y.v.w]; a "netmask" tells which bits are fixed
(e.g. 255.255.255.192 tells address x.y.z.0 means range from
x.y.z.0 to x.y.z.63). Few more concepts:
local net - net which address range contains your host address,
  connected directly to your host interface; you do not specify
  gateway for local net, just interface only
gateway - should have address on local net, and know how to
  forward packets to the net it is used as gateway to; you
  use gateway address in routing table for non-local nets
default route - route with netmask 0.0.0.0, it matches every
  address, and is used when other definitions fail. Should point
  to gateway to external net

Say your gateway to net 192.168.2.0 is 192.168.1.1, and
gateway to external net is 192.168.1.254, and both nets
have mask 255.255.255.0, your routes may be like:
192.168.1.0 mask 255.255.255.0 device eth0
192.168.2.0 mask 255.255.255.0 gateway 192.168.1.1
0.0.0.0 mask 0.0.0.0 gateway 192.168.1.254
and this is enough for proper routing on net 192.168.1.x

a gateway has two interfaces: eth0 with address 192.168.1.1
and eth1 with address 192.168.2.1, it has routes:
192.168.1.0 mask 255.255.255.0 device eth0
192.168.2.0 mask 255.255.255.0 device eth1
0.0.0.0 mask 0.0.0.0 gateway 192.168.1.254

on net 192.168.2.x routes are simpler:
192.168.2.0 mask 255.255.255.0 device eth0
0.0.0.0 mask 0.0.0.0 gateway 192.168.2.1

and the external gateway has something like:
192.168.1.0 mask 255.255.255.0 device eth0
192.168.2.0 mask 255.255.255.0 gateway 192.168.1.1
0.0.0.0 mask 0.0.0.0 device ppp0 gateway 204.123.65.11
(its default route is set up when it connects by PPP)

Read "man route" for more details.
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]

Reply via email to