Page 2 of 2
Re: Unable to ping default gateway and no internet connection
Posted: 12. Nov 2020, 06:22
by kkaito
fth0 wrote:I've just noticed something that was hiding in your information from the beginning:
The Kali Linux guest reports a different MAC address for
eth0 each time (mine doesn't, BTW). Since your .vbox files showed that you've configured MAC addresses with the "VirtualBox" OUI (08:00:27), I'd guess that Kali Linux uses randomized MAC addresses for privacy reasons. Try to prevent this and see if your problem persists.
I've written @reboot macchanger -rb eth0 in my root crontab and once i deleted it and reboot, everything seems working again.
But for my Parrot OS, i'm pretty sure i did not add this line to my crontab and it seems working again as well. I cannot tell why i faced this issue.
Anyway, thanks for your help!
BTW I really want to use random mac address every time i reboot, is there any way to do it and will not cause the same issue.
I'm sure this line in crontab is correct without any mistake as i did the same thing on my ubuntu host.
Re: Unable to ping default gateway and no internet connection
Posted: 12. Nov 2020, 09:24
by fth0
kkaito wrote:BTW I really want to use random mac address every time i reboot, is there any way to do it and will not cause the same issue.
I cannot give you a definite answer on that, but I'd guess that the VirtualBox source code would have to be changed for that. If this would be a simple bug fix or rather a design change, I don't know. You could search the
Bugtracker and create a ticket if there isn't one already.
Re: Unable to ping default gateway and no internet connection
Posted: 12. Nov 2020, 17:34
by scottgus1
kkaito wrote:But for my Parrot OS, i'm pretty sure i did not add this line to my crontab and it seems working again as well. I cannot tell why i faced this issue.
I suspect Virtualbox might not expect or be programmed to allow a guest OS to change what Virtualbox says the MAC address should be. If the inside-the-guest command bunged the connection to the NAT network inside Virtualbox's code, then the whole NAT network might go down, affecting Parrot too.
kkaito wrote:I really want to use random mac address every time i reboot
You will need a startup script on your host PC to start the guest, but this might help, and stick within Virtualbox's known methods of assigning MAC addresses:
vboxmanage modifyvm "vm name" --macaddress<1-N> auto|<mac>
vboxmanage startvm "vm name"
<1-N> and <mac> should just be the adapter number by tab that is connected to the NAT network, and the MAC address, not including the <>'s.
When you want to reboot the guest and change the MAC address, shut down the guest instead and restart from the script.