networking – How to send a custom ICMP reply message for a ICMP request message using Scapy tool?

I am using two ubuntu VM’s and I am trying to send one ICMP request packet from one VM to other and I got a reply which is automatically generated by the system.

Now I want to generate a custom reply for that received ICMP request message using scapy.

I know we can sniff or receive the request message by using sniff/receive commands, But after sniffing that packet, How can I send a custom reply for that ICMP request packet?

Is it possible to do that? If so, How?

edit:-
I want that process to be automatic. Lets say that if I got 5 request packets consecutively I want to send 5 reply messages automatically.

networking – Drawbacks of having pruned and collapsed packets

I am a newbie in networking field, I come across a note that we should not have pruned packets and collapsed packets, if we have, we should have to optimize the system.

But the note (neither the internet) didn’t provide much context on why we shouldn’t have pruned and collapsed packets and what problems that it makes?

$ netstat -s | grep socket      
299 packets pruned from receive queue because of socket buffer overrun
2701 TCP sockets finished time wait in fast timer
5 delayed acks further delayed because of locked socket
92 packets collapsed in receive queue due to low socket buffer

Here, you can see I have 299 packets which were pruned and 92 packets were collapsed.

Is it bad? if yes, why? what issues I will face due to this?

networking – Using socat for SOCKET-SENDTO

I’m trying to use socat to send a raw packet to an ethernet interface, but I get “No such device or address”. How should I be using socat?

Usage:

$ echo hi | sudo socat - SOCKET-SENDTO:17:3:0:x0003x00000002x0000x00x06xabcdef0123450000

Breakdown:

domain   - 17 (PF_PACKET)
type     -  3 (SOCK_RAW)
protocol -  0
address  - (data representation of a sockaddr structure)
  sockaddr_ll
    family   - (without family)
    protocol - x0003 (ETH_P_ALL (unsigned short))
    ifindex  - x00000002 (from /sys/class/net/eth0/ifindex (int))
    hatype   - x0000 (0 on send (unsigned short))
    pkttype  - x00   (0 on send (unsigned char))
    halen    - x06   (ETH_ALEN (unsigned char))
    addr     - xabcdef0123450000 (a MAC address on the same segment as ifindex, (unsigned char(8)))

Result:

$ echo hi | sudo socat - SOCKET-SENDTO:17:3:0:x0003x00000002x0000x00x06xabcdef0123450000
2020/05/29 16:05:29 socat(339113) E sendto(5, 0x555fd8ffac70, 3, 0, AF=17 AF=17 0x00030000000200000006abcdef01, 20): No such device or address

networking – How do I get my modem’s IP address when using Google Wifi?

Occasionally I need to connect my ISP’s modem directly to initiate a restart.

Normally when I connect to my modem directly, I can either connect to the modem using the vanity URL provided by the ISP, or I can figure out the modem’s IP address, and connect to that (e.g. on macOS, option-click the network system menu icon, and observe the value for Router).

Problem is when I use Google Wifi as my router/access point, it’s no longer easy to find the IP address of the modem. Now the menu item shows me the IP address of the Google Router, and accessing it goes to a page that explains how to manage the Google Router.

How do I find the IP address of the modem which the Google Router is connected to?

networking – Category 7A Ethernet cable backward compatibility with 6A

I need to choose Ethernet cables for my home installation. I can buy U/FTP cat.6A or S/FTP cat.7A at the same price. As I know, category 7A provides more bandwidth, but in order to use the highest available bandwidth I need 7/7A connectors (e.g. GG45, not RJ45), which are not very popular.

I found that cat.7/7A cables are backwards compatible with categories 5/5E and 6. But I can’t figure out if the 7/7A cables are backwards compatible with category 6A cables. Can one say that a link with cat.7A cable and cat.6A connectors is not worse in case of bandwidth than a link with cat.6A cables and connectors? Are there any disadvantages of using 7/7A compared to 6A? Is it possible that any 6A connector or device is or will not be compatible with category 7A cable?

networking – How to set static ip on Hyper-V vm when host has one network card?

I am running Hyper-V on Windows 10 and created an Ubuntu server vm running postgresql. My pc has a single nic card.
There is a single network adapter on the VM that is connected to the Default switch in Hyper-V. I am able to connect to the internet from the vm and can connect to the instance of Postgresql on the VM from the host and everything works fine.
But each time I reboot the VM it gets a new IP address so everyday I have to reconfigure the connection string on my app that makes calls to the Postgresql instance on the vm.
How can I configure the ip addresses that are assigned to the devices on the vlan (not sure if that is the correct term) that are sitting behind the Default Switch? I am guessing there is a DHCP server somewhere but I can’t find anything.

I just want to have the same ip always assigned to the VM or be able to set the ip manually and know that it is not going to be assigned to another VM, but am at a loss as to how to do what seems like should be a super simple thing.

wireless networking – Any consumer-grade wifi routers that do fair bandwidth allocation?

Are there any consumer-grade wifi routers that make some attempt at, and to some degree succeed at, fair bandwidth allocation?

By “fair” I mean something like, if there are 20 users sharing a wifi router, including a few bandwidth hogs, then the capacity available to the low-bandwidth users drops to approximately 5% each (rather than 1%, or even 0% for minutes at a time, which I’ve seen is common).

If there are such routers, then my questions are (a) is there a technical term for this feature, (b) how to do a search for routers having that feature, (c) how to look up, for a given brand/model, whether it has that feature, (d) if it has that feature, how to tell whether it’s the default configuration vs. requiring minimal configuration effort (e.g., settings via the admin login) vs. requiring extensive configuration effort (e.g., DIP switches, new firmware, etc.). I’m talking about how to get this information when looking up routers online and not having the physical product in hand.

This is so I can advise non-technical personnel (such as manager of coffee shop or small hotel) on getting a router that ideally does the right thing out-of-the-box, and/or advising them on whether they have the right router already (and just need to select a setting). If the router came with manuals, they may have been discarded or lost already.

networking – OpenVPN using UDP is terrible slow over cellular networks

I have a weird problem with OpenVPN for around two weeks now. I am running the OpenVPN server on a Virtual Server (German Hoster netcup) on UDP port 1194. Using this setup clients connecting through a mobile network have an extremely slow downstream (!) through the VPN tunnel (Less than 1 Mbit/s). The upstream speed is close to the general upstream capacity of the client (verified by doing a standard internet speed test without VPN). This problem doesn’t occur by connecting through a “normal” home internet connection.

If I run the OpenVPN on TCP instead of UDP everything is fine, but the general performance is slightly lower than over UDP. Additionally a lot of clients would have to change their configuration. So if possible I would like to continue using UDP. It also seems to be best practice to run an OpenVPN tunnel over UDP.

What could cause this problem? I’ve tried to play with mssfix, fragment, mtu, tun-mtu, sndbuf and rcvbuf options of OpenVPN server already- The performance got even worst. So now I am using no of these options.

I am using OpenVPN 2.4.4 on Ubuntu 18.04.4 LTS (GNU/Linux 5.3.0-53-generic x86_64) (Ubuntu Server)

networking – Directly connecting two computer also on same LAN

This might be a weird one, which is probably why I couldn’t find anything on searches.

I have two machines on the same network connected to the same switch via Gigabit Ethernet. One is my main workstation, running Windows 10, the other is my server, running Windows Server 2016. These two machines are within a few feet of each other and I’d like to get a better transfer rate between the two. Ideally I’d like a 10G link between the two, but one of the machines (the server) has no more room for internal expansion (and no thunderbolt). My plan is to fit that one with a USB 3.1 Gen 2 5Gb Ethernet adapter, and the other with an internal PCIe 10Gb Ethernet adapter. I then want to directly connect the two, while also leaving in place the current 1Gb network connections to the main network/internet. None of the other machines on the network need a faster link, so upgrading the infrastructure isn’t practical.

So my question before I do all this… when I go to copy files between the two machines, is Windows smart enough to use the faster link, or is it going to be dumb and go through the network switch on the 1Gb connection? If it’s dumb, can I override this with a hosts file for the static IP4/IP6 addresses on each computer?

networking – How to modify CSC file of samsung sm-j500fn?

My phone origin is the UK and I am in Sri Lanka now. My phone modemst1, modemst2 were reset and also I forgot to backup.

dd if=/dev/zero of=/dev/block/bootdevice/by-name/modemst1

dd if=/dev/zero of=/dev/block/bootdevice/by-name/modemst2

After reset it has asked to unlock the network.
I’ve tried many solutions such as flashing stock ROM of UK before I had custom rom(arrow os), zx3 tool pro. I could not do it. I don’t plan to buy a code since I think, It can be recovered.
I think it can be done via modifying the CSC file since it is specific to geographical region and carriers and it contains the software packages specific to that region, carrier branding and APN setting but I don’t have enough knowledge to modify the CSC file.
Another possible solution may be flashing the living country CSC file but I could not find CSC file only for my j5nlte phone with Sri Lanka.
Can anyone suggest how to modify the CSC file or provide any solutions to unlock the network in my device?
Thanks in advance………