你说的是内网穿透吧,没试过树莓派,但是用openwrt系统的路由器做过,用的Ngrok免费服务
树莓派可以参考这个http://shumeipai.nxez.com/2014/01/04/the-raspberry-pi-using-ngrok-web-mapping-services-to-the-public-network.html
你网上找找看ngrok的资料教程
这要使用域名解析吧。花生壳不行么?
或,参考于:https://www.zhihu.com/question/42433730/answer/94449975