I am uncertain what your particular setup looks like.
But assuming you have a router that has the public static IP, then you can forward any particular port to any other host on the local network that is behind your router. In Linux firewalling terms this is called destination NAT (network address translation) but many routers call it “port forwarding”. Basically you configure your router so that any traffic destined for your public IP on say port 3001 should be forwarded to your relay PC on your local network.
Here is an example:
Router has your public IP on eth0 and 192.168.0.1 on eth1 which is connected to your LAN via a switch.
Relay1 is connected to router via LAN and has IP 192.168.0.2 with cardano-node running on port 3001.
BP is connected to router via LAN and has IP 192.168.0.3 with cardano-node running on port 3001.
You configure your router to forward any traffic destined to your public IP on port 3001 to 192.168.0.2 (relay1) port 3001.
You configure your BP topology file like this (assuming P2P mode):
{
"localRoots": [
{ "accessPoints": [
{ "address": "192.168.0.2", "port": 3001 }
]
, "advertise": false
, "valency": 1
}
]
, "publicRoots" : []
}
IE: The only localRoot is your relay1 and it has NO publicRoots.
You configure your relay1 topology file like this (assuming P2P mode):
{
"localRoots": [
{ "accessPoints": [
{ "address": "192.168.0.3", "port": 3001 }
]
, "advertise": false
, "valency": 1
}
]
, "publicRoots" : [
{ "accessPoints": [
{ "address": "backbone.cardano-mainnet.iohk.io", "port": 3001 }
, { "address": "backbone.cardano.iog.io", "port": 3001 }
, { "address": "backbone.mainnet.emurgornd.com", "port": 3001 }
]
, "advertise": true
}
]
, "useLedgerAfterSlot": 110332824
}
IE: localRoot is your BP. It will obtain publicRoots using the P2P mechanism using the IOHK nodes and the registered relays of other stake pools recorded in the pool certificates on the blockchain.
Then when you register your stake pool certificate on-chain your provide your relay address as your Public static IP address with port 3001.
This way any other relays on the Cardano network will be able to connect to your relay1 by contacting your public static IP port 3001 and this traffic will be forwarded by your router to relay1 on your local network. Your BP can connect directly to relay1 and relay1 can connect directly to BP both via your LAN switch. Nobody from the internet can directly connect into your BP since you are not forwarding any ports from your router to it. You should ensure your router firewall is blocking all other ports you don’t provide a public service for.
If this is the sort of setup you envisioned then you really should eventually get a second relay. This second relay should be on a different IP preferably with a different service provider. You might want to use a friend who has a separate reliable internet connection or rent a virtual machine from a cloud VPS provider. When you setup your relay2 you will need to configure some additional port forwarding to enable it (and only it) to directly connect into your BP. You will also need to update your BP topology file to include the address of this relay2.