linux networking – network interfaces are deleted after issuing a virsh shutdown on VM

I tried to instantiate a VM using virt-install command with few interfaces as needed. The exact command is as follows:

virt-install 
    --name VM 
    --noautoconsole 
    --input keyboard 
    --os-variant rhel7.0 
    --memory 8192 
    --vcpus 4 
    --boot hd 
    --sound none 
    --disk "vol=default,boot_order=1,bus=sata" 
    --disk sda6 
    --network bridge=eth0

Immediately after this, I tried to attach an interface using virsh attach-interface command as follows:

virsh attach-interface --domain VM --type direct --source eth1 --model virtio

I was happy with the XML configuration of the VM as the interfaces showed up correctly.

$ virsh domiflist VM
Interface  Type       Source     Model       MAC
-------------------------------------------------------
vnet16     bridge     eth0       virtio      52:54:00:e9:d5:4c
macvtap0   direct     eth1       virtio      52:54:00:70:be:74

But when a virsh shutdown was issued and later the VM was started, somehow the interface which was attached did not show up in the XML. I was left with only the eth0 interface. Not sure how/why the eth1 vanished.

$ virsh domiflist VM
Interface  Type       Source     Model       MAC
-------------------------------------------------------
vnet16     bridge     eth0       virtio      52:54:00:e9:d5:4c

Please let me know what can be done to avoid this situation such that the interfaces are preserved as-is like before the VM was shutdown.

networking – ASUS USB-AC53 Nano on Ubuntu 20.04, is recognized, but cannot connect, keeps asking for password

I have bought ASUS USB-AC53 Nano wifi adapter, and am trying to make it work on Ubuntu.
So far I have tried all possible steps I found on the google.
I have used drivers from these repos:

  1. https://github.com/cilynx/rtl88x2bu
  2. https://github.com/EntropicEffect/rtl8822bu

Both were built and installed successfully, and usb adapter was recognized.
However, when I try to connect to my wifi network and enter password, it writes that connection has failed and asks for password again.

I have seen a similar topic from a year ago: T4U V3 (8822bu) drivers installed on ubuntu 18.04, but cannot connect. Keeps asking password
However partial solution listed in that topic does not work for me.

Could someone suggest how to debugfix this issue?

Here is some info:

uname -r -v

5.8.0-50-generic #56~20.04.1-Ubuntu SMP Mon Apr 12 21:46:35 UTC 2021

lsusb | grep -i asus

Bus 001 Device 006: ID 0b05:184c ASUSTek Computer, Inc. 802.11ac NIC

iwconfig

wlxf02f746fc004  unassociated  ESSID:""  Nickname:"WIFI@RTL88X2BU"
      Mode:Managed  Frequency=2.442 GHz  Access Point: Not-Associated   
      Sensitivity:0/0  
      Retry:off   RTS thr:off   Fragment thr:off
      Power Management:off
      Link Quality=0/100  Signal level=0 dBm  Noise level=0 dBm
      Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
      Tx excessive retries:0  Invalid misc:0   Missed beacon:0

I do have this line in /etc/NetworkManager/NetworkManager.conf:

(device) wifi.scan-rand-mac-address=no

My router:

  • 2.4 GHz only
  • Fixed channel 7
  • Fixed channel bandwidth on 20MHz.

networking – Connecting Comcast modem, unmanaged switch, and wireless router correctly

I have a cable modem (Comcast Business Gateway), an unmanaged switch (Netgear Gigabit), and a wireless router (Orbi Pro).

If I connect the modem to the internet port of the router, and the switch to one of the ethernet ports on the router, then I have internet connectivity but can’t communicate with any of the devices on the switch:

Modem -> Router -> Switch

Alternatively, if I connect the modem to the switch, then the switch to the internet port on the router, I am able to access some websites — but not all:

Modem -> Switch -> Router

At first I thought this was a DNS issue, but I’m guessing it’s a routing issue, since there’s no router between the gateway and switch.

It seems the only configuration that lets me access all websites, and all of the devices connected to the switch, is to place another router between the modem and switch, then place the second router in bridge mode:

Modem -> Router #2 -> Switch -> Router (Bridge Mode)

I feel like I’m missing something here. Is there any way I can connect the modem, switch, and single router together so that I can access the internet and connect to all devices (both wired into the switch and wireless via the router)?

Thank you!

networking – How to create a docker container that simply forwards a range of ports to another, external IP address?

I would like to create a docker container that all it does is forward any connection on a range of IP addresses to another host, at the same port.

I’ve looked at iptables, pipeworks and haproxy and they look rather complex.

socat and redir look like they could do what I want, but they don’t take a port range.

FROM ubuntu:latest

ENV DEST_IP=8.8.8.8 
    PORTS=3000-9999

RUN apt update && apt install -y ????

CMD ???? --source 0.0.0.0 --ports ${RANGE} --dest ${DEST_IP}

networking – Network printer with cups, do not keep clients running

I want to use cupsd to make two USB printers network wide usable.
Is there a way to do this, so I can print from a device and power it down while printing? The problem is, when I print large jobs (100 pages or so), it would be good if I can shut the client down, because that printing will take forever. Can cups “store” the print jobs completely, and send them to the printer one at a time without needing the client, which initiated the printing to stay online?
Regards
TNT2k

networking – Two WiFi Cards/Adapters

Note: Remove the blacklisting for the iwlwifi driver.

To switch between wifi adapters, or only have one specific adapter connect, do a variation like this…

Example:

Let’s assume that you have two different wireless networks, wifi-a and wifi-b.

Let’s assume that you have two different wireless adapters, wlan0 and wlan1.

Edit all wireless connection profiles for all local wireless networks, and un-check Connect automatically.

enter image description here

Edit the wifi-a connection profile, and change the MAC address to wlan0.

Edit the wifi-b connection profile, and change the MAC address to wlan1.

If you always want one particular wireless interface to always connect at boot/login time, then reselect the Connect automatically for the desired profile.

enter image description here

By using these two settings, you can tailor the exact desired configuration.

networking – Non-Admin – how to change DNS & Default Gateway

I have a small company where I’m hosting Windows VM servers from an ESXI host. And a PDC where I had set up Active Directory etc.

Everything was good, but randomly the user’s DNS changed to 8.8.8.8 and default gateway reset to a random IP.

Does anyone know why that could be?

I was able to change network settings for the Admin users to point to the local default gateway along with DNS, but for non-admin, I am not able to change those settings – cannot log in as an Admin (from the popup) or logout and login as anything other than the local user (as it’s not able to communicate to my server).

Thank you guys!

networking – Router/Modem super slow at responding when internet goes down

So this is a really specific question to ask but i can’t find an answer between all the millions of other questions that are not really related to this…

So basically i often lose connection and i mean the line is dead no wi-fi or ethernet and it last to a couple of seconds to even a few minutes, the issue or rather my question is when this happens i always try to connect to my modem/router page “192.168.1.1” but always, always it’s super slow to respond, it takes a few seconds to even show the login prompt and even when I’m able to login every single action take seconds to complete.

This is something that keeps happening even with different brands of modems-routers that i had (at least 3 at this point) but i can’t figure it out if it’s normal for the router page to be so damn slow when he tries to reconnect to the internet or maybe it’s another issue that could be the problem? I tried multiple times to ask my ISP to check the line but they never found an issue (their only “fix” was to factory reset the router…) so if anyone has an idea or ever had something simular happening to him I’d appreciate

I even checked the router log to see if there’s something there but i don’t really understand if it there’s any issue really (router is ASUS RT-AC86U, modem is TP-Link TD-W8961N):

Apr 17 12:02:17 wlceventd: wlceventd_proc_event(527): eth5: Auth *mac address*, status: Successful (0), rssi:0
Apr 17 12:02:17 wlceventd: wlceventd_proc_event(556): eth5: Assoc *mac address*, status: Successful (0), rssi:0
Apr 17 12:02:17 dnsmasq-dhcp(28444): DHCPREQUEST(br0) 192.168.1.32 *mac address* 
Apr 17 12:02:17 dnsmasq-dhcp(28444): DHCPACK(br0) 192.168.1.32 *mac address* pc
Apr 17 12:02:17 kernel: *mac address* not mesh client, can't update it's ip
Apr 17 12:02:20 dnsmasq-dhcp(28444): DHCPREQUEST(br0) 192.168.1.32 *mac address* 
Apr 17 12:02:20 dnsmasq-dhcp(28444): DHCPACK(br0) 192.168.1.32 48:*mac address* pc
Apr 17 12:02:20 kernel: 48:D2:24:62:4D:98 not mesh client, can't update it's ip
Apr 17 12:03:22 miniupnpd(27806): upnp_event_process_notify: connect(192.168.1.32:2869): Connection timed out
Apr 17 12:03:22 miniupnpd(27806): upnp_event_process_notify: connect(192.168.1.32:2869): Connection timed out
Apr 17 12:03:22 miniupnpd(27806): upnpevents_processfds: 0x675658, remove subscriber uuid:253b74a9-08c2-46df-8166-3b03cf220bc9 after an ERROR cb: http://192.168.1.32:2869/upnp/eventing/jqdsygwfjw
Apr 17 12:03:48 miniupnpd(27806): upnp_event_process_notify: connect(192.168.1.32:2869): Connection timed out
Apr 17 12:03:48 miniupnpd(27806): upnp_event_process_notify: connect(192.168.1.32:2869): Connection timed out
Apr 17 12:03:48 miniupnpd(27806): upnpevents_processfds: 0x675658, remove subscriber uuid:2757e3b2-7e1a-4da5-96ca-4d575f749fe4 after an ERROR cb: http://192.168.1.32:2869/upnp/eventing/coglnfujjk
Apr 17 12:04:08 miniupnpd(27806): upnp_event_process_notify: connect(192.168.1.32:2869): Connection timed out
Apr 17 12:04:08 miniupnpd(27806): upnp_event_process_notify: connect(192.168.1.32:2869): Connection timed out
Apr 17 12:04:08 miniupnpd(27806): upnpevents_processfds: 0x675658, remove subscriber uuid:37336195-f023-4d96-996f-77e64d6bb741 after an ERROR cb: http://192.168.1.32:2869/upnp/eventing/odvgwwgvsn
Apr 17 12:18:27 wlceventd: wlceventd_proc_event(491): eth6: Deauth_ind *mac address*, status: 0, reason: Deauthenticated because sending station is leaving (or has left) IBSS or ESS (3), rssi:0
Apr 17 12:18:27 wlceventd: wlceventd_proc_event(508): eth6: Disassoc *mac address*, status: 0, reason: Disassociated because sending station is leaving (or has left) BSS (8), rssi:0
Apr 17 12:18:27 acsd: selected channel spec: 0xe02a (36/80)
Apr 17 12:18:27 acsd: Adjusted channel spec: 0xe02a (36/80)
Apr 17 12:18:27 acsd: selected channel spec: 0xe02a (36/80)
Apr 17 12:18:27 acsd: acs_set_chspec: 0xe02a (36/80) for reason APCS_CSTIMER
Apr 17 12:33:29 acsd: selected channel spec: 0xe22a (44/80)
Apr 17 12:33:29 acsd: Adjusted channel spec: 0xe22a (44/80)
Apr 17 12:33:29 acsd: selected channel spec: 0xe22a (44/80)
Apr 17 12:33:29 acsd: acs_set_chspec: 0xe22a (44/80) for reason APCS_CSTIMER

networking – Logging the traffic of VPN users

I created a vpn service using openvpn. I need to log user traffic for legal obligations.
I tried using tcpdump for this job.

tcpdump -i tun0 -w /opt/kibrit_data/log/trace-%m-%d-%H-%M-%S-%s -W 3 -G 300 -q -tttt 

the code above helps me listen and record packages. But when 5 people are connected, it produces more than 300mb of data within 5 minutes. How can I keep track of who visited which url on which date instead of keeping all packages? I am open to another tool recommendation.

linux networking – What is the difference between ip link “add link” vs “add dev” commands

I’ve seen examples of the ip link command where some are shown as

ip link add dev xxx type devtype 

and sometimes its of the form

ip link add link xxx type devtype

I looked at the documentation and still am confused about the difference between the two. Is there a difference, and if so when would you use one vs the other.