2009年3月18日 星期三

use miniupnpc-1.2 to map port on ARM

#use upnpc to map port 2222 to 80 port
# router internal ip is 192.168.2.1
# ARM9 ip is 192.168.2.33
/mnt/upnpc-1.2/bin $ route add -net 0.0.0.0 gw 192.168.2.1
/mnt/upnpc-1.2/bin $ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.2.0 * 255.255.255.0 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 192.168.2.1 0.0.0.0 UG 0 0 0 eth0

/mnt/upnpc-1.2/bin $ ./upnpc -a 192.168.2.33 80 2222 tcp
upnpc : miniupnpc library test client. (c) 2006-2008 Thomas Bernard
Go to http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
for more information.
List of UPNP devices found on the network :
desc: http://192.168.2.1:80/igd.xml
st: urn:schemas-upnp-org:device:InternetGatewayDevice:1

Found valid IGD : http://192.168.2.1:80/upnp/control?WANIPConnection
Local LAN ip address : 192.168.2.33
ExternalIPAddress = 61.230.49.126
InternalIP:Port = 192.168.2.33:80
external 61.230.49.126:2222 TCP is redirected to internal 192.168.2.33:80
/mnt/upnpc-1.2/bin $

沒有留言: