943,536 Members | Top Members by Rank

  • Networking Discussion Thread
  • Unsolved
  • Views: 503
  • Networking RSS
Jul 13th, 2009
0

how to setup port?

Expand Post »
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
Similar Threads
k2k
Reputation Points: 15
Solved Threads: 1
Posting Whiz
k2k is offline Offline
351 posts
since Nov 2007
Jul 13th, 2009
0

Re: how to setup port?

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:

bash Syntax (Toggle Plain Text)
  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
Featured Poster
Reputation Points: 1749
Solved Threads: 735
Senior Poster
sknake is offline Offline
3,948 posts
since Feb 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Networking Forum Timeline: Cannot install HWREG1 Hawking Wireless G Range Extender
Next Thread in Networking Forum Timeline: Twittering Trojans Batman





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC