Networking Forums

Networking Forums > Computer Networking > Linux Networking > Gateway/forwarding problem between subnetworks

Reply
Thread Tools Display Modes

Gateway/forwarding problem between subnetworks

 
 
Aymeric Duclert
Guest
Posts: n/a

 
      08-16-2003, 09:48 PM
Hi all,

I have a routing problem that I cannot solve :

Topology :
-----------
I have 2 subnetworks :

- a first subnetwork (call it A) with addresses
192.168.1.0/255.255.255.0 that is connected to internet via a gateway
with address 192.168.1.2 (and a dynamic IP address). This network
works fine.
- a second subnetwork (call it B) with addresses
192.168.0.0/255.255.255.0 (in fact a wireless network).

Both networks A and B are interconnected by a machine (call it GW)
having 2 network cards with addresses 192.168.1.1 on the first network
A and 192.168.0.1 on the second network B.

INTERNET
|
+-----+------+
| modem |
+-----+------+
|
+----+------+
|192.168.1.2|
+----+------+
| network A, 192.168.1.0
+----------------------------------------+
| 192.168.1.1
+--+--+
| GW |
+--+--+
network B, 192.168.0.0 | 192.168.0.1
------+------------------+
|
+-------+------+
| 192.168.0.3 |
+--------------+

Problem :
---------
Internet cannot be reached from network B by a machine which has the
address 192.168.0.3 (a laptop).

Configurations :
----------------
- All machines are under linux 2.4.7-10 (RedHat 7.2).

- Of course GW can be reached from 192.168.0.3 perfectly well, and
also GW can reach internet !

- On 192.168.0.3, routes seem ok :
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref
Use Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0
0 wlan0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0
0 lo
0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0
0 wlan0

- On GW, routes seem also ok (and GW accesses the internet perfectly)
:
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref
Use Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0
0 eth0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0
0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0
0 lo
0.0.0.0 192.168.1.2 0.0.0.0 UG 0 0
0 eth0

- GW has the forwarding enabled :
# cat /proc/sys/net/ipv4/ip_forward
1

- GW has no firewall activated.

- But 192.168.0.3 cannot ping an internet address. It seems to know
that the first step is to go to GW, but is then blocked there :
# traceroute -n 216.239.53.100
traceroute to 216.239.53.100 (216.239.53.100), 30 hops max, 38 byte
packets
1 192.168.0.1 3.493 ms 2.657 ms 2.937 ms
2 * * *

Anybody has an idea about how to solve the situation, or even try to
debug/understand what it the problem ?

Thanks.

Aymeric
 
Reply With Quote
 
 
 
 
David Efflandt
Guest
Posts: n/a

 
      08-16-2003, 11:24 PM
On 16 Aug 2003 14:48:52 -0700, Aymeric Duclert <(E-Mail Removed)> wrote:
> Hi all,
>
> I have a routing problem that I cannot solve :
>
> Topology :
> -----------
> I have 2 subnetworks :
>
> - a first subnetwork (call it A) with addresses
> 192.168.1.0/255.255.255.0 that is connected to internet via a gateway
> with address 192.168.1.2 (and a dynamic IP address). This network
> works fine.
> - a second subnetwork (call it B) with addresses
> 192.168.0.0/255.255.255.0 (in fact a wireless network).
>
> Both networks A and B are interconnected by a machine (call it GW)
> having 2 network cards with addresses 192.168.1.1 on the first network
> A and 192.168.0.1 on the second network B.
>
> INTERNET
> |
> +-----+------+
> | modem |
> +-----+------+
> |
> +----+------+
> |192.168.1.2|
> +----+------+
> | network A, 192.168.1.0
> +----------------------------------------+
> | 192.168.1.1
> +--+--+
> | GW |
> +--+--+
> network B, 192.168.0.0 | 192.168.0.1
> ------+------------------+
> |
> +-------+------+
> | 192.168.0.3 |
> +--------------+
>
> Problem :
> ---------
> Internet cannot be reached from network B by a machine which has the
> address 192.168.0.3 (a laptop).
>
> Configurations :
> ----------------
> - All machines are under linux 2.4.7-10 (RedHat 7.2).
>
> - Of course GW can be reached from 192.168.0.3 perfectly well, and
> also GW can reach internet !


What kind of device is 192.168.1.2? I suspect its LAN side is set for
192.168.1.0/24 network and only accepts those IPs on its LAN side. So
network B either needs to be a subnet of network A, or the gw needs to
masquerade network B as an IP on network A.

In my case for example using your network gw settings:

eth0 192.168.1.1 (default netmask 255.255.255.0)
eth1 192.168.1.241 bcast 192.168.1.247 netmask 255.255.248
default gw 192.168.1.2
Proxy arp enabled on gw (so eth0 would answer for eth1 IPs):

echo 1 > /proc/sys/net/ipv4/conf/eth0/proxy_arp

Wireless AP 192.168.1.246 bcast 192.168.1.247 netmask 255.255.255.248
Laptop 192.168.1.245 bcast 192.168.1.247 netmask 255.255.255.248
default gw 192.168.1.241

Of course if you have more than a few wireless devices, you could use a
larger subnet for network B.

--
David Efflandt - All spam ignored http://www.de-srv.com/
http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
http://cgi-help.virtualave.net/ http://hammer.prohosting.com/~cgi-wiz/
 
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Configuring router with multiple subnetworks on same physical port Jane Linux Networking 5 10-14-2008 06:02 AM
forwarding gateway setup: force routes nirnimesh@gmail.com Linux Networking 2 09-11-2005 09:58 PM
Help! Multicast packages do not pass between subnetworks Leon Windows Networking 0 06-23-2005 07:43 AM
forwarding ssh connections through a gateway bad_knee Linux Networking 0 05-11-2004 06:30 PM
IP Forwarding problem David Suna Linux Networking 3 04-27-2004 12:23 AM



1 2 3 4 5 6 7 8 9 10 11