I'm using Mac for web development and I need few additional loopback IPs for my dev websites, so in terminal I used this:

sudo ifconfig lo0 alias 127.0.0.2 up
sudo ifconfig lo0 alias 127.0.0.3 up

and it worked great. Hovewer, after shutting down Mac and then starting it again, those loopback IPs were lost and I had to add them again.

Is there a way to automatically run these commands on Mac start, preferably without it asking for my password every time?

P.S. I'm new to Macs, I've been using it only for 4 days, so I have no clue about config files, startup files, etc...