So, after I met problems with iwlwifi driver and my attempts to aggregate both em0 and wlan0 interfaces to the one lagg0 interface (https://mastodon.bsd.cafe/@evgandr/115985853500057386) — looks like I found a much (MUCH!) simpler solution 

I wanted to automatically switch between wired and wireless networks when I plug-in (or disconnect) my Ethernet cable. First, because I was a newbie in the FreeBSD world, I tried to search for some kind of NetworkManager. Thankfully, I didn't find any NetworkManager clone ported to the FreeBSD. I found some tries to port NetworkManager from Linux to FreeBSD but all of them are failed (not surprised, lol).

Then, I finally started to read documentation  . In the section about advanced networking I read about aggregation interfaces. And somehow I managed to aggregate both of em0 and wlan0 to the one lagg0 interface and it works well.

But, looks like (see https://mstdn.social/@erikarn/115986265106931691) it is not the way how the lagg interfaces should work. It is not intended to use wireless interfaces in the aggregate interfaces — so my tricky setup stopped working in the FreeBSD 15.0.

BUT, since we have a beautiful devd daemon, which listens for various system events and able to execute actions when event is happened — I just wrote 23 lines of shell script to learn my laptop how to switch between interfaces when the Ethernet cable (dis)connects, lol. Solution is very simple:

First, we already have /etc/devd/dhclient.conf, which starts dhclient when some interface appeared in the system. I modified it, so it calls the sPeCiAL script, each time when em0, or wlan0, or ue0 interface appeared in the system, or when em0 is disappeared:

notify 0 {
match "system" "IFNET";
match "type" "LINK_UP";
media-type "ethernet";
action "/root/bin/unfuck_network.tcsh $subsystem ifup";
};

notify 0 {
match "system" "IFNET";
match "type" "LINK_DOWN";
media-type "ethernet";
action "/root/bin/unfuck_network.tcsh $subsystem ifdown";
};

notify 0 {
match "system" "IFNET";
match "type" "LINK_UP";
media-type "802.11";
action "/root/bin/unfuck_network.tcsh $subsystem";
};

notify 0 {
match "system" "ETHERNET";
match "type" "IFATTACH";
match "subsystem" "ue0";
action "/root/bin/unfuck_network.tcsh ue0";
};

Then, the main magic happens in the /root/bin/unfuck_network.tcsh:
— When Ethernet cable is connected — it destroys the wlan0 interface and starts dhclient for em0 to talk with DHCP server.
— When Ethernet cable is disconnected — it makes all to remove route using em0 from routing table (removes em0 interface completely, flush routing table, etc — somehow em0 still stays in the routing table if interface is not destroyed; btw system will create it anyway later, in some point) and recreates the wlan0 interface.
— When wlan0 device is created — it starts dhclient for it.

Script contents (for tcsh):
#!/bin/tcsh

switch ( $1 )
case "em0":
if ( $2 == "ifup" ) then
service netif quietstop wlan0
service dhclient quietstart em0
else if ( $2 == "ifdown" ) then
service dhclient quietstop em0
ifconfig em0 delete
route flush
service routing restart
service netif quietstart wlan0
endif
breaksw;
case "wlan0":
service dhclient quietstart wlan0
breaksw;
case "ue0":
service dhclient quietstart ue0
breaksw;
endsw

#FreeBSD #FreeBSD150RELEASE #wifi #tcsh #devd #iwm

Eugene :freebsd: :emacslogo: (@[email protected])

Attached: 1 image Huh, looks like I hurried to sign praises for iwlwifi in the FreeBSD 15.0 :drgn_sigh: With wlan0 (Intel Dual Band Wireless-AC 8260) added to the aggregate interface lagg0, I receive "general protection fault while in kernel mode" if laptop booted with connected Ethernet cable, or if I connect the cable after the system boot. #FreeBSD #FreeBSD150RELEASE #iwlwifi

BSD.cafe Mastodon Portal

Kalki Koechlin: ‘Dev D’ was like a Hindi exam for me

FIFTEEN years after its release, Kalki Koechlin recalls her experience working on “Dev D”, a film that redefined Devdas for a new generation. The 2009 Anurag Kashyap-directed film was a turning point in her career, but for the then-newcomer, the process was nerve-wracking – especially because she was still learning Hindi....

https://www.indiaweekly.biz/kalki-koechlin-dev-d-hindi-dialogues/
#KalkiKoechlin #FrenchActress #BollywoodMovies #DevD #India

Kalki Koechlin: ‘Dev D’ was Like a Hindi Exam for Me

FIFTEEN years after its release, Kalki Koechlin recalls her experience working on “Dev D”, a film that redefined Devdas for a new generation. The 2009 Anurag Kashyap-directed film was a turning point in her career, but for the then-newcomer, the process was nerve-wracking – especially because she was still learning Hindi. “My memory is of… <a class="more-link" href="https://www.indiaweekly.biz/kalki-koechlin-dev-d-hindi-dialogues/">Continue reading <span class="screen-reader-text">Kalki Koechlin: ‘Dev D’ was like a Hindi exam for me</span></a>

I finally managed to migrate over to #SDDM in #FreeBSD.

It turns out I was missing pam_xdg package. LightDM would not allow me to switch tty after logging in. SDDM is fine with it though :)

I also learned about devd and configured it for laptop lid close event. It was easier than I thought.

I need to setup auto switching to headphones. Manually changing it via pavucontrol is terrible.

btw I am looking for wifi & BT GUI to setup stuff when needed.

#FreeBSD14 #diary #freebsd #devd

𝚟𝚎𝚛𝚖𝚊𝚍𝚎𝚗

Another ${RANDOM} sysadmin sharing his experiences of work at IT industry.

𝚟𝚎𝚛𝚖𝚊𝚍𝚎𝚗

Added 𝗨𝗣𝗗𝗔𝗧𝗘 𝟭 - 𝗕𝗲𝘁𝘁𝗲𝗿 𝗱𝗲𝘃𝗱 𝗦𝗻𝗶𝗳𝗳𝗶𝗻𝗴 - 𝗕𝗲𝘁𝘁𝗲𝗿 𝗨𝗻𝗹𝗼𝗰𝗸 𝗠𝗲𝘁𝗵𝗼𝗱 to the 𝗙𝗿𝗲𝗲𝗕𝗦𝗗 𝗗𝗲𝘀𝗸𝘁𝗼𝗽 - 𝗣𝗮𝗿𝘁 𝟮𝟬 - 𝗖𝗼𝗻𝗳𝗶𝗴𝘂𝗿𝗮𝘁𝗶𝗼𝗻 - 𝗨𝗻𝗹𝗼𝗰𝗸 𝗬𝗼𝘂𝗿 𝗟𝗮𝗽𝘁𝗼𝗽 𝘄𝗶𝘁𝗵 𝗣𝗵𝗼𝗻𝗲 article.

https://vermaden.wordpress.com/2020/01/09/freebsd-desktop-part-20-configuration-unlock-your-laptop-with-phone/

#verblog #freebsd #desktop #laptop #lock #unlock #devd

FreeBSD Desktop &#8211; Part 20 &#8211; Configuration &#8211; Unlock Your Laptop with&nbsp;Phone

𝚟𝚎𝚛𝚖𝚊𝚍𝚎𝚗

The latest 𝘀𝘆𝘀𝘂𝘁𝗶𝗹𝘀/𝗮𝘂𝘁𝗼𝗺𝗼𝘂𝗻𝘁 version 1.7.1 just landed in #FreeBSD Ports:
https://svnweb.freebsd.org/ports?view=revision&revision=519071

#verblog #automount #devd

Complete guide if needed:
https://vermaden.wordpress.com/2018/10/11/freebsd-desktop-part-17-automount-removable-media/

[ports] Revision 519071