Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > by-pkgid > 965e33040dd61030a94f0eb89877aee8 > files > 1033

howto-html-en-20080722-2mdv2010.1.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
 <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9">
 <TITLE>The Linux Cipe+Masquerading mini-HOWTO: Machine A Specific Configuration</TITLE>
 <LINK HREF="Cipe+Masq-4.html" REL=next>
 <LINK HREF="Cipe+Masq-2.html" REL=previous>
 <LINK HREF="Cipe+Masq.html#toc3" REL=contents>
</HEAD>
<BODY>
<A HREF="Cipe+Masq-4.html">Next</A>
<A HREF="Cipe+Masq-2.html">Previous</A>
<A HREF="Cipe+Masq.html#toc3">Contents</A>
<HR>
<H2><A NAME="s3">3. Machine A Specific Configuration</A></H2>

<H2><A NAME="ss3.1">3.1 /etc/cipe/options.machineB</A>
</H2>

<P>
<BLOCKQUOTE><CODE>
<HR>
<PRE>

#uncomment 1 below 
#name for cipe 1.0.x 
#device          cip3b0 
#name for cipe 1.2.x 
device          cipcb0 

# remote internal (fake) ip address 
ptpaddr         192.168.2.1 
# my cipe (fake) ip address 
ipaddr          192.168.1.1 
# my real ip address and cipe port 
me              (real ip 1):(port A) 
# remote real ip address and cipe port 
peer            (real ip 2):(port A) 
#unique 128 bit key 
key             (Key A) 
</PRE>
<HR>
</CODE></BLOCKQUOTE>
<P>
<H2><A NAME="ss3.2">3.2 /etc/cipe/options.machineC</A>
</H2>

<P>
<BLOCKQUOTE><CODE>
<HR>
<PRE>

#uncomment 1 below 
#name for cipe 1.0.x 
#device          cip3b1 
#name for cipe 1.2.x 
device          cipcb1 

# remote internal (fake) ip address 
ptpaddr         192.168.3.1 
# my cipe (fake) ip address 
ipaddr          192.168.1.1 
# my real ip address and cipe port 
me              (real ip 1):(port B) 
# remote real ip address and cipe port 
peer            (real ip 3):(port B) 
#unique 128 bit key 
key             (Key B)
</PRE>
<HR>
</CODE></BLOCKQUOTE>
<P>
<H2><A NAME="ss3.3">3.3 /etc/rc.d/rc.cipe</A>
</H2>

<P>
<BLOCKQUOTE><CODE>
<HR>
<PRE>

!#/bin/bash 
#rc.cipe  3/29/1999 
#Send questions or comments to acj@home.com. 

#Setup script path 
PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin" 

#Options filenames in cipe directory for cipe interfaces 
options="options.machineB options.machineC" 

#Automatically obtain options filenames from cipe directory 
#options=`/bin/ls /etc/cipe/options.*` 

#Uncomment 1 below for the cipe module name 
#cipemod="cip3b"        #for cipe 1.0 
cipemod="cipcb"        #for cipe 1.2 

#Check for cipe module and load if not already loaded 
grep $cipemod /proc/modules >/dev/null 
if [ "$?" = "1" ]; then 
        echo Loading cipe module. 
        modprobe $cipemod 
        if [ "$?" = "1" ]; then 
                echo Error loading cipe module...exiting. 
                exit 
        fi 
else 
        echo Cipe module already loaded. 
fi 

#Remove any existing cipe interfaces 
cipeif=`cat /proc/net/dev | cut -f1 -d: | grep $cipemod` 

if [ "$cipeif" != "" ]; then 
        echo Removing existing cipe interface(s). 
        for i in $cipeif; do 
                ifconfig $i down 
        done 
fi

#Setup cipe interfaces 
echo -n "Setting up cipe interface(s): " 
for config in $options; do 
        echo -n $config" " 
        ciped -o $config 
done 
echo 
echo 

#Add routes for other remote networks via cipe interface(s) 
#route add -net x.x.x.x netmask x.x.x.x gw x.x.x.x 
 
</PRE>
<HR>
</CODE></BLOCKQUOTE>
<P>
<H2><A NAME="ss3.4">3.4 Gateway</A>
</H2>

<P>All machines on network 192.168.1.0 must have 192.168.1.1 as gateway.  If you 
don't it will not work.
<P>
<P>
<HR>
<A HREF="Cipe+Masq-4.html">Next</A>
<A HREF="Cipe+Masq-2.html">Previous</A>
<A HREF="Cipe+Masq.html#toc3">Contents</A>
</BODY>
</HTML>