From the SRB2 Wiki:
To host a netgame, there are several necessary procedures you must follow:
First and foremost, you must have UDP port 5029 open.
This webpage explains how this works. If you cannot host using this port, you can use a different UDP port; in this case, you must use the
command line parameter -port to specify which port you are using, so that the Master Server can send joiners to the proper port. Note that port numbers above 9999 cannot be used.
Once this is done, hosting your game is simple: go to the Multiplayer menu in SRB2, select the "Host Game" option, and choose your settings. If you want to advertise your game on the Master Server, choose the "Room" option and then select the room you want your server to be listed in. This will allow people to search for your game and join it. If you want the game to be private, leave the "Room" option set to "<Unlisted>" – this will only allow people who know your IP address to join your server if they know you are hosting. If you need to tell someone your public IP address and you don't know it,
this site can help you. Your IPv4 address is what you want, IPv6 does not currently work.