LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Nat Question (https://www.linuxquestions.org/questions/linux-networking-3/nat-question-341797/)

keefaz 07-10-2005 05:26 AM

Nat Question
 
Hello,

Given this network topology:
Code:

                              [INTERNET]
                                  |
                                  |
            [ROUTER A eth0: 80.236.126.126 eth1: 10.0.0.138]
                                  |
                                  |
---[PC 10.0.0.1]---[PC 10.0.0.2]---+---[ROUTER B eth0: 10.0.0.3 eth1: 192.168.0.1]
                                                    |
                                                    |
                                  [PC 192.168.0.2]---+---[PC 192.168.0.3]

And the following rules for ROUTER B :
Code:

iptables -A FORWARD  -i eth1 -o eth0 -m state --state NEW,ESTABLISHED,RELATED  -j ACCEPT
iptables -A FORWARD  -i eth0 -o eth1 -m state --state ESTABLISHED,RELATED      -j ACCEPT
iptables -A POSTROUTING -t nat -o eth0 -j SNAT  --to-source 10.0.0.3

It is possible for [PC 192.168.0.2] to connect to [PC 10.0.0.1] with ssh

The question is :
Is there a way for [PC 10.0.0.1] to connect to [PC 192.168.0.2] with ssh ?

Thanks for reading

keefaz 07-10-2005 05:51 AM

Ok, I found a way...

On the [PC 10.0.0.1] running mac osx, I add the 192.168.0.0 network as :
Code:

route add -net 192.168.0/24 10.0.0.3
And on [ROUTER B], I added the rules :
Code:

iptables -A FORWARD  -i eth0 -o eth1 -m state --state NEW,ESTABLISHED,RELATED  -j ACCEPT
iptables -A FORWARD  -i eth1 -o eth0 -m state --state ESTABLISHED,RELATED      -j ACCEPT
iptables -A POSTROUTING -t nat -o eth1 -j SNAT  --to-source 192.168.0.1

I wanted to not make change on the [PC 10.0.0.1] net config though,
but if it works only with this way, that's not a problem

nuci786 08-20-2008 07:09 AM

lan card
 
how we can install a lan card by command mode

david_ross 08-25-2008 03:55 AM

nuci786, please don't hijack old threads, if you would like to ask a new question please start a new thread in the appropriate forum.


All times are GMT -5. The time now is 10:12 PM.