MDNS not advertising the network interface after network restart in systemd - embedded-linux

In systemd, MDNS (avahi-daemon) stops broadcasting the network interface after the network restart. However, for the same scenario, in system init, MDNS will work perfectly normal.
Tried:
Changed the avahi-daemon configuration file
restart the avahi-daemon after restarting the network
Checked the firewall (no firewall)
Tried systemd-resolved
Changed hostapd configuration

I am so glad that I have it figured out. The reason why the MDNS stopped broadcasting is because the interface didn't properly restart.
In systemd, after the network restarts, it requires a reload of the configuration manually to generate an IP address. So after restarting the network, manually reloading the network interface configuration by ifconfig interface down and ifconfig interface up (interface need to be replaced by the real interface name).
Also, purely doing a ifconfig interface up won't work. The network interface probably has a cache. So bring the interface down ifconfig down can help remove the cache.
Please correct me if any of the description above is wrong. Thanks.

Related

Hyper-V - No Guest Internet

I'm using a Windows Server 2019 server from Microsoft Azure. I have installed Hyper-V with the management tools and am now trying to setup a Ubuntu 14.04LTS VM inside of Hyper-V. I create a new External Switch however when setting up the Ubuntu instance there it tells me that there is an issue with the DHCP server. When I check my network connections for the newly created switch there is IPV4 connectivity, with packets being sent and received.
Things that I have tried:
-Ensured that inside of the Virtual Switch Manager that in my newly created virtual switch, the external network is selected as my main internet adapter. And that the "Allow management os to share this network adapter".
-Tried selecting "Internal Network"
-Inside of the ubuntu server, tried dchlient -r and dhclient eth0 to try to retrieve a new IP (For internal network this has worked, but without internet access, for external ip it hangs on the command dhclient eth0)
-In Network Connections I have tried bridging the two connections (out of desperation, "bricks" the vps causing me to not be able to rdp, must create a new azure vm)
-I have tried right clicking the main "ethernet" inside the Network Connections and allowing sharing options to other users.
Please help as I'm quite lost as to why the Ubuntu Guest is not connecting to the internet with the new network switch
The virtual switch connection types are very confusingly named, and sharing is somewhat flaky. I've had best results with the Internal Network. Most of the time it just works but there are certain situations when the NAT service breaks and you will have to restart some combination of the host and guest machines, possibly both -- I've not found a way to just restart the virtual switch service without restarting the host OS.
If you need to use the External Network type, be aware that your actual physical router will be in the mix, so you must make sure that it is properly configured, especially if you're doing MAC filtering on your router and the guest is not using the hardware MAC. This usually happens because of the virtualisation process itself, even if it's not something you've configured in the guest.

Devilbox Auto DNS on Windows

I started using devilbox (https://github.com/cytopia/devilbox) which gives me a great and really easy to setup LAMP server.
Following the docs for Windows Auto DNS, you should make 127.0.0.1 your default DNS of your "active network adapter". However:
Setting DNS in my Wireless Adapter works but leads to losing Internet Access when docker/devilbox isn't running (as the DNS Server isn't running at this point)
Setting it on vEthernet Adapter (Hyber-v Virtual Ethernet adapter, probably created by Docker) works too but resets itself upon restarting
Setting it within Docker > Dashbord > Settings has no effect at all (probably because it is only for within docker and not on the
host)
I can eighter set the alternate DNS in Solution 1 to e.g. 8.8.8.8 OR I have to edit DNS the vEthternet everytime I start devilbox. I therefore highly suspect that I'm missing something, and as the official docs are thin on this topic:
How can I setup Devilboxes DNS for Windows permanently?

How to see the interfaces set up with virtualbox when using vagrant

I've set up a default vagrant setup, and I'd like to be able to find out what i can from the host about the guest.
For virtualbox setups, what happens is there are some pseudo interfaces that you can use to route and firewall the guest outgoing connections. But, when using vagrant, i noticed the availability of a private space eth0 which is NATted through the host interface. Searching using iproute2 and looking through the procfs does not show any interface at all.
A while back I found the vbox driver bypasses all the usual methods to inspect interfaces from the host machine. Is there a way to find out more about the interfaces on the guest from the host, and which chain should i target to firewall traffic from this?
Strangely just to answer: to find the existence of the ip address in procfs, you'll have to check the /proc/net/fib_trie. Unfortunately, anecdotally, this doesn't work on some procfs.

hostapd recent version issue, cannot set to AP mode while wpa_supplicant is running

So I had been working on a project that is able to setup an Access Point and redirect traffic through another interface (can be wired or wireless).
Now there have always been issues between hostapd and wpa_supplicant, I needed to create an access point on one wireless interface and route it through another wireless interface. But while that interface is managed by network-manager hostapd is unable to start an access point on that interface.
Ways to work around:
I can run these commands and kill wpa_supplicant
sudo nmcli nm wifi off
sudo rfkill unblock wlan
But this turns off all wireless interfaces and I need one connected to the internet so I can route the traffic.
Another work around, which I used and is a lot more elegant:
adding this line to the NetworkManager.conf file
[keyfile]
#unmanaged-devices=mac:d8:5d:4c:9a:72:60
This actually worked flawlessly!
Until a recent update of hostapd to version 1:2.5-2+v2.4-3
Are there any other workarounds so that my wireless interface is not managed by wpa_supplicant?
I'm running Kali Linux.
Okay so for anyone having the same issue, you can also add
[keyfile]
unmanaged-devices=mac:d8:5d:4c:9a:72:60, ,interface-name:wlan1
that 'interface-name' option solves the problem!

How to make en0, en1 persistent?

I am developing a web app in Mac, I am setting remote_host of xdebug to my local ip address of mac, en0, or en01
I can debug normally, and xdebug can communicate well with my Mac from within a docker container.
However, if I restarted my Mac, I will have to set the new en0, or en1 address to xdebug.remote_host settings, otherwise, I will not be able to debug.
How can I make en0, en1 static? why do they change each time?
I'm not sure why it changes, but you may want to consider enabling xdebug.remote_connect_back. This will over-ride the explicit remote_host IP address and allow xdebug to connect back to your IDE no matter what it's IP address is. This is a more dynamic configuration and sounds like it will work well in your situation.

Resources