Setting up port forwarding for NAT

UPDATED: Answer below!

I’m ready to run my node, and as I’m behind NAT, I need to set up port forwarding for any ports the miner is listening at. Every time I start up, I see two new UDP ports listening, but they are different every time. I don’t see any obvious way to declare what port(s) I want to listen at, so I’m not sure what ports I should be forwarding UDP traffic to my machine. Does the —bind flag figure in here? (I could happily edit my run_nockchain_miner.sh script.) Should I be expecting to forward a range? Appreciate any guidance.

I’m pretty sure I figured it out! I edited the last line of scripts/run_nockchain_miner.sh to read

nockchain --mining-pubkey ${MINING_PUBKEY} --mine --bind /ip4/0.0.0.0/udp/3299/quic-v1

and I could confirm it’s listening at UDP port 3299. Now I just need to set up my port forwarding and I bet I’m in business!

2 Likes

wow please let us know if you get this to work!

Yes, it worked great! I let it run for a while as it picked up peers and blocks, but after a bit I killed it and decided to go with a two-node setup after all — this decision was based on memory and CPU usage, although I know those characteristics may change once I’m out of the “catching up on old blocks” mode and into “mining in earnest” mode :grin:

(I’m actually behind a double NAT, but with my configured port bindings (1 for each miner: I’m using two different copies of the startup script with the node-specific port indicated in each) and punching a hole for both ports thru the back-to-back routers in my house, the blocks are flowing!)

2 Likes