This commit is contained in:
gferg 2001-01-26 16:41:35 +00:00
parent 70dce3b3d8
commit 063b66d77f
2 changed files with 476 additions and 0 deletions

View File

@ -0,0 +1,240 @@
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.1//EN">
<article ID="IPaliasing">
<articleinfo>
<title>Setting up IP Aliasing on A Linux Machine Mini-HOWTO</title>
<author>
<firstname>Harish</firstname>
<surname>Pillay</surname>
<affiliation>
<address> <email><ulink URL="h.pillay@ieee.org">h.pillay@ieee.org</ulink></email> </address>
</affiliation>
</author>
<abstract>
<para>This is a cookbook recipe on how to set up and run IP aliasing on a Linux
box and how to set up the machine to receive e-mail
on the aliased IP addresses.</para>
</abstract>
<pubdate>2001-01-23</pubdate>
<revhistory>
<revision>
<revnumber>1.1</revnumber>
<date>2001-01-24</date>
<authorinitials>JEY</authorinitials>
</revision>
<revision>
<revnumber>1.0</revnumber>
<date>1997-01-13</date>
<authorinitials>HP</authorinitials>
</revision>
</revhistory>
<othercredit role="converter">
<firstname>Joy</firstname>
<surname>Yokley</surname>
<contrib>Converted document from HTML to DocBook v4.1 (SGML)</contrib>
</othercredit>
</articleinfo>
<sect1 ID="MySetup">
<title>My Setup</title>
<itemizedlist>
<listitem><para>IP Alias is standard in kernels 2.0.x and 2.2.x, and available as a compile-time option in 2.4.x
(IP Alias has been deprecated in 2.4.x and replaced by a more powerful firewalling mechanism.
</para></listitem>
<listitem><para>IP Alias compiled as a loadable module. You would have indicated in
the "make config" command to make your kernel, that you want the IP
Masq to be compiled as a (M)odule. Check the Modules HOW-TO (if that
exists) or check the info in <filename>/usr/src/linux/Documentation/modules.txt.</filename></para></listitem>
<listitem><para>I have to support 2 additional IPs over and above the IP already
allocated to me.</para></listitem>
<listitem><para>A D-Link DE620 pocket adapter (not important, works with any Linux
supported network adapter).</para></listitem>
</itemizedlist>
</sect1>
<sect1 ID="Commands">
<title>Commands</title>
<orderedlist>
<listitem><para>Load the IP Alias module (you can skip this step if you compiled
the module into the kernel):</para>
<screen>/sbin/insmod /lib/modules/`uname -r`/ipv4/ip_alias.o</screen>
</listitem>
<listitem><para>Setup the loopback, eth0, and all the IP addresses beginning with the
main IP address for the eth0 interface:</para>
<screen>
/sbin/ifconfig lo 127.0.0.1
/sbin/ifconfig eth0 up
/sbin/ifconfig eth0 172.16.3.1
/sbin/ifconfig eth0:0 172.16.3.10
/sbin/ifconfig eth0:1 172.16.3.100</screen>
<para>172.16.3.1 is the main IP address, while .10 and .100 are the aliases. The
magic is the eth0:x where x=0,1,2,...n for the different IP addresses. The
main IP address does not need to be aliased.</para></listitem>
<listitem><para>Setup the routes. First route the loopback, then the net, and
finally, the various IP addresses starting with the default (originally
allocated) one:</para>
<screen>
/sbin/route add -net 127.0.0.0
/sbin/route add -net 172.16.3.0 dev eth0
/sbin/route add -host 172.16.3.1 dev eth0
/sbin/route add -host 172.16.3.10 dev eth0:0
/sbin/route add -host 172.16.3.100 dev eth0:1
/sbin/route add default gw 172.16.3.200</screen>
<para>That's it.</para></listitem>
</orderedlist>
<para>In the example IP address above, I am using the Private IP addresses (RFC 1918) for
illustrative purposes. Substitute them with your own official or private IP
addresses.</para>
<para>The example shows only 3 IP addresses. The max is defined to be 256 in
<filename>/usr/include/linux/net_alias.h.</filename> 256 IP addresses on ONE card is a lot :-)!</para>
<para>Here's what my <filename>/sbin/ifconfig</filename> looks like:</para>
<programlisting>
lo Link encap:Local Loopback
inet addr:127.0.0.1 Bcast:127.255.255.255 Mask:255.0.0.0
UP BROADCAST LOOPBACK RUNNING MTU:3584 Metric:1
RX packets:5088 errors:0 dropped:0 overruns:0
TX packets:5088 errors:0 dropped:0 overruns:0
eth0 Link encap:10Mbps Ethernet HWaddr 00:8E:B8:83:19:20
inet addr:172.16.3.1 Bcast:172.16.3.255 Mask:255.255.255.0
UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1
RX packets:334036 errors:0 dropped:0 overruns:0
TX packets:11605 errors:0 dropped:0 overruns:0
Interrupt:7 Base address:0x378
eth0:0 Link encap:10Mbps Ethernet HWaddr 00:8E:B8:83:19:20
inet addr:172.16.3.10 Bcast:172.16.3.255 Mask:255.255.255.0
UP BROADCAST RUNNING MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0
TX packets:0 errors:0 dropped:0 overruns:0
eth0:1 Link encap:10Mbps Ethernet HWaddr 00:8E:B8:83:19:20
inet addr:172.16.3.100 Bcast:172.16.3.255 Mask:255.255.255.0
UP BROADCAST RUNNING MTU:1500 Metric:1
RX packets:1 errors:0 dropped:0 overruns:0
TX packets:0 errors:0 dropped:0 overruns:0</programlisting>
<para>And <filename>/proc/net/aliases</filename>:</para>
<screen>
device family address
eth0:0 2 172.16.3.10
eth0:1 2 172.16.3.100</screen>
<para>And <filename>/proc/net/alias_types</filename>: </para>
<programlisting>
type name n_attach
2 ip 2</programlisting>
<para>Of course, the stuff in <filename>/proc/net</filename> was created by the <command>ifconfig</command> command and
not by hand!</para>
</sect1>
<sect1 ID="Troubleshooting">
<title>Troubleshooting: Questions and Answers</title>
<sect2 ID="KeepSettings">
<title>Question: How can I keep the settings through a reboot?</title>
<para>Answer: Whether you are using BSD-style or SysV-style (Redhat&trade for example)
<command>init</command>, you can always include it in <filename>/etc/rc.d/rc.local</filename>. Here's what I have
on my SysV init system (Redhat&trade 3.0.3 and 4.0):</para>
<para>My <filename>/etc/rc.d/rc.local</filename>: (edited to show the relevant portions)</para>
<screen>
#setting up IP alias interfaces
echo "Setting 172.16.3.1, 172.16.3.10, 172.16.3.100 IP Aliases ..."
/sbin/ifconfig lo 127.0.0.1
/sbin/ifconfig eth0 up
/sbin/ifconfig eth0 172.16.3.1
/sbin/ifconfig eth0:0 172.16.3.10
/sbin/ifconfig eth0:1 172.16.3.100
#setting up the routes
echo "Setting IP routes ..."
/sbin/route add -net 127.0.0.0
/sbin/route add -net 172.16.3.0 dev eth0
/sbin/route add -host 172.16.3.1 eth0
/sbin/route add -host 172.16.3.10 eth0:0
/sbin/route add -host 172.16.3.100 eth0:1
/sbin/route add default gw 172.16.3.200
# </screen>
</sect2>
<sect2 ID="SettingUpMail">
<title>Question: How do I set up the IP aliased machine to receive e-mail on the
various aliased IP addresses (on a machine using sendmail)?</title>
<para>Answer: Create (if it doesn't already exist) a file called,
<filename>/etc/mynames.cw</filename>,for example. The file does not have to be this exact name nor in the
<filename>/etc directory</filename>.</para>
<para>In that file, place the official domain names of the aliased IP addresses. If
these aliased IP addresses do not have a domain name, then you can place the
IP address itself.</para>
<para> The <filename>/etc/mynames.cw</filename> might look like this:</para>
<programlisting>
# /etc/mynames.cw - include all aliases for your machine here; # is a comment
domain.one.net
domain.two.com
domain.three.org
4.5.6.7 </programlisting>
<para>In your <filename>sendmail.cf</filename> file, where it defines a file class macro Fw, add
the following:</para>
<screen>
##################
# local info #
##################
# file containing names of hosts for which we receive email
Fw/etc/mynames.cw
</screen>
<para>That should do it. Test out the new setting by invoking sendmail in
test mode. The following is an example:</para>
<screen>
ganymede$ /usr/lib/sendmail -bt
ADDRESS TEST MODE (ruleset 3 NOT automatically invoked)
Enter < ruleset> < address>
> 0 me@4.5.6.7
rewrite: ruleset 0 input: me @ 4 . 5 . 6 . 7
rewrite: ruleset 98 input: me @ 4 . 5 . 6 . 7
rewrite: ruleset 98 returns: me @ 4 . 5 . 6 . 7
rewrite: ruleset 97 input: me @ 4 . 5 . 6 . 7
rewrite: ruleset 3 input: me @ 4 . 5 . 6 . 7
rewrite: ruleset 96 input: me < @ 4 . 5 . 6 . 7 >
rewrite: ruleset 96 returns: me < @ 4 . 5 . 6 . 7 . >
rewrite: ruleset 3 returns: me < @ 4 . 5 . 6 . 7 . >
rewrite: ruleset 0 input: me < @ 4 . 5 . 6 . 7 . >
rewrite: ruleset 98 input: me < @ 4 . 5 . 6 . 7 . >
rewrite: ruleset 98 returns: me < @ 4 . 5 . 6 . 7 . >
rewrite: ruleset 0 returns: $# local $: me
rewrite: ruleset 97 returns: $# local $: me
rewrite: ruleset 0 returns: $# local $: me
> 0 me@4.5.6.8
rewrite: ruleset 0 input: me @ 4 . 5 . 6 . 8
rewrite: ruleset 98 input: me @ 4 . 5 . 6 . 8
rewrite: ruleset 98 returns: me @ 4 . 5 . 6 . 8
rewrite: ruleset 97 input: me @ 4 . 5 . 6 . 8
rewrite: ruleset 3 input: me @ 4 . 5 . 6 . 8
rewrite: ruleset 96 input: me < @ 4 . 5 . 6 . 8 >
rewrite: ruleset 96 returns: me < @ 4 . 5 . 6 . 8 >
rewrite: ruleset 3 returns: me < @ 4 . 5 . 6 . 8 >
rewrite: ruleset 0 input: me < @ 4 . 5 . 6 . 8 >
rewrite: ruleset 98 input: me < @ 4 . 5 . 6 . 8 >
rewrite: ruleset 98 returns: me < @ 4 . 5 . 6 . 8 >
rewrite: ruleset 95 input: < > me < @ 4 . 5 . 6 . 8 >
rewrite: ruleset 95 returns: me < @ 4 . 5 . 6 . 8 >
rewrite: ruleset 0 returns: $# smtp $@ 4 . 5 . 6 . 8 $: me < @ 4 . 5 . 6 . 8 >
rewrite: ruleset 97 returns: $# smtp $@ 4 . 5 . 6 . 8 $: me < @ 4 . 5 . 6 . 8 >
rewrite: ruleset 0 returns: $# smtp $@ 4 . 5 . 6 . 8 $: me < @ 4 . 5 . 6 . 8 >
></screen>
<para>Notice when I tested me@4.5.6.7, it delivered the mail to the local
machine, while me@4.5.6.8 was handed off to the smtp mailer.
That is the correct response.</para>
<para>You are all set now.</para>
</sect2>
</sect1>
<sect1 ID="Acknowledgements">
<title>Acknowledgements</title>
<para>Thanks to all those who have done this great work on Linux and IP Aliasing.
And especially to Juan Jose Ciarlante for clarifying my questions.</para>
<para>Kudos to the ace programmers!</para>
<para>If you find this document useful or have suggestions on improvements, email me at <email><ulink URL="h.pillay@ieee.org">h.pillay@ieee.org</ulink></email>.</para>
<para>Enjoy.</para>
<para>For additional information on networking, you may want to consult the <ulink URL="http://www.linuxdoc.org/HOWTO/Networking-Overview-HOWTO.html">The Linux Networking Overview HOWTO</ulink>.</para>
</sect1>
</article>

View File

@ -0,0 +1,236 @@
<!doctype linuxdoc system>
<article>
<title>MS Outlook to Unix Mailbox Conversion mini HOWTO
<author>Greg Lindahl, <tt/lindahl@pbm.com/
<date>1.0, 2001-01-25
<abstract>
This MiniHowto covers conversion of old email in Microsoft
Outlook (not Outlook Express!) to typical Unix file formats.
</abstract>
<!-- Table of contents -->
<toc>
<!-- Begin the document -->
<sect>Introduction
<p>
While programs exist to convert some formats such as Microsoft Outlook
Express to Unix formats, Outlook users are in a bit of a bind. The
database format that Outlook uses for .PST files, called Jet, is
documented at:
<url url="http://msdn.microsoft.com/library/techart/olexcoutlk.htm"
name="http://msdn.microsoft.com/library/techart/olexcoutlk.htm">
but there doesn't seem to be any enterprising programmer who's written
a conversion program yet.
<p>
Fortunately, Outlook is capable of talking to IMAP mail servers, and
you can store old mail on the IMAP server. So, one easy way to convert
your mail to a normal format is to install the IMAP server on a Linux
box and transfer all your email to it.
<sect1>Copyright
<p>
Copyright (c) 2001 by Greg Lindahl
<p>
Please freely copy and distribute (sell or give away) this document in
any format. It's requested that corrections and/or comments be forwarded
to the document maintainer. You may create a derivative work and distribute
it provided that you:
<itemize>
<item>
Send your derivative work (in the most suitable format such as
sgml) to the LDP (Linux Documentation Project) or the like for posting
on the Internet. If not the LDP, then let the LDP know where it is
available.
<item>
License the derivative work with this same license or use GPL.
Include a copyright notice and at least a pointer to the license used.
<item>
Give due credit to previous authors and major contributors.
</itemize>
<P>
If you're considering making a derived work other than a translation,
it's requested that you discuss your plans with the current maintainer.
<sect1>Disclaimer
<p>
Use the information in this document at your own risk. I disavow any
potential liability for the contents of this document. Use of the
concepts, examples, and/or other content of this document is entirely
at your own risk.
All copyrights are owned by their owners, unless specifically noted
otherwise. Use of a term in this document should not be regarded as
affecting the validity of any trademark or service mark.
Naming of particular products or brands should not be seen as endorsements.
You are strongly recommended to take a backup of your system before
major installation and backups at regular intervals.
Do not place your cat in a running microwave oven.
<sect1>Related Information
<p>
A list of conversion utilities, many commercial, may be found at:
<url url="http://www.emailman.com/conversion/index.html"
name="http://www.emailman.com/conversion/index.html">
<sect>The Procedure
<sect1>Step 1: Installing an IMAP server (temporarily!) on your Linux box
<p>
Installing things varies from Linux distribution to distribution, so I
will use RedHat 7.0 as an example. First you need to install the
correct package, which generally is named "imap".
<tscreen><verb>
cd /home/redhat-7.0-cd/RedHat/RPMS
rpm -i imap*
</verb></tscreen>
Actually, since I had a "workstation" install, I also had to install
the xinetd package; rpm gave me an error which told me to do
this. And, of course, it was on the second CD of RedHat 7.0. Debian
users using "apt-get" don't have to worry about such issues.
<p>
Next, we need to enable the imap server. This is usually controlled by
a line in the file <tt>/etc/inetd.conf</tt>:
<tscreen><verb>
#imap stream tcp nowait root /usr/sbin/tcpd /usr/sbin/imapd
</verb></tscreen>
The above line is commented out; remove the leading # sign. On RedHat
7.0 systems and later with xinetd, instead edit <tt>/etc/xinetd.d/imap</tt>
and change "disable=yes" to "disable=no".
<p>
Then restart inetd or xinetd by doing:
<tscreen><verb>
/etc/rc.d/init.d/inetd restartor /etc/rc.d/init.d/xinetd restart
</verb></tscreen>
or
<tscreen><verb>
/etc/rc.d/init.d/xinetd restart
</verb></tscreen>
If all else fails, reboot.
<p>
You don't actually want to leave the IMAP server enabled for that
long. This server runs as root and has had security bugs in the
past. For this reason, you shouldn't leave it enabled unless you wish
to use it permanently. We will disable this server in step 4.
<p>
In order to connect Outlook to this IMAP server, you will need to know
the name or IP address of the Linux box.
<sect1>Step 2: Connecting your Outlook client to the server
<p>
In order to copy over all our email to the server, we need to tell
your Outlook client about this new server. Select "Accounts..." from
the "Tools" menu, and then "Add" a new account "Mail...". The
important items are that the server uses IMAP to download email, that
the incoming mail server is the name or IP address of your Linux box
from step 1, and the username and password should be your username and
password on the Linux box. (As usual, it's a bad idea to use the root
account on Linux for this purpose.)
<p>
Once you've hit "Finish", set this new account to be the default by
highlighting it and clicking on "Set as Default". Outlook should
connect to your IMAP server, and the name of your IMAP server should
appear at the bottom of your folder list. Click on it; you should see
an Inbox folder. (Note that if /var/mail/yourusername doesn't exist on
your Linux box, you won't be able to drag-and-drop any messages into
your INBOX... and the error message will be confusing. However, that's
not what we're going to do.)
<sect1>Step 3: Copying over all your email
<p>
At this point you can drag and drop entire folders of email from
Outlook onto the IMAP server name. This will copy the email, including
all attachments, to the Linux box. Unfortunately it also immediately
deletes it from Outlook. In order to copy items without deleting them,
right-click on the folder name and select the "Copy" option. For the
destination, pick your Linux server at the bottom of the list.
<p>
However, life isn't quite that simple. Outlook supports folders
containing folders which also contain messages. The Linux IMAP server
does not support that; a folder is either a regular file containing
messages, or a directory containing subdirectories and files. So if
you have folders in Outlook with both messages and subfolders, you
can't copy the entire tree over to the Linux IMAP server. Another
incompatibility of the Linux IMAP server is that you have to tell it
in advance if a new folder will contain subfolders or messages. You do
this by appending a slash (<tt>/</tt>) to the folder name when you create
it. This slash will disappear when the folder is created.
<p>
So, in order to copy a tree of folders to the Linux IMAP server, first
you need to create a replica of the structure of your existing folders
on the Linux IMAP server. While you're doing this, note which of the
existing folders contain both subfolders and messages. You will need
to move these messages elsewhere. Once you have the overall tree
created, then you can copy or move groups of folders to the Linux IMAP
server.
<p>
One final incompatibility to note is that the Linux IMAP server
doesn't allow folders with slashes (/) in their name. You'll need to
rename such folders before copying or moving them.
<p>
On the Linux box, folders appear as files and directories in your home
directory. The format of these files is the usual Unix mail format,
which most Unix/Linux mail tools either use directly or can convert
to/from. Files with attachments will have MIME attachments; there is
also one extra message per folder which is a (useless) header.
<p>
(One piece of data which doesn't get preserved is the original "From "
line, which contains the envelope address of the email. Fortunately
you don't actually need that information.)
<sect1>Step 4: Deinstalling IMAP from your Linux box
<p>
Once you've transferred all of your email, you will want to deinstall
the IMAP server from your Linux box, for the security reasons
mentioned earlier. This involves the same 2 steps you took to install
the server:
<enum>
<item> Remove the RPMs:
<tscreen><verb>
rpm -e imap
</verb></tscreen>
</item>
<item> Remove the line in <tt>/etc/inetd.conf</tt> or <tt>/etc/xinetd.d/imap</tt></item>
<item> Restart inetd or xinetd, or reboot.</item>
</enum>
<p>
Voila! You have taken another step towards a Microsoft-free lifestyle.
</article>