<commit_before># Iptables and Ebtables Firewall Modules

Iptables is a generic table structure for the definition of rulesets.

![alt text](http://4.bp.blogspot.com/-sahyhu3TFeI/T4RlHrtBofI/AAAAAAAACD8/VIwGKBG2cfc/s1600/f-firestarter-firewall.png "Logo Title Text 1")
Source: [Mekey Salaria](http://crackedtownship.blogspot.de/2012/04/how-to-install-firewall-in-ubuntu-linux.html)

These rulesets has been written for a desktop client, bridge server and Ubuntu Phone. They're basic scripte and they must to get filled with your personal rules. The Ubuntu Firewall script for `ubuntu touch` or `ubuntu phone` has been written for the [BQ Aquaris Phone Ubuntu Edition](http://www.ubuntu.com/phone/devices).

| Kernel Module |  Userspace Tool's | Script Description |
| :-------------: | :----------------------: | :------------------: |
| ip_tables     | [iptables](http://git.netfilter.org/ebtables/) | [desktop firewall](https://github.com/hinzigers/script/blob/master/firewall/basis-script) and [mobile firewall](https://github.com/hinzigers/script/blob/master/firewall/basis-script.ubuntu-phone) |
| ip6_tables    | ip6tables | |
| arp_tables    | [arptables](http://git.netfilter.org/arptables/) | |
| ebtables      | [ebtables](http://ebtables.netfilter.org/) | [bridge firewall](https://github.com/hinzigers/script/blob/master/firewall/basis-script-bridge) |

Make directory `firewall` in `/etc/` and put all directories and all lists into, if you want. Copy the firewall script into `/etc/init.d/`and  make symlink from `/etc/init.d/firewall` to `/etc/firewall/firewall`. Change the attribute `chmod u=rwx "firewall" | chmod g-r "firewall" | chmod o-r "firewall"` to `444`.

### Firewall Start (Ubuntu Phone)

The [script](https://github.com/hinzigers/script/blob/master/firewall/basis-script.ubuntu-phone) will automatically detect the network variable and sets this also equal. The [script](https://github.com/hinzigers/script/blob/master/firewall/basis-script.ubuntu-phone) starts only reliably with one enabled interface (wlan0 or ccmni0).

The firewall is started with `service fw start`.

![alt text](https://github.com/hinzigers/script/blob/master/images/firewall_start.png "Firewall Start 1")

Started by ssh console.

![alt text](https://github.com/hinzigers/script/blob/master/images/firewall_start2.png "Firewall Start 2")

Started from the smart phone witch Wi-Fi.

![alt text](https://github.com/hinzigers/script/blob/master/images/firewall_start3.png "Firewall Start 3")

Started from the smart phone witch SIM.
<commit_msg>Commit-script<commit_after># Iptables and Ebtables Firewall Modules

Iptables is a generic table structure for the definition of rulesets.

![alt text](http://4.bp.blogspot.com/-sahyhu3TFeI/T4RlHrtBofI/AAAAAAAACD8/VIwGKBG2cfc/s1600/f-firestarter-firewall.png "Logo Title Text 1")
Source: [Mekey Salaria](http://crackedtownship.blogspot.de/2012/04/how-to-install-firewall-in-ubuntu-linux.html)

These rulesets has been written for a desktop client, bridge server and Ubuntu Phone. They're basic scripte and they must to get filled with your personal rules. The Ubuntu Firewall script for `ubuntu touch` or `ubuntu phone` has been written for the [BQ Aquaris Phone Ubuntu Edition](http://www.ubuntu.com/phone/devices).

| Kernel Module |  Userspace Tool's | Script Description |
| :-------------: | :----------------------: | :------------------: |
| ip_tables     | [iptables](http://git.netfilter.org/ebtables/) | [desktop firewall](https://github.com/hinzigers/script/blob/master/firewall/basis-script) and [mobile firewall](https://github.com/hinzigers/script/blob/master/firewall/basis-script.ubuntu-phone) |
| ip6_tables    | ip6tables | |
| arp_tables    | [arptables](http://git.netfilter.org/arptables/) | |
| ebtables      | [ebtables](http://ebtables.netfilter.org/) | [bridge firewall](https://github.com/hinzigers/script/blob/master/firewall/basis-script-bridge) |

Make directory `firewall` in `/etc/` and put all directories and all lists into, if you want. Copy the firewall script into `/etc/init.d/`and  make symlink from `/etc/init.d/firewall` to `/etc/firewall/firewall`. Change the attribute `chmod u=rwx "firewall" | chmod g-r "firewall" | chmod o-r "firewall"` to `444`.

### Firewall Start (Ubuntu Phone)

The [script](https://github.com/hinzigers/script/blob/master/firewall/basis-script.ubuntu-phone) will automatically detect the network variable and sets this also equal. The [script](https://github.com/hinzigers/script/blob/master/firewall/basis-script.ubuntu-phone) starts only reliably with one enabled interface (wlan0 or ccmni0).

The firewall is started with `service fw start`.

![alt text](https://github.com/hinzigers/script/blob/master/images/firewall_start.png "Firewall Start 1")

Started by ssh console.

![alt text](https://github.com/hinzigers/script/blob/master/images/firewall_start2.png "Firewall Start 2")

Started from the smart phone witch Wi-Fi.

![alt text](https://github.com/hinzigers/script/blob/master/images/firewall_start3.png "Firewall Start 3")

Started from the smart phone witch SIM. The Public IP is a Telekom proxy IP.

{'fraction_non_alphanumeric': 0.14790243902439024, 'fraction_numerical': 0.010926829268292682, 'mean_word_length': 4.193515704154002, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 16, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2596094', 'n_tokens_mistral': 1745, 'n_tokens_neox': 1601, 'n_words': 420}