For Lan parties, not online or ranked servers - In the bf2 demo you could hexedit Bf2_w32ded.exe at offset 0001CECC, changing it from hex value 40 (64 players) to something like hex value 80 (128 players (!)) - with a few other tweaks required on the launcher etc.,
Obviously you could try something similar if you have full access to the a fast LAN server - there's plenty still on google about this.
Although back in the days of the demo, EA had a little hissy fit about people doing it. :P
The largest I've been on was 88 players