Not getting a gratuitous ARP after sending a offer with the same Ip as my container - ipv4

So I'm making some testes in Linux 20.04 and monitoring theme. I have a container with an ip-address and his mac-address running, sending me offers, and i can see them in wireshark.
The test that I'm doing is sending a offer with the same ip-address as the container and waiting for a gratuitous ARP reply.
I used ipwatchd to monitor ARP conflicts and did the trick i received a gratuitous ARP, but sending an offer doesn't do the trick.
Example:
Container : Ip-Address- 10.2.10.10 MAC : 01:01:01:01:01:01
Eth0: Ip-Address- 10.2.10.12 MAC : 02:02:02:02:02:02
The offer that I'm sending relies on IPV4 layer. I'm sending this offer hopping that the container answers that the Ip-Address I'm using its his cause I'm making myself the source:
Ip-Address- 10.2.10.10 MAC : 02:02:02:02:02:02
Any suggestions why I'm not getting the gratuitous ARP reply?

Related

Browser tries to upgrade to HTTPS when accessing hosted server (dumb netcat binding) through domain name, but allows HTTP when using direct IP

I recently set up a Digital Ocean droplet and purchased a domain name. I have set up the AAAA record to point to the digital ocean droplet and have verified that the changes have propagated (for example, I can ssh to the server using the DNS name).
There is NO load balancer or firewall set up. The only digital ocean product I have set up is my droplet.
I noticed some bizarre behavior when running some tests.
I have tried several methods of serving HTTP content from the droplet, such as my personal site running in dotnet core and an express.js site.
However for this question I want to focus on the most basic example, to avoid the possibility that the request is being upgraded by a misconfigured server:
nc -l -p 1500 -c 'echo -e "HTTP/1.1 200 OK\n\n HELLO"'
When I navigate to the my droplet through my domain name (http://example.com:1500) , I see the netcat process finish executing in my droplet ssh session, and Chrome tells me:
This site can’t provide a secure connection. example.com sent an invalid response. ERR_SSL_PROTOCOL_ERROR.
I then see that the URL has somehow automatically changed to https//example.com:1500.
When I navigate to the droplet using the IP address (assuming my droplet IP is 12.34.56.78, I go to http://12.34.56.78:1500), I get the expected text "HELLO" displayed in the browser.
This result is the same in all browsers.
Why does making http requests to my droplet attempt upgrading to https, but only when going through the domain? Is this a browser behavior or something to do with Digital Ocean?
Thanks for taking the time to check out this question.
Figured it out. I have a .dev tld and chrome automatically upgrades all .dev tlds to HTTPS!
https://ma.ttias.be/chrome-force-dev-domains-https-via-preloaded-hsts/
This was driving me crazy.

How ping command work

in order to code a program, i need to know how the ping command is working.
I need to know, if a command ping -c1 "something" is executed, how many ipv4 packets and ethernet frames will be created ? considering that every cache is empty
thanks..
The ping command uses ICMP packets. In order to code a ping command you need to be able to send and receive ICMP packets.
In windows, this is done using winsock raw socket support. Here is an example of a ping using raw sockets.
In Linux, you just need sockets support. Here is a stack overflow question about how to do ICMP packets in Linux.
Or you can find a library that implements this for you.
Reply from 192.168.2.10: bytes=32 time<1ms TTL=128 - **Computer is on OS kernel still in memory**
Request timed out. - **OS is shutdown/Firewall blocking ICMP**
Reply from 192.168.2.10: Destination host unreachable. - **Computer powered off. Physical network active**
Here is the ping command explained for troubleshooting

Request timeout for icmp_seq on MacOS

It all started when I was trying to connect to a VM setup on GCP for SFTP only. Everytime I try to check SSH or setup an SFTP on this machine, it becomes unreachable (and its reachable and well connected on my friend's laptop at the same time).
Ping <ip address>
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
I can ping other VMs and also able to SSH into them.
I thought the problem might be with my router. So I used my phone HOTSPOT to connect to internet and tried again. It still did not work. Moreover to my surprise I got same timeouts when I ping www.google.com (strange, because I am able to use internet through chrome browser).
Other details:
MacBook Pro, High Sierra
Airtel Broadband/ Vodafone (HOTSPOT)
Firewall is off.
Others seem to have faced a similar issue (but I could not find any satisfactory answer in these links):
https://askubuntu.com/questions/608194/have-internet-connection-but-cant-ping-external-sites
Check whether you turned Stealth mode in Settings > Security & Privacy > Firewall.
If it's turned off try turning the whole firewall off, just to test whether that's the culprit.

WebRTC existing session

WebRTC comes essentially in 3 flavors depending on the network situation:
No NAT - session is peer to peer
NAT - session uses STUN but is eventually peer to peer for the media
NAT+Firewall: in which case session is not peer to peer and media goes through a TURN server.
Is there a way/tool to figure out for an existing live session if it is using a TURN server or if it's peer to peer?
I am using chrome. If a tool exists for other browsers I am happy to know about it as well.
Thx
this pull request for the webrtc samples makes the constraints/getStats sample show the ip address. Instead of the local and remote ip around here you want the candidateType property.
If either of them is "relay" you are using a turn server. If both are "host" this is a direct connection without NAT. For all other cases NAT is used.
Note that this sample is currently a bit of a mess since the getStats API changed a bit.

IDAS not connecting to the ContextBroker

i'm having a problem sending the mesurements to the contextBroker.
I have the ContextBroker running on a CentOS virtual machine. On another CentOS virtual machine i'm setting the figway config.ini file with the host=/ContextBroker Virtual Machine Host IP/ and Port=1026. When i send mesurements to my ContextBroker:
python2.7 SendObservation.py Bus1 't|1'
it simply doesn't stick the values to the entity. It gives me a code:200 but the response is just blank.
What am i doing wrong?
UPDATE:
Even when i do from one VM to another (to the one where the contextBroker is running) the command:
GET *ip*:1026/version
, it returns nothing.
UPDATE:
Running
GET localhost:1026/version
works. Returns what's supose to return.
The problem could be similar to the one described in the answer to this question. The most probable causes of Orion connection problems are:
Something in the Orion host (e.g a firewall or security group) is blocking the incoming connection
Something in the client host (e.g a firewall) is blocking the outcoming connection
There is some other network issue is causing the connection problem.