localcmd("sv_clientslots 255; deathmatch 1; coop 0; setrenderer sv; map dm4\n");
connecting to a friend's server requires that their firewall/nat forwards the packets to the server. the master server stuff requires that the server's NAT/router is reconfigured to have a static public/private port mapping, and that it does not act as a firewall on that port.
It is generally still possible to get a game going even if you're firewalled (so long as you NAT doesn't randomize ports), and without reconfiguring your NAT, by using fte's xmpp plugin. This requires that both users log into an xmpp account (which will automatically log in next time you start up the game, so beware of that). Once you're both logged in, there should be an option to join/invite your friends to your game (as well as enable voip without necessarily connecting to any server). Note that this isn't suitable for unattended dedicated servers.
By using an xmpp server as a relay, the two clients can share information and punch holes in both user's NATs. Typically at least one of you will have a NAT that opens up and lets the other through - its not guarenteed though, as I didn't get around to providing any support for proxies using this.
(I really ought to integrate this stuff into the irc plugin too so that this stuff doesn't need passwords)
if you both a gmail accounts, then you can use that. however, you will generally both need to disable 2-factor authentication. Strictly speaking its possible to connect using google's oauth2, but frankly its a nightmare to do - the only way to make this vaugely user friendly is to send your login details to a server under my control (instead of your client), which is utterly absurd, yay for snooping on everyone's accounts! Naturally this is something I refuse to do.
the dpmaster protocol (of which those three masters that you listed use), permits support for custom protocol names (master servers are sort of like a telephone directory service - they don't provide any actual games, they just tell you about other servers).
they will return ONLY the servers with a matching 'com_protocolname' cvar. There should be no spaces in it or anything (use hypens or underscores if needed).
If its set to the default value, FTE will also utilise quakeworld master server as well as a few NQ ones (which will not only list said servers but also expose your server to people looking for games via said qw master servers).
you can set sv_public 0 to disable the heartbeats, but it can take a while for the master and any clients to realise that your server is meant to be private.
you can implement your own server browser via some menuqc builtins to query the client's database.
so the answers to your two actual questions are:
'setrenderer sv' switches the renderer to the dedicated server. this will also disconnect the local client if you're currently running a map. 'setrenderer gl' can be used to switch back to gl. you might want to create an alias for that or something, so it has a more memorable name.
setting com_protocolname to the same value in both your client and server will make the client's server browser list display ONLY that server (assuming its unique, might need to restart the engine in order to ensure caches are fully purged).