Browse Source

gateway nat script; gitignore

master
Robin Thoni 4 years ago
parent
commit
4deecf53e6
3 changed files with 41 additions and 10 deletions
  1. 1
    0
      .gitignore
  2. 10
    10
      gnome-terminal/gnome-terminal/profiles/Default/%gconf.xml
  3. 30
    0
      misc/gateway_nat.sh

+ 1
- 0
.gitignore View File

@@ -0,0 +1 @@
1
+vim/vim/.netrwhist

+ 10
- 10
gnome-terminal/gnome-terminal/profiles/Default/%gconf.xml View File

@@ -1,23 +1,23 @@
1 1
 <?xml version="1.0"?>
2 2
 <gconf>
3
-	<entry name="scrollback_unlimited" mtime="1478802656" type="bool" value="true"/>
4
-	<entry name="use_theme_colors" mtime="1478802656" type="bool" value="false"/>
5
-	<entry name="silent_bell" mtime="1478802656" type="bool" value="true"/>
6
-	<entry name="default_show_menubar" mtime="1478802656" type="bool" value="false"/>
7
-	<entry name="palette" mtime="1478802656" type="string">
3
+	<entry name="scrollback_unlimited" mtime="1480903381" type="bool" value="true"/>
4
+	<entry name="use_theme_colors" mtime="1480903381" type="bool" value="false"/>
5
+	<entry name="silent_bell" mtime="1480903381" type="bool" value="true"/>
6
+	<entry name="default_show_menubar" mtime="1480903381" type="bool" value="false"/>
7
+	<entry name="palette" mtime="1480903381" type="string">
8 8
 		<stringvalue>#2E2E34343636:#CCCC00000000:#4E4E9A9A0606:#C4C4A0A00000:#34346565A4A4:#757550507B7B:#060698209A9A:#D3D3D7D7CFCF:#555557575353:#EFEF29292929:#8A8AE2E23434:#FCFCE9E94F4F:#72729F9FCFCF:#ADAD7F7FA8A8:#3434E2E2E2E2:#EEEEEEEEECEC</stringvalue>
9 9
 	</entry>
10
-	<entry name="alternate_screen_scroll" mtime="1478802656" type="bool" value="true"/>
11
-	<entry name="background_color" mtime="1478802656" type="string">
10
+	<entry name="alternate_screen_scroll" mtime="1480903381" type="bool" value="true"/>
11
+	<entry name="background_color" mtime="1480903381" type="string">
12 12
 		<stringvalue>#2E2E34343636</stringvalue>
13 13
 	</entry>
14
-	<entry name="visible_name" mtime="1478802656" type="string">
14
+	<entry name="visible_name" mtime="1480903381" type="string">
15 15
 		<stringvalue>Default</stringvalue>
16 16
 	</entry>
17
-	<entry name="bold_color" mtime="1478802656" type="string">
17
+	<entry name="bold_color" mtime="1480903381" type="string">
18 18
 		<stringvalue>#000000000000</stringvalue>
19 19
 	</entry>
20
-	<entry name="foreground_color" mtime="1478802656" type="string">
20
+	<entry name="foreground_color" mtime="1480903381" type="string">
21 21
 		<stringvalue>#FFFFFFFFFFFF</stringvalue>
22 22
 	</entry>
23 23
 </gconf>

+ 30
- 0
misc/gateway_nat.sh View File

@@ -0,0 +1,30 @@
1
+#! /usr/bin/env sh
2
+
3
+usage()
4
+{
5
+  echo "Usage: ${0} internal_iface external_iface (on|off)" >&2
6
+  exit 1
7
+}
8
+
9
+if [ "${#}" -ne 3 ]
10
+then
11
+  usage
12
+fi
13
+
14
+internal_iface="${1}"
15
+external_iface="${2}"
16
+status="${3}"
17
+
18
+if [ "${status}" = "on" ]
19
+then
20
+  flag="-A"
21
+elif [ "${status}" = "off" ]
22
+then
23
+  flag="-D"
24
+else
25
+  usage
26
+fi
27
+
28
+iptables -t nat "${flag}" POSTROUTING -o "${external_iface}" -j MASQUERADE
29
+iptables "${flag}" FORWARD -i "${external_iface}" -o "${internal_iface}" -m state --state RELATED,ESTABLISHED -j ACCEPT
30
+iptables "${flag}" FORWARD -i "${internal_iface}" -o "${external_iface}" -j ACCEPT

Loading…
Cancel
Save