I have Thre machines. A, B, C
A and B are connected directly to internet.
Both A and B have 2 networkcards and are connected to C on a local
A is running ipmasquerading So machine C can reach internet.
(Machine B is also running ipmasqueradeing but machine C has machine A as
It looks like this:
Machine A: eth1 130.X.Y.Z eth0 10.0.0.2
Machine B: eth0 130.X.V.W eth1 10.0.0.3
Machine C eth0 10.0.0.4
The network works fine. But I have one problem.
If I try to forward some ports from Machine A to Machine C it works fine.
(/usr/sbin/ipmasqadm portfw -a -P tcp -L 130.X.Y.Z 80 -R 10.0.0.4 80 -p
But It does't work to forward the port to Machine B (10.0.0.3)
I have a www-server running and working on port 80 at Machine B and I can
reach it from Machine A.
It doesn't work To forward port 80 from Machine B to Machine C.
If I try to telnet to port 23 on machine B from machine A I get
connection, but If I do a
/usr/sbin/ipmasqadm portfw -a -P tcp -L 130.X.V.W 25 -R 10.0.0.4 25
If I use the same command from Machine A I can telnet to port 25 from
machine B and get forward to Machine C and port 25.
Machine A and B are using the same Kernel and has the same Network and
IP-Masquerading configurations .Someone told me that the problem can be that The packets from B to the world don't go through A,
so they cannot be properly "demasqueraded".
I've heard that mabe It can be solved like this:
Assign another 10.x.x.x IP address to the machine C and forward
(possilbly more) ports from machine B to this new IP address of machine
C. And then setup "routing-by-source" on machine C, which says that the
packets which have the new local IP addres should be routed via machine
B instead of machine A, which is the default gateway otherwise.
How can I set up this routing by source?? Can someone help me??