Routing traffic between two computers (3 network cards).

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have two computers Comp1 and Comp2 with one virtual machine with
local IP. How can I make rule that will route traffic between
Comp1-78.x.x.234  and  Comp2-188.x.x.111 so that I can access virtual
machine on Comp2. If I try to access Comp2 directly with rule bellow I
can reach machine on local IP 192.168.0.2 but I made rule to route
traffic in one direction (Comp1  to Comp2) but I don't know how to
link Comp2 to Comp1.

Comp1 - 78.x.x.234
*nat
-A PREROUTING -d 78.x.x.234/32 -j DNAT --to-destination 188.x.x.111
-A POSTROUTING -s 188.x.x.111/32 -j SNAT --to-source 78.x.x.234

Comp2 - 188.x.x.111 - this computer has virtual machine in host only
with local IP 192.168.0.2

*nat
-A PREROUTING -d 188.x.x.111/32 -m state --state
NEW,RELATED,ESTABLISHED -j DNAT --to-destination 192.168.0.2
-A POSTROUTING -s 192.168.0.2/32 -j SNAT --to-source 188.x.x.111


Regards,
Ante
--
To unsubscribe from this list: send the line "unsubscribe netfilter" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux