If you want to simulate a 1000 node bitcoin network on your private LAN network, there are some things that you need to keep in mind before jumping on to coding. The most effective way to simulate a 1000 node bitcoin network is to sandbox them before connecting them to the LAN.
Also, specify unique ports while listening and specify the rpcport while using RPC for each node. Additionally, specify unique data directories for all nodes individually.
If you are doing it for the first time, you can use the mkdir command to create directories.
mkdir $HOME/regtest/X/
mkdir $HOME/regtest/Y/
mkdir $HOME/regtest/Z/
Once done, you can modify and further execute the bash script. Note the port numbers to connect to each other in round-robin in the next round.
#!/bin/bash
bitcoind -server -listen -port=17590 -rpcuser=<user> -rpcpassword=<pass> -rpcport=16590 -datadir=$HOME/regtest/X/ -addnode=localhost:17591 -regtest -pid=$HOME/regtest/X/ -daemon -debug
bitcoind -server -listen -port=17591 -rpcuser=<user> -rpcpassword=<pass> -rpcport=16591 -datadir=$HOME/regtest/Y/ -addnode=localhost:17592 -regtest -pid=$HOME/regtest/Y/ -daemon -debug
bitcoind -server -listen -port=17592 -rpcuser=<user> -rpcpassword=<pass> -rpcport=16592 -datadir=$HOME/regtest/Z/ -addnode=localhost:17590 -regtest -pid=$HOME/regtest/Z/ -daemon -debug
In the question, you have also mentioned that you want to research peer discover. So, for different use cases you may use, and note the difference between - connect and - addnode.