Uhm, there's ifconfig
missing. But as you are getting the expected result, that's probably just a copying error?
Sorry for the late reply.
Yes, the ifconfig got lost when transcribing. At the time drafting a response, there was no communication between host and guest, no way to transfer the configuration file. I transcribed this line of code and obviously overlooked it.
BTW, the dots here (also shown in the manpage) are some kind of cargo cult. Their origin is buggy shells where the (nowadays typically builtin) test
can't correctly compare equality if one side is empty. This certainly doesn't apply to FreeBSD's /bin/sh. They are (or, IMHO, were) only required to make a script portable to some ancient Unix systems that had such a buggy shell.
I wish I knew what you are talking about. Nevertheless, I appreciate the detailed information on this topic. I'm sure others appreciate it also, thank you for taking the time. Maybe in the future I will understand what it is all about.
This also applies to other topics. I may not log in to like or thank you, but I do follow many of your posts with interest, as I do with other forum users.
I'm pretty sure this is not related to dhcp, there must be some other networking issue...
It looks that way. As said, I'm testing in a VM, VirtualBox VM to be precise. The VMs network adapter is attached to a bridged adapter, a wireless device (wlan0) in my case.
Consulting the VitualBox manual I found a note regarding
6.5. Bridged Networking
...
Note
Bridging to a wireless interface is done differently from bridging to a wired interface, because most wireless adapters do not support promiscuous mode. All traffic has to use the MAC address of the host's wireless adapter, and therefore Oracle VM VirtualBox needs to replace the source MAC address in the Ethernet header of an outgoing packet to make sure the reply will be sent to the host interface. When Oracle VM VirtualBox sees an incoming packet with a destination IP address that belongs to one of the virtual machine adapters it replaces the destination MAC address in the Ethernet header with the VM adapter's MAC address and passes it on. Oracle VM VirtualBox examines ARP and DHCP packets in order to learn the IP addresses of virtual machines.
Apparently when the MAC address in a VirtualBox VM is spoofed, a network adapter attached to a bridged adapter needs to allow promiscuous mode.
Setting the VMs network bridged adapter (wlan0) to allow promiscuous mode restores communication with the internet (couldn't try with a wired interface, there is no hardware I can connect to the machines (laptop) Ethernet port).
But communication between host and guest remains interrupted, couldn't figure out why, haven't looked into it further.
Modifying promiscuous mode settings of a running VM modifies the hosts network interface instantly, and no reboot of the VM required:
Rich (BB code):
wlan0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500