Running a sudo command on startup
You can create a LauchDaemon. LaunchDaemons are processes managed by the launchd service in macOS that are loaded when the system boots. LaunchDaemons can be used to run a program one-time, contiuously or periodically after boot. 

Create a file called org.my.ifconfig.plist in /Library/LaunchDaemons/
with the following content and you should be good to go.

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"&gt;
&lt;plist version="1.0"&gt;
&lt;dict&gt;
    &lt;key&gt;Label&lt;/key&gt;
    &lt;string&gt;org.my.ifconfig&lt;/string&gt;
    &lt;key&gt;RunAtLoad&lt;/key&gt;
    &lt;true/&gt;
    &lt;key&gt;Nice&lt;/key&gt;
    &lt;integer&gt;10&lt;/integer&gt;
    &lt;key&gt;ProgramArguments&lt;/key&gt;
    &lt;array&gt;
      &lt;string&gt;/sbin/ifconfig&lt;/string&gt;
      &lt;string&gt;lo0&lt;/string&gt;
      &lt;string&gt;alias&lt;/string&gt;
      &lt;string&gt;someIp&lt;/string&gt;
    &lt;/array&gt;
&lt;/dict&gt;
&lt;/plist&gt;


Make sure the file is owned by root and in the group wheel, and has the permissions 644: Owner – read/write, group – read, everyone – read

More information can be found at developer.apple.com at Creating Launch Daemons and Agents.