Ventura docs for M2 Macs in this comment: https://gist.github.com/henrik242/65d26a7deca30bdb9828e183809690bd?permalink_comment_id=4555340#gistcomment-4555340
Old Monterey docs in this old revision: https://gist.github.com/henrik242/65d26a7deca30bdb9828e183809690bd/32c410e3a1de73539c76fa13ea5486569c4e0c5d
Solution for Sonoma: https://gist.github.com/sghiassy/a3927405cf4ffe81242f4ecb01c382ac
Did this work correctly, coz I'm using an intel MacBook Pro 2018 and I was constantly getting this MDM Enrollment notification pop up on sonama and one day the pop up won't go, It stayed there with no option to cancel.
Then I wiped the disk and went back to Mojave, then I've come back to Ventura following the steps mentioned in your post, setting the IP address of the mentioned websites to 0.0.0.0.
Now can I upgrade to Sonama??