LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 07-10-2005, 05:26 AM   #1
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,230

Rep: Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724
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
 
Old 07-10-2005, 05:51 AM   #2
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,230

Original Poster
Rep: Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724
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
 
Old 08-20-2008, 07:09 AM   #3
nuci786
LQ Newbie
 
Registered: Aug 2008
Posts: 3

Rep: Reputation: 0
Question lan card

how we can install a lan card by command mode
 
Old 08-25-2008, 03:55 AM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Stupid question about NAT Led*Zep Linux - Security 2 11-11-2005 09:52 AM
nat question gubak Linux - Networking 2 03-01-2005 06:54 AM
please confirm NAT question. musicman_ace Linux - Networking 3 06-02-2004 02:43 AM
NAT newbie question Citizen Bleys Linux - Networking 4 09-26-2003 11:52 AM
NAT startup question WorldBuilder Linux - Networking 4 05-15-2003 10:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 03:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration