Skip to content

Commit

Permalink
Rather use a locally-hosted Ubuntu Echo Server as Buffalo Creek Wirel…
Browse files Browse the repository at this point in the history
…ess rejects all outgoing/incoming packets forwarded on behalf of my MCU. Evidenced as:

	# Before connecting MCU to Ubuntu Ethernet Interface:
	(py37-venv) nuertey@nuertey-PC-LL850RSB:~$ sudo iptables -S -v
	-P INPUT ACCEPT -c 16 2682
	-P FORWARD ACCEPT -c 0 0
	-P OUTPUT ACCEPT -c 18 2762
	-A INPUT -i enp3s0 -c 0 0 -j ACCEPT
	-A FORWARD -i enp3s0 -c 0 0 -j ACCEPT
	-A OUTPUT -o enp3s0 -c 0 0 -j ACCEPT

	# After connecting MCU to Ubuntu Ethernet Interface:
	(py37-venv) nuertey@nuertey-PC-LL850RSB:~$ sudo iptables -S -v
	-P INPUT ACCEPT -c 608 90252
	-P FORWARD ACCEPT -c 0 0
	-P OUTPUT ACCEPT -c 673 84599
	-A INPUT -i enp3s0 -p udp -m udp --dport 67 -c 4 1344 -j ACCEPT
	-A INPUT -i enp3s0 -p tcp -m tcp --dport 67 -c 0 0 -j ACCEPT
	-A INPUT -i enp3s0 -p udp -m udp --dport 53 -c 0 0 -j ACCEPT
	-A INPUT -i enp3s0 -p tcp -m tcp --dport 53 -c 0 0 -j ACCEPT
	-A INPUT -i enp3s0 -c 21 3296 -j ACCEPT
	-A FORWARD -d 10.42.0.0/24 -o enp3s0 -m state --state RELATED,ESTABLISHED -c 38 2262 -j ACCEPT
	-A FORWARD -s 10.42.0.0/24 -i enp3s0 -c 10 510 -j ACCEPT
	-A FORWARD -i enp3s0 -o enp3s0 -c 0 0 -j ACCEPT
	-A FORWARD -o enp3s0 -c 0 0 -j REJECT --reject-with icmp-port-unreachable
	-A FORWARD -i enp3s0 -c 0 0 -j REJECT --reject-with icmp-port-unreachable
	-A FORWARD -i enp3s0 -c 0 0 -j ACCEPT
	-A OUTPUT -o enp3s0 -c 27 4688 -j ACCEPT
  • Loading branch information
nuertey committed May 27, 2022
1 parent bb54731 commit 96d9020
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions Utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,16 @@ namespace Utilities
// as we are emplace'ing:
ipAddress.emplace(pTheSocketAddress->get_ip_address());
}
else
{
// Assume that we are already dealing with an IP address. i.e.,
// as the designer of this application, I am mandating that the
// user can choose to specify IP addresses directly in the mbed_app.json
// echo-server-hostname field. This will facilitate testing with
// locally hosted Echo Servers, which by necessity, do not have
// DNS names.
ipAddress.emplace(address.c_str());
}
}

return ipAddress;
Expand Down
2 changes: 1 addition & 1 deletion mbed_app.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"sock-type": "NUERTEY_TCP",
"echo-server-hostname": {
"help": "Echo server host name.",
"value": "\"echo.mbedcloudtesting.com\""
"value": "\"10.50.10.25\""
},
"echo-server-port": {
"help": "Echo server port number.",
Expand Down

0 comments on commit 96d9020

Please sign in to comment.