How do I dump raw data from a TCP port in Windows using the netsh command?

I have an apparently simple issue which is proving very difficult to find an answer for.

The site has a highly-secured Windows Server 2019 installation and an appliance connected to it running on a certain TCP port.

I need a sample of the raw data coming out of that port, taken for a few minutes, dumped into a binary file. It needs to be as raw as possible (i.e. it needs to resemble what we would read from the TCP stream when we would connect to that same port from a local .NET application).

It is highly preferable to use only built-in Windows tools for this (i.e. netsh), but worst-case windump or telnet are also fine.

Go to Source
Author: Ruslan

Minecraft docker-container refuses connection

So I have this Dockerfile:

FROM openjdk:8u212-jre-alpine

LABEL maintainer "cowboy_patrick"

RUN apk add --no-cache -U 
  openssl 
  imagemagick 
  lsof 
  su-exec 
  shadow 
  bash 
  curl iputils wget 
  git 
  jq 
  python 
  tzdata 
  rsync 
  nano 
  sudo 
  knock 
  ttf-dejavu
  
EXPOSE 25565 25565

COPY minecraft /root/minecraft
WORKDIR /root/minecraft


RUN chmod +x /root/minecraft/start_minecraft.sh

CMD /root/minecraft/start_minecraft.sh

This just copies an existing world into an alpine with java and executes some prewritten scripts, I had written for running it on a vps (doing automatic backups etc.)

When I execute it with

docker run –network host -p 25565:25565 –name mcs mcserver

I can see the following in the container-dashboard:
port forwarded

For good measures you can see my console-output here but it’s pretty standard. Just a minecraft-server that boots up.

The only thing I don’t understand is why the connection gets refused when I try to join localhost:25565:
connection refused

Does anyone have an idea on how I can allow this connection? And in extent allow connections from outside my machine (assuming that port-formwarding and everything works).

Go to Source
Author: Cowboy_Patrick

Sync multiple android devices to play an audio at the same time

I’m developing an android app in which I need to play an audio file on multiple devices at the same time. Connected using WiFi. I tried to use NTP and sync time among all the devices. But I got differnce of around 50ms. which is easily noticable while playing an audio.
At first I thought it might not be possible… but then I saw couple of apps – soundseeder and ampme.
These apps perfectly sync music without any noticeable difference. I tried to find which technology these apps use but I found nothing. Does anyone know what technique they use to perfectly sync all the devices?

Go to Source
Author: aditya7822

Dual network interface control with systemd

On a debian machine, I have two network interfaces: eth1 and eth2.

Eth1 is static and eth2 is using dhcp. How to make so that when the eth1 interface is active, the eth2 interface is down and vice versa? Basically I want the two interfaces never to be active at the same time.
I’ve started to make a script with ifdown ifup in the crontab but obviously we should be able to do it with systemd.

Do you have any idea how to make this easy?

Go to Source
Author: Rig0L

keepalived no route to host, firewall issue?

I have a simple two server config of keepalived. The master/backup selection is working fine but I can’t connect to the VIP from the backup server. When I try connecting, on the master I can see ARP requests from the backup server and responses from the master; on the backup server I only see the requests (i.e., I don’t see the ARP responses from the master).

Master keepalived.conf:

vrrp_script haproxy-check {
    script "/usr/bin/pgrep python"
    interval 5
}
 
vrrp_instance haproxy-vip {
    state MASTER
    priority 101
    interface eth0
    virtual_router_id 47
    advert_int 3
 
    unicast_src_ip 192.168.122.4
    unicast_peer {
        192.168.122.9
    }
 
    virtual_ipaddress {
        192.168.122.250
    }
 
    track_script {
        haproxy-check weight 20
    }
}

Backup keepalived.conf:

vrrp_script haproxy-check {
    script "/usr/bin/pgrep python"
    interval 5
}

vrrp_instance haproxy-vip {
    state BACKUP
    priority 99
    interface eth0
    virtual_router_id 47
    advert_int 3

    unicast_src_ip 192.168.122.9
    unicast_peer {
        192.168.122.4
    }

    virtual_ipaddress {
        192.168.122.250
    }

    track_script {
        haproxy-check weight 20
    }
}

ip addr on master:

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1458 qdisc pfifo_fast state UP group default qlen 1000
    link/ether fa:16:3e:9e:e8:18 brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.4/24 brd 192.168.122.255 scope global noprefixroute dynamic eth0
       valid_lft 55567sec preferred_lft 55567sec
    inet 192.168.122.250/32 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::571a:df5f:930c:2b57/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever

And on backup:

2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1458 qdisc pfifo_fast state UP group default qlen 1000
    link/ether fa:16:3e:2e:59:3d brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.9/24 brd 192.168.122.255 scope global noprefixroute dynamic eth0
       valid_lft 79982sec preferred_lft 79982sec
    inet6 fe80::f816:3eff:fe2e:593d/64 scope link 
       valid_lft forever preferred_lft forever

tcpdump from master:

# tcpdump -nni eth0 arp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
11:44:06.299398 ARP, Request who-has 192.168.122.250 tell 192.168.122.9, length 28
11:44:06.299435 ARP, Reply 192.168.122.250 is-at fa:16:3e:9e:e8:18, length 28
11:44:07.298939 ARP, Request who-has 192.168.122.250 tell 192.168.122.9, length 28
11:44:07.298985 ARP, Reply 192.168.122.250 is-at fa:16:3e:9e:e8:18, length 28
11:44:08.300920 ARP, Request who-has 192.168.122.250 tell 192.168.122.9, length 28
11:44:08.300954 ARP, Reply 192.168.122.250 is-at fa:16:3e:9e:e8:18, length 28
11:44:09.303039 ARP, Request who-has 192.168.122.250 tell 192.168.122.9, length 28
11:44:09.303062 ARP, Reply 192.168.122.250 is-at fa:16:3e:9e:e8:18, length 28

And from the backup:

# tcpdump -nni eth0 arp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 262144 bytes
11:44:39.430367 ARP, Request who-has 192.168.122.250 tell 192.168.122.9, length 28
11:44:40.431810 ARP, Request who-has 192.168.122.250 tell 192.168.122.9, length 28
11:44:41.433847 ARP, Request who-has 192.168.122.250 tell 192.168.122.9, length 28
11:44:42.435979 ARP, Request who-has 192.168.122.250 tell 192.168.122.9, length 28
11:44:43.437814 ARP, Request who-has 192.168.122.250 tell 192.168.122.9, length 28

I don’t believe it’s a firewall issue (iptables -L | grep -i arp doesn’t show anything), is there a kernel setting that could be causing an issue? Any suggestions for debugging?

OS is Centos 7, keepalived is 2.1.5.

Go to Source
Author: user693861

How a software is assigned a designated port by the community?

This is general question on unix software development. I actually have seen some of the earlier questions (mentioned below) which gave rise to my question:

Suppose if you are building a service which you later want to package and publish for the linux distro and it involves networking, if you are making everything my scratch ( like not using ssh or http etc ), then you will need some default ports for communication. So how does the community ( or whoever is responsible ) decides which port to be used and make it reserved?
How the whole stuff for deciding a new reserve port works out?

Go to Source
Author: Aaryan BHAGAT

netctl: Static IP configuration lost automatically after few seconds of starting the interface

I am using netctl in Arch Linux on Hyper-V. I have two ethernet interfaces eth0 & eth1.

IP config:

  1. eth0: dhcp (automatic configuration, no involvment of netctl)
  2. eth1: static ip (10.10.10.1/8) using netctl profile
  3. dhcpcd installed and enabled at startup
  4. NetworkManager installed and enabled at startup

eth1 netctl profile (/etc/netctl/sth1static):

Description='Static IP config for eth1'
Interface=eth1
Connection=ethernet
IP=static
Address=('10.10.10.1/8')
Gateway='10.10.10.2'
DNS=('10.10.10.2')

To start the interface I am doing as follows:

netctl stop eth1static
ip link set eth1 down
netctl start eth1static
netctl enable eth1static

After following the above steps, I am able to see the static IP configuration applied to the interface using ip a. Also I am able to ping the guest interface from my host OS successfully. However after a minute or so, I see the interface lose its configuration and get a fe80: based IPv6 address only and the ping stops working… Even after reboot, I don’t see the IP configurtion on the interface, where as the other interface (eth0) is working fine.

Could anyone suggest what’s going wrong and how to fix it?

Go to Source
Author: Anirban

No ethernet connection available in Ubuntu 20.04

I just installed Ubuntu 20.04 on a clean SSD alongside windows to do C development and when I first booted, there was no internet connection yet my ethernet worked perfectly in windows.

My network controller is the realtek RTL8125 2.5 gb and is labelled “UNCLAIMED” when I run the lshw -C network command. I can access the internet using a USB tether to my phone but nothing I have tried so far has fixed the problem.

Would appreciate any help

Go to Source
Author: Liam Doughty

Sending HTTP requests to private EC2 DNS from other EC2 host works, but not from container on EC2 host

I want to make a container hosted on one EC2 host communicate with another container hosted on another EC2 host.

Currently, if I send an HTTP request from host A to host B using host B’s private DNS and the exposed container port, I receive a response correctly.
However, if I try the same thing within the container on host B, I get a “Host is unreachable” error.
To me, this would indicate it is not a host networking issue, which is configured in AWS, so I won’t enter into detail on it.

What puzzles me is that I have done the exact same thing in our pre-production environment and it works perfectly.

What could be the issue / where do you think I should look to troubleshoot this? Please keep in mind I’m a noob 🙂

Go to Source
Author: Konrad

Cannot connect to Wi-Fi network although my Realtek WiFi adapter is detected

I am facing a weird problem in Ubuntu 20.04 with kernel version 5.4.0-40. I have got a Wi-Fi adapter from Realtek for connecting my PC to the internet. From this answer, I have followed the instructions and downloaded and installed the driver from Github. It worked well for a few months, but since a few days I am facing the issue.

Ubuntu is detecting the presence of a Wi-Fi adapter, but whenever I am going to WiFi settings to connect to a network, the settings page says No WiFi adapter found:
enter image description here
I can understand that Ubuntu is detecting the adapter because WiFi option is appearing in the system tray when I connect the adapter:
enter image description here

I have also tried connecting to WiFi network from the command line with iwconfig. Here is the output of the command:
enter image description here
When I try to connect to a WiFi network with the iwconfig wlx00e0202c7613 essid <SSID> key <PASSWORD> command, I am getting this error:
enter image description here

What is the problem and how to fix this issue? I do not know much about networking in Linux, so please ask if more information is required.

Go to Source
Author: Puspam

Can’t connect to SSH on private IP through VPN gateway

Morning, everyone,

I’ve been having a strange problem for a few hours. I was SSH connected on my Azure virtual machine and my SSH connection suddenly froze (without disconnecting). I closed my shell and restarted my SSH session without success. I checked the NSGs with neighboring machines I connect well to, the NSGs are almost identical. I tried to reboot the machine, redeploy the machine, reset the SSH configuration, reset the user account, without success too. I can easily connect to other machines on the same subnet. I can connect on public IP. I feel like there’s a problem between the VPN gateway and the private IP… Any ideas?

Thank you

Note : I have the following entry in the health status :

Unavailable
At samedi 4 juillet 2020 à 3:15:32 PM UTC+4, the Azure monitoring system received the following information regarding your Virtual machine:
Your virtual machine is unavailable. We’re working to automatically recover your virtual machine and to determine the source of the problem. No additional action is required from you at this time.
Recommended Steps
Check back here for status updates
Redeploy this virtual machine to a different host server

Go to Source
Author: Bruno Carnazzi

Not able to connect to Wireless network in Ubuntu 20.04

I am using Asus TUF FX505DT with the Wireless interface Realtek RTL8822BE 802.11a/b/g/n/ac WiFi adapter.
It sometimes stops displaying the available Wireless networks and sometimes it displays the available networks but I am not able to connect to any network and it keeps on asking for the Wifi password again and again or keep trying to connect to the network.

$ sudo iwconfig
wlp4s0    IEEE 802.11  ESSID:off/any  
          Mode:Managed  Access Point: Not-Associated   Tx-Power=20 dBm   
          Retry short  long limit:16   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:on
$ lspci 
04:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8822BE 802.11a/b/g/n/ac WiFi adapter (rev ff)
$ sudo lshw -C network
 *-generic
       description: Wireless interface
       product: RTL8822BE 802.11a/b/g/n/ac WiFi adapter
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0
       bus info: pci@0000:04:00.0
       logical name: wlp4s0
       version: ff
       serial: dc:f5:05:b1:8f:81
       width: 32 bits
       clock: 66MHz
       capabilities: bus_master vga_palette cap_list ethernet physical wireless
       configuration: broadcast=yes driver=rtw_pci driverversion=5.4.0-37-generic firmware=N/A latency=255 link=no maxlatency=255 mingnt=255 multicast=yes wireless=IEEE 802.11
       resources: irq:69 ioport:d000(size=256) memory:f7700000-f770ffff

Go to Source
Author: Somil Singla

The publish-subscribe pattern: garbage-collecting old subscriptions

I’ve been studying distributed systems design, in particular the Udi Dahan’s class. He talks about the publish-subscribe pattern as a common pattern in messaging-oriented designs. There’s obviously a clear point in time when subscriptions to a publisher happen. However—and I might be missing something—he spent no time discussing unsubscribes.

So my question is—given a distributed system with components that evolve over time, how do popular implementations of this pattern deal with stale subscriptions? I understand that in a optimal situation, there are points in time when the subscriber explicitly declares that it is no longer interested in messages from a given source (maybe on clean shutdown, maybe on some kind of decommissioning of the component)… but given faulty networks, software and hardware, I can imagine the case where the publisher keeps thinking the subscriber still waits for its messages despite not existing for years, and no-longer-necessary messages clogging the messaging system.

Go to Source
Author: liori

Unable to get Netgear A7000 to work on 20.04 despite multiple attempts

I’m new to Linux and I’m trying to set up everything on my own (with manually created partitions for the first time). The installation process was smooth but I’m struggling to get my wifi adapter to work.

I’m using a Netgear Nighthawk AC1900 Wi-Fi USB Adapter (A7000) which works fine with Windows 10 but is not detected by Ubuntu 20.04

So far I’ve tried following steps mentioned in three different posts and none of them has worked for me so far:

  1. First I tried this

    sudo apt-get install git dkms
    git clone https://github.com/zebulon2/rtl8814au.git
    sudo dkms add ./rtl8814au 
    sudo dkms build -m rtl8814au -v 4.3.21
    sudo dkms install -m rtl8814au -v 4.3.21
    
    
  2. Then I tried this

    sudo apt install dkms build-essential git
    git clone https://github.com/aircrack-ng/rtl8812au.git
    cd rtl8812au
    sudo ./dkms-install.sh
    reboot
    
    
  3. Finally I tried this

    git clone https://github.com/aircrack-ng/rtl8812au.git
    cd rtl8812au/
    sudo dkms-install.sh
    
    

Am I missing something?

Also, idk if it is related in any way or if it matters but when I restart Ubuntu my screen goes completely blank and I have to force shutdown my desktop and boot again.

Looking forward to hearing from you all.

Go to Source
Author: Lakshay Verma