1.更改lotus配置文件
修改$LOTUS_PATH/config.toml中的内容:
将ListenAddresses中的端口改为内网的端口,如5333,IP为0.0.0.0不用改;
nat网络中做端口映射53330 -> 192.168.10.1:5333
将AnnounceAddresses中的IP改为公网IP,如111.111.73.12,端口改为公网端口53330。
[Libp2p]
ListenAddresses = ["/ip4/0.0.0.0/tcp/5333", "/ip6/::/tcp/0"]
AnnounceAddresses = ["/ip4/111.111.73.12/tcp/53330"]
2.重启lotus Daemon,查看lotus的连接地址:
lotus net listen