Skip to content

Instantly share code, notes, and snippets.

@talkingmoose
Created January 17, 2013 18:23
Show Gist options
  • Save talkingmoose/4558229 to your computer and use it in GitHub Desktop.
Save talkingmoose/4558229 to your computer and use it in GitHub Desktop.
Launchd item to add a firewall rule via ipfw.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.318.ipfwadditions</string>
<key>ProgramArguments</key>
<array>
<string>ipfw</string>
<string>add</string>
<string>9997</string>
<string>allow</string>
<string>ip</string>
<string>from</string>
<string>any</string>
<string>to</string>
<string>any</string>
<string>via</string>
<string>en0</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
@talkingmoose
Copy link
Author

Save this file to /Library/LaunchDaemons to run at every startup.

You can add multiple rules by inserting a semi-colon between sets of strings or by creating a new file for each rule.

Be sure to adjust permissions on the .plist file: owner:root, group:wheel, 644.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment