]> git.pld-linux.org Git - projects/rc-scripts.git/commitdiff
- sysconfig/masquerade support patch
authoradasi <adasi@pld-linux.org>
Sun, 3 Feb 2002 16:22:50 +0000 (16:22 +0000)
committeradasi <adasi@pld-linux.org>
Sun, 3 Feb 2002 16:22:50 +0000 (16:22 +0000)
 - not for use in official rc-scripts releases

svn-id: @992

rc-scripts-sysconfig_masq.patch [new file with mode: 0644]

diff --git a/rc-scripts-sysconfig_masq.patch b/rc-scripts-sysconfig_masq.patch
new file mode 100644 (file)
index 0000000..402f14f
--- /dev/null
@@ -0,0 +1,89 @@
+diff -urN rc-scripts/doc/sysconfig.docb rc-scripts.chg/doc/sysconfig.docb
+--- rc-scripts/doc/sysconfig.docb      Sun Feb  3 17:16:48 2002
++++ rc-scripts.chg/doc/sysconfig.docb  Sun Feb  3 17:04:36 2002
+@@ -179,6 +179,21 @@
+     <para>
+       NAT will translate address &lt;address> to &lt;addressreal>.</para>
+   </refsect1>
++
++  <refsect1>
++    <title><filename>/etc/sysconfig/masquerade</filename></title>
++    <para>
++      Configuration file for masquerade.
++      Contain lines of the form:</para>
++    <para>
++<literal>&lt;address> by &lt;interface> to &lt;destination></literal></para>
++    <para>
++      Where &lt;address> is source address or class, &lt;interface> is
++      interface by whom packets will be sent and &lt;destination>
++      is destination address or class (usually 0.0.0.0/0).
++      All address classes should be in form of 192.168.1.0/24.</para>
++  </refsect1>
++
+   <refsect1>
+     <title><filename>/etc/sysconfig/static-routes</filename></title>
+     <para>Contains lines of the form:</para>
+diff -urN rc-scripts/doc/sysconfig.txt rc-scripts.chg/doc/sysconfig.txt
+--- rc-scripts/doc/sysconfig.txt       Sun Feb  3 17:17:23 2002
++++ rc-scripts.chg/doc/sysconfig.txt   Sun Feb  3 17:04:36 2002
+@@ -73,6 +73,17 @@
+   NAT will translate address <address> to <addressreal>.
++/etc/sysconfig/masquerade
++
++  Configuration file for masquerade.
++  Contain lines of the form:
++    <address> by <interface> to <destination>
++
++  Where <address> is source address or class, <interface> is 
++  interface by whom packets will be sent and <destination> 
++  is destination address or class (usually 0.0.0.0/0).
++  All address classes should be in form of 192.168.1.0/24.
++
+ /etc/sysconfig/static-routes:
+   Contains lines of the form:
+diff -urN rc-scripts/rc.d/init.d/functions.network rc-scripts.chg/rc.d/init.d/functions.network
+--- rc-scripts/rc.d/init.d/functions.network   Sun Feb  3 17:14:32 2002
++++ rc-scripts.chg/rc.d/init.d/functions.network       Sun Feb  3 17:04:36 2002
+@@ -160,6 +160,19 @@
+ fi
+ }
++# Setup Masquerade
++setup_masq()
++{
++typeset src by iface to dst
++if [ -r /etc/sysconfig/masquerade ]; then
++        grep "^[0-9]" /etc/sysconfig/masquerade | while read src by iface to dst; do
++                if [ "$1" = "on" ]; then
++                        /sbin/ipchains -A forward -i $iface -j MASQ -s $src -d $dst
++                elif [ "$1" = "off"]; then
++                        /sbin/ipchains -D forward -i $iface -j MASQ -s $src -d $dst
++        fi
++        done
++fi
+ }
+ # Setup static ARP
+ static_arp()
+diff -urN rc-scripts/rc.d/init.d/network rc-scripts.chg/rc.d/init.d/network
+--- rc-scripts/rc.d/init.d/network     Sun Feb  3 17:14:31 2002
++++ rc-scripts.chg/rc.d/init.d/network Sun Feb  3 17:04:36 2002
+@@ -67,6 +67,7 @@
+ setup_forwarding on
+ setup_nat on
+ setup_routes on
++setup_masq on
+ # Setup IPX
+ if is_yes "$IPX"; then
+       if [ -n $IPXAUTOPRIMARY ] ; then
+@@ -110,6 +111,8 @@
+ # Set down NAT rules
+ setup_nat off
++# Set down masquerade rules
++setup_masq off
+ # Set DOWN loopback interface
+ set_down_loopback
+ }
This page took 0.041812 seconds and 4 git commands to generate.