I need to access a Linux box via SSH & Samba that is hidden/connected behind another one on its own local network.
A switch B C
|----| |---| |----| |----|
|eth0|<-->| |<-->|eth0| | |
|----| |---| |eth1|<-->|eth1|
Eg, I need to SSH/Samba from A to C
How does one go about this?
I was thinking that it cannot be done via IP alone? Or can it?
Could B say "hi on eth0, if your looking for 192.168.0.2, its here on eth1"?
Is this NAT?
This is a large private network, so what about if another PC has that IP?!
More likely it would be PAT?
A would say "hi 192.168.109.15:1234"
B would say "hi on eth0, traffic for port 1234 goes on here eth1"
How could that be done?
And would the SSH/Samba demons see the correct packet header info and work??
IP info :-
A - eth0 - 192.168.109.2
B - eth0 - 192.168.109.15
- eth1 - 192.168.0.1
C - eth1 - 192.168.0.2
A, B & C are RHEL (RedHat)
But Windows computers can be connected to the switch.
I configured the 192.168.0.* IPs, they are changeable.
So I have read that this should be done via iptables
But what is the correct command line to do this?
And where does one put permanent iptable config?