小米无线路由器 + ubuntu + upnpc = 直接映射自己的端口

公网地址那么少,都是内网的机器,可是有的时候还是需要端口映射的,但是一个一个打开网页去弄还真是有点麻烦,于是想到了upnp。

ubuntu

apt-get install -y miniupnc

命令

upnpc -a 192.168.31.176 9000 9000 TCP

成功后的结果是

ops@ops-MS-7732:~$ upnpc -a 192.168.31.176 9000 9000 TCP
upnpc : miniupnpc library test client. (c) 2005-2014 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.31.1:5351/rootDesc.xml
 st: urn:schemas-upnp-org:device:InternetGatewayDevice:1

Found valid IGD : http://192.168.31.1:5351/ctl/IPConn
Local LAN ip address : 192.168.31.176
ExternalIPAddress = xxxxx
InternalIP:Port = 192.168.31.176:9000
external xxxxx:9000 TCP is redirected to internal 192.168.31.176:9000 (duration=0)

记得要打开路由器的upnp功能

之前没有打开,就会报错

我用的是小米的无线无线路由器。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值