LinuxSecurity.com
Share your story
The central voice for Linux and Open Source security news
Home News Topics Advisories HOWTOs Features Newsletters About Register

Welcome!
Sign up!
EnGarde Community
Login
Polls
What is the most important Linux security technology?
 
Advisories
Community
Linux Events
Linux User Groups
Link to Us
Security Center
Book Reviews
Security Dictionary
Security Tips
SELinux
White Papers
Featured Blogs
All About Linux
DanWalsh LiveJournal
Securitydistro
Latest Newsletters
Linux Advisory Watch: October 31st, 2014
Linux Security Week: October 27th, 2014
Subscribe
LinuxSecurity Newsletters
E-mail:
Choose Lists:
About our Newsletters
RSS Feeds
Get the LinuxSecurity news you want faster with RSS
Powered By

  
Troubleshooting: Questions and Answers

3. Troubleshooting: Questions and Answers

3.1. Question: How can I keep the settings through a reboot?

Answer: Whether you are using BSD-style or SysV-style (Redhat™ for example) init, you can always include it in /etc/rc.d/rc.local. Here's what I have on my SysV init system (Redhat™ 3.0.3 and 4.0):

My /etc/rc.d/rc.local: (edited to show the relevant portions)

#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
# 

3.2. 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)?

Answer: Create (if it doesn't already exist) a file called, /etc/mynames.cw,for example. The file does not have to be this exact name nor in the /etc directory.

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.

The /etc/mynames.cw might look like this:

# /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 

In your sendmail.cf file, where it defines a file class macro Fw, add the following:

     
##################
#   local info   #
##################
				     
				     
# file containing names of hosts for which we receive email
Fw/etc/mynames.cw
				 

That should do it. Test out the new setting by invoking sendmail in test mode. The following is an example:

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 >
>

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.

You are all set now.

    
Partner

 

Latest Features
Peter Smith Releases Linux Network Security Online
Securing a Linux Web Server
Password guessing with Medusa 2.0
Password guessing as an attack vector
Squid and Digest Authentication
Squid and Basic Authentication
Demystifying the Chinese Hacking Industry: Earning 6 Million a Night
Free Online security course (LearnSIA) - A Call for Help
What You Need to Know About Linux Rootkits
Review: A Practical Guide to Fedora and Red Hat Enterprise Linux - Fifth Edition
Yesterday's Edition
Pirate Bay founder guilty in historic hacker case
Parallels CTO: Linux container security is not the problem
Advisory says to assume all Drupal 7 websites are compromised
Partner Sponsor

Community | HOWTOs | Blogs | Features | Book Reviews | Networking
 Security Projects |  Latest News |  Newsletters |  SELinux |  Privacy |  Home
 Hardening |   About Us |   Advertise |   Legal Notice |   RSS |   Guardian Digital
(c)Copyright 2014 Guardian Digital, Inc. All rights reserved.