On Wed, Jan 16, 2008 at 12:58:08PM -0500, Justin Walker wrote:
> Hey everyone:
>
> I've got a 2-part problem I was hoping someone could help me with.
>
> I've got an old p2 machine running RHEL that's acting as a gateway 
> server/router (2 NIC's, daisy-chained to a big switch).  Everything works 
> fine with all the computers inside the network when they are using LAN IP's 
> (192.168.0.XXX).  However, I want to assign one of the computers inside the 
> network a university WAN IP (129.2.64.XXX).  I figured that I should be 
> able to just assign the IP to the machine and the gateway server would just 
> silently pass traffic though - but no dice.  If it's not on a LAN IP, it 
> can't see the network.  Does anyone know if there is a way to set this up?  
> A routing rule perhaps?

You have to enable ip forwarding:

echo 1 > /proc/sys/net/ipv4/ip_forward

Past that, as long as the computer knows about both networks, it will
route packets between the two machines (check `route` to make sure both
networks appear).

> Secondly, I want to forward WAN SSH traffic to a particular computer on the 
> LAN.  Does anyone know how to set up a port forwarding rule so I can 
> redirect all port 22 traffic to a particular LAN IP?  I know how to do it 
> on my home router, but I can't seem to figure it out for this old linux 
> box.

check out iptables with destination natting:

http://linux-ip.net/html/nat-dnat.html

good luck,

- Rob
.

Reply via email to