You would need to log into the VIRL VM (probably with ssh) to make those changes. Those are Linux instructions.
I am not familiar with packet but for my vmware version after I boot the VM it displays the IP address which I would use to "ssh virl@IPADDRESS". The default password for this is "VIRL" if you or packet haven't changed it. Then you can run the following command "sudo nano /etc/rc.local"
I managed to work out how to edit this file based on the Information you gave me, I couldn't get SSH to work, however I did find a console in UWM > Virl Server > System Tools > Console where I was able to login with the credentials you advised, and managed to edit the file from there witht the command you suggested.
Still haven't got Internet access though - I'll keep working on that.
That's excellent news. You should probably check if the rule actually got added. You can list the rules with "sudo iptables -L". The other thing that comes to mind is did you use the default address space of 172.x.x.x ? I don't know if that's an option you can change on packet but it is one of the things you need to configure on the vmware version.