I need to access a Linux box via SSH & Samba that is hidden/connected behind another one.
A switch B C |----| |---| |----| |----| |eth0|----| |----|eth0| | | |----| |---| |eth1|----|eth1| |----| |----|
Eg, SSH/Samba from A to C
How does one go about this?
Could B say "hi on eth0, if your looking for 192.168.0.2, its here on eth1"?
More likely it would be PAT?
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.
asked 28 Apr '10, 17:02
What you have termed PAT would work. You will need to have iptables running(or some customizable firewall). Then run the following commands:
In the file /etc/sysctl.conf, change the line:
answered 29 Apr '10, 17:22
Can you ssh into box B and then do another ssh into box C from there? Or does that not solve your specific problem?
EDIT (In response to the comment from Ian Vaughan): Have you looked at the route command to set up a default route, try route --help at the command line for more info (or possibly man route).
PAT would work for SSH.
For Samba try this:
when C announces its presence to A, stations in A's segment (those connected to the switch) will see it using A as the master browser.
smb broadcasts cannot normally traverse network subnets so 'remote announce' makes a server known to another server (and likewise stations) in another subnet.
B should be the default gateway for stations on both sides so packets gets properly routed. If not, static routes need to be setup in each station.
This works both ways: if there are stations in the C segment that need to access server A, A should 'announce' itself to C.
Hope this helps.
answered 11 May '10, 20:12
Your host B is known as a dual homed host. You need for B to route traffic between subnets 192.168.0 and 192.168.109 Configure C (and any other hosts on 192.168.0 subnet) to use 192.168.0.1 as default gateway. Configure B to use the switch as default gateway (probably already is) Configure B to route subnet 192.168.0 traffic out 192.168.0.1 Configure your switch to route subnet 192.168.0 traffic to 192.168.109.15 That will make subnet 192.168.0 accessible to all routable traffic.
You can then use firewall features in the switch and/or in B to obtain the security restrictions you want.
answered 13 Apr '11, 09:11