how to setup port?

Reply

Join Date: Nov 2007
Posts: 227
Reputation: k2k is an unknown quantity at this point 
Solved Threads: 0
k2k k2k is offline Offline
Posting Whiz in Training

how to setup port?

 
0
  #1
Jul 13th, 2009
hi,
does anyone know how to setup a port# to each PC of my home network? say 192.168.1.1 is my gateway,, 192.168.1.2 is my linux machine. and my public ip is 1.2.3.4 ... how do i make my 192.168.1.2 a port#(ex: port# 10) so when i ssh from outside my home network, i can do something like "1.2.3.4:10" ?


thanks very much
Reply With Quote Quick reply to this message  
Join Date: Feb 2009
Posts: 3,301
Reputation: sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of sknake has much to be proud of 
Solved Threads: 588
Sponsor
sknake's Avatar
sknake sknake is offline Offline
.NET Enthusiast

Re: how to setup port?

 
0
  #2
Jul 13th, 2009
Its called port forwarding or NAT and the implemention depends on what type of router you have. If your router is a linux router you can use iptables:

  1. #!/bin/sh
  2. iptables -t nat -F
  3. iptables -t filter -F
  4. iptables -t nat -I PREROUTING -i eth0 -d 1.2.3.4 -p tcp --dport 10 -j DNAT --to-destination 192.168.1.2:10
  5. iptables -t nat -A PREROUTING -d 1.2.3.4 -j ACCEPT
  6. iptables -t nat -A POSTROUTING -s 192.168.1.0/255.255.255.0 -j SNAT --to-source 1.2.3.4

If you have a netgear, linksys, etc firewall then you should be able to set up forward rules through the GUI on the router @ http://192.168.1.1
Scott Knake
Custom Software Development
Apex Software, Inc.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Domains and DNS Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC