Enabling Windows Firewall on Windows 2003 Active Directory Domain Controller
Some time ago I discovered that my (two) Active Directory controllers weren’t actually talking to each other too well. After some debugging I found that the local Windows Firewall was enabled on one of the AD controllers and it was basically blocking everything that had to do with AD. So I disabled it and all was well. All servers are located behind a firewall anyway, so the risk was minimal.
Now I thought it was about time to enable the firewall on my AD controllers again. And it turns out that, as usual, Microsoft lets the ports flow wild. There are three services that don’t have a fixed port: NTDS, NTFrs and NetLogon. Without a fixed port it is difficult to enable firewall for them. The local firewall can enable based on process, but my external can’t.
The good news is that you can set fixed ports for these services. This is described in the knowledge base article http://support.microsoft.com/kb/555381.
But who wants to read all that?
Here is the short version:
- Change registry to set fixed ports either by follow the knowledge base article or simply by running this .reg-file.
Note: As always when downloading .reg-files have a look at it first to see what it actually does.
Download, unzip, execute .reg-file, answer yes to question about importing it: - Reboot the AD-controller.
- Note that if all servers are on same subnet you can increase security a lot by setting Scope to “My network (subnet) only”.
Enable Windows Firewall and set the following rules:
- Repeat on all AD controllers you want to enable firewall on.
- Make sure you check Event Log on other servers for errors related to enabling firewall.
| Port | Protocol | Name | Notes |
| File and Printer Sharing | Already exist, must be enabled. NOTE: If servers are not on local subnet you may need to modify Scope. |
||
| 53 | TCP | DNS (TCP) | |
| 53 | UDP | DNS (UDP) | |
| 88 | TCP | Kerberos (TCP) | |
| 88 | UDP | Kerberos (UDP) | |
| 123 | UDP | NTP | |
| 389 | TCP | LDAP (TCP) | |
| 389 | UDP | LDAP (UDP) | |
| 3268 | TCP | Global Catalog LDAP | |
| 53211 | TCP | AD Replication | This was set by the .reg-file |
| 53212 | TCP | File Replication Service | This was set by the .reg-file |
| 53213 | TCP | NetLogon | This was set by the .reg-file |
| Remote Desktop | Optional: Recommended/required if you access server remotely. |
Enjoy!
Setting up Debian with Varnish as internet proxy
Varnish is a great http accelerator, “10 times faster than squid”. This partially due to its use of modern computer architecture. Although its main purpose is as a web server accelerator it can also be used as a traditional internet accelerator/cache. The web page FAQ says it requires a lot of work though.
But there is a simpler solution by having it cooperate with Squid. Not the most elegant solution, but for my cable modem it will be more than enough.
- Install Debian on a box.
- Install Squid and Varnish.
apt-get install squid varnish - Edit /etc/squid/squid.conf (this is actually optional, but recommended):
Add the lines:
cache_dir ufs /var/spool/squid 10 2 4
forwarded_for off - Edit /etc/default/varnish and set
- Restart Squid and Varnish:
/etc/init.d/squid restart
/etc/init.d/varnish restart - On your client computer set your HTTP PROXY server for HTTP (not HTTPS) to debianserverip port 8080.
client_db off
DAEMON_OPTS=”-a :6081 \
to
DAEMON_OPTS=”-a :8080 \
And
-b localhost:8080 \
to
-b localhost:3128 \
Add the line: -f /etc/varnish/default.vcl \
after -b line.
Set how much disk space you want to use for cache in the line:
-s file,/var/lib/varnish/$INSTANCE/varnish_storage.bin,1G”
Note: For 32-bit systems keep it low (~1GB).