1 |
On Sat, 17 Feb 2007 21:22:16 +0100 |
2 |
Roman Naumann <sapiens.dyslexia@××××××××××.com> wrote: |
3 |
|
4 |
> Hi, please forgive this most probably very simple question, but I |
5 |
> cannot find the correct configuration file to enable routing... |
6 |
> |
7 |
> I have two PCs, one HAS a internet connection to the internet-proxy, |
8 |
> the other one hasn't. |
9 |
> The internet-pc (and I do not mean the proxy-pc) has two ethernet |
10 |
> devices, ra0 and eth0. |
11 |
> |
12 |
> eth0 connects it with the non-internet pc. |
13 |
> |
14 |
> I set up a route to the internet-proxy-px on the internet-pc and it |
15 |
> works fine on it, but the the non-internet pc can't use it! |
16 |
> |
17 |
> Even though the non-internet pc has it's default gw set to the eth0 |
18 |
> ip of the internet pc. |
19 |
> |
20 |
> Thanks for your help. |
21 |
"Michal 'vorner' Vaner" was basically correct. |
22 |
|
23 |
PC2 is now a router, and in its tasks are included not only forwarding |
24 |
packets from PC3 to the outside world, but also forwarding them back to |
25 |
PC3. In the routing table PC2 will need routes to PC3 through eth0, |
26 |
and the same default it has now. Without the right routes, PC2 will |
27 |
try to respond to PC3 through ra0, the default route (I assume). Here |
28 |
is an annotated routing table from a router of mine. |
29 |
>zeus ~ # route |
30 |
>Kernel IP routing table |
31 |
>Destination Gateway Genmask Flags Metric Ref Use |
32 |
>Iface |
33 |
>192.168.1.0 * 255.255.255.0 U 0 0 0 eth1 |
34 |
you can see there the route to the subnet it's plugged into, doesn't |
35 |
need to go through the default rout below. |
36 |
>192.168.10.0 * 255.255.255.0 U 0 0 0 eth0 |
37 |
there's the subnet it forwards for, you'll notice it's different. In |
38 |
my case. There must of course be some way to distinguish between them |
39 |
for routing purposes, but you could also route to a host specifically. |
40 |
>loopback * 255.0.0.0 U 0 0 0 lo |
41 |
>default davey.spore.ath 0.0.0.0 UG 0 0 0 eth1 |
42 |
theres where all other traffic goes, through my internet firewall. |
43 |
|
44 |
However the same is true of the default router davey from the lastline |
45 |
above. |
46 |
>davey ~ # route |
47 |
>Kernel IP routing table |
48 |
>Destination Gateway Genmask Flags Metric Ref Use Iface |
49 |
>192.168.2.0 * 255.255.255.0 U 0 0 0 ath0 |
50 |
it routes to a wireless network just like PC1/PC2 in your configuration. |
51 |
>192.168.1.0 * 255.255.255.0 U 0 0 0 eth0 |
52 |
and same as before, for route to the subnet it's plugged into. |
53 |
>c-24-245-14-0.h * 255.255.255.0 U 0 0 0 eth1 |
54 |
for comcast, my cable company's subnet im plugged into |
55 |
>192.168.10.0 zeus.spore.ath. 255.255.255.0 UG 0 0 0 eth0 |
56 |
for the subnet above, this is what im talking about. |
57 |
>loopback * 255.0.0.0 U 0 0 0 lo |
58 |
yep |
59 |
>default c-3-0-ubr02.eag 0.0.0.0 UG 0 0 0 eth1 |
60 |
and by default, out the cable modem on eth1. |
61 |
|
62 |
this last part is probably the problem Roman Naumann has or had. |
63 |
|
64 |
Don't forget you must enable ip forwarding if you desire to use it: |
65 |
>zeus ~ # cat /proc/sys/net/ipv4/ip_forward |
66 |
>1 |
67 |
here you can see that ip_forward is set to 1 to indicate that i wish to |
68 |
enable forwarding for other computers. To set it as such, command the |
69 |
computer thusly. |
70 |
>zeus ~ # echo 1 > /proc/sys/net/ipv4/ip_forward |
71 |
|
72 |
|
73 |
-- |
74 |
gentoo-user@g.o mailing list |