How to create a Windows 10 Defender firewall rule with install4j? - install4j

My Java app needs to communicate through a specific TCP port. I would like the installer to add a Windows Defender Firewall rule to allow intranet communication through that port. How can I do this with install4j?

Related

How do I ping my VM for data

Target Goal: Be able to ping my VM which has a bunch of SOAP calls at localhost:1337/service.asmx
Current VM Settings: Set to Bridged with Replicate Physical Network Connection State enabled.
Known issues:
I cant hit the internet at all from within the VM. test via cnn.com fails.
I can hit localhost:1337 from within the VM
I cant hit VM localhost from the host computer.
What sort of adjustments am I going to need to make in order to open up my VM of MS Server 2012 R2 to the network for testing?
Since I set up a custom port: 1337 there was actually a firewall issue.
On the VM, set it back to NAT from Bridged (in the adapter settings)
On the Windows Virtual Machine, go into Firewall Settings.
Go into Inbound Rules.
Add New Rule for the defined port.
save it.
Now the host can access via that port the page i created.

Unable to access jetty server with local IP address

I have configured jetty-maven-plugin in my eclipse Mars and I can run the server using jetty start and stop goals. I can able to access the website using http://localhost:8080/myapp but not using local IP address(i.e., http://192.168.0.5:8080/myapp) from my own computer or other computers connected in the same network via LAN and Wi-Fi.
As mentioned as a solution in these posts,
how to make jetty server accessible from LAN?
Configuring Jetty to accept connections from all hosts
I configured the server host to 0.0.0.0 from localhost to listen on all hosts. With this setting I can see on server start log,
INFO:oejs.AbstractConnector:Started SelectChannelConnector#0.0.0.0:8080
and it works only on http://localhost:8080 but it's not accessible from http://192.168.0.5:8080.
I also tried running that if the interface is accessible using the Networks Interface Listing as mentioned in this comment. and I got,
Display name: NETGEAR WNA1000M N150 Wireless USB Micro Adapter
Name: wlan4
InetAddress: /192.168.0.5
I also tried turning off my Windows Firewall/antivirus but din't help. My jetty version is <jetty.version>9.3.0.M1</jetty.version> and JDK 1.7. What could be the problem? Any help is appreciated.
McAfee Endpoint Security was the culprit here. It was blocking the requests with IP addresses from my very own computer. Turned off the firewall inside the Antivirus and I was able to access the site with http://192.168.0.5:8080/mysite from the browser and other devices connected through the network.
Sometimes some other program opens your port on external address before you do that with Jetty. It will receive all traffic instead. On Windows you will not know it if you reuse port (that is Jetty's default behavior). Check with netstat -ano what is the IP of the process that is indeed listening on 0.0.0.0:8080. Verify if it is your Jetty process only.
Then try connecting with telnet or netcat and see if you can open the connection and what is the response.

VMWare: Unable to access web server running on guest OS (Oracle Enterprise Linux 6.5) from host (Windows 7)

I am hosting a Oracle Linux 6.5 OS using VMWare on my windows 7 laptop. The VM is configured to use NAT networking configuration, and I am able to ping the guest OS successfully from my windows machine. Also, I am able to access internet from within my guest OS.
However, I am unable to access a web application running on port 8080 on a web server hosted within the guest OS using a browser in my host OS. The application is however accessible when accessed from a browser within the guest OS.
Some observations that may be of some use:
1. Neither my laptop, nor the VM have a static IP address.
2. I am able to ping my guest OS from host, and vice versa
3. Firewalls are disabled on both my laptop as well as the guest OS
Any help would be highly appreciated
The reason for the above issue could be mostly because of firewall settings/rules enabled in guest OS OEL. To check the rules you can type iptables -L -n at bash prompt which will display FILTER rules (CHAIN INPUT/OUTPUT/FORWARD).
Adding filters to allow the host to access guest http protocol would make things work. On the other hand, if this is for developmental purposes you can completely disable the firewall filter by saying
service iptables stop. Keep in mind that this is not a safe approach as it exposes your guest to the world without a firewall especially if you are using a bridged network connection.

Simple TCP server and client communication via public ip

Am using Netgear dgn1000 router and just planning to execute a server-client program over internet.
I switched off windows firewall. Allowed DMZ in router. Also Disabled antivirus in both the system. I don't know what else i got to do.?Please do help
Have you enabled port forwarding to the PC that the server is running on?

Does my program need to have an exception in Windows firewall?

My program uses a component which makes http connections over the internet, but when I install and run my program on a clean installation of XP, it runs fine without an exception in the Windows Firewall having to be made. Why doesn't it need an exception in the firewall?
If it makes only http connections, those are allowed to enable browsers accessing the Internet.
In general firewall rules can be based on various conditions, one of which is the port (http is port 80), other could be the protocol (http is TCP) and the program itself. In order to enhance user experience and allow any browsers to work correctly without extra configuration, TCP connections to port 80 are configured to be allowed.
The Windows Firewall only protects you against incoming connections; all outgoing and local connection are automatically permitted. This means that it is not as secure as a full software firewall, but it avoids nagging you every time Firefox auto-updates itself.