Category Archives: RedHat Linux

Sendmail and SMTP Authenticated Relay

This document is to configure SMTP server on Fedora Core 4, to use it from anywhere without the necessity of opening up the relay for public use and hence subjecting yourself to the possibility of being blacklisted or ending up in other databases such as ORBS. DRAC and SMTP AUTH are two different approach which addresses this.

The Purpose of this document is to explain the process of installation and Configuration of sendmail with relay for roaming users, ie,relay based on authentication. With SMTP-AUTH client may indicate an authentication mechanism to the server, perform an authentication protocol exchange, and optionally negotiate a security layer for subsequent protocol interactions. This extension is a profile of the Cyrus Simple Authentication and Security Layer [SASL].

Platform: Fedora Core 4, Sendmail 8.13.5

Installation of sendmail with SASL support

a) Download sendmail source package from:

ftp://ftp.sendmail.org/pub/sendmail/sendmail.8.13.5.tar.gz

This is downloaded into /usr/local/src directory.

b) tar -zxvf sendmail.8.13.5
c) cd sendmail-8.13.5
d) cd devtools/Site
e) joe site.config.m4
f) Add the following lines to it:
APPENDDEF(`confENVDEF’, `-DSASL’)
APPENDDEF(`conf_sendmail_LIBS’, `-lsasl’)

g) cd /usr/local/src/sendmail-8.13.5/cf/cf
h) create a file called linux.mc with exactly the following lines:

OSTYPE(`linux')dnl
define(`confCONNECTION_RATE_THROTTLE',40)dnl
define(`confMAX_HOP',30)dnl
define(`confMAX_MESSAGE_SIZE',10000000)dnl
define(`confPRIVACY_FLAGS',`authwarnings,needmailhelo')dnl
define(`confQUEUE_LA',5)dnl
define(`confREFUSE_LA',10)dnl
define(`confTO_CONNECT', `1m')dnl
define(`confTO_IDENT',0s)dnl
define(`confTO_QUEUEWARN', `12h')dnl
define(`confTRY_NULL_MX_LIST',true)dnl
define(`STATUS_FILE',`/etc/mail/sendmail.st')dnl
define(`ALIAS_FILE',`/etc/mail/aliases')dnl
FEATURE(`local_procmail', `/usr/bin/procmail')dnl
FEATURE(`always_add_domain')dnl
define(`confCW_FILE',` /etc/mail/local-host-names')dnl
FEATURE(`smrsh')dnl
define(`confEBINDIR',`/usr/lib/libexec')dnl
FEATURE(`use_cw_file')dnl
FEATURE(`redirect')dnl
FEATURE(`virtusertable',` hash -o /etc/mail/virtusertable')dnl
FEATURE(`access_db')dnl
FEATURE(`blacklist_recipients')dnl
TRUST_AUTH_MECH(`GSSAPI DIGEST-MD5 PLAIN LOGIN PAM')dnl
define(`confAUTH_MECHANISMS', `GSSAPI DIGEST-MD5 PLAIN LOGIN PAM')dnl
MAILER(`smtp')dnl

i) run :
m4 ../m4/cf.m4 linux.mc > sendmail.cf
j) cp sendmail.cf /etc/mail
if /etc/mail does not exist , create it and then copy
k) cd /usr/local/src/sendmail-8.13.5/
l) groupadd -g smmsp; useradd -g smmsp smmsp
m) sh Build
n) sh Build install
o) create a file called /etc/rc.d/init.d/sendmail with following lines ( the standard redhat startup-script):

#!/bin/sh
#
#This shell script takes care of starting and stopping sendmail.
#
# chkconfig: 2345 80 30
# description: Sendmail is a Mail Transport Agent, which is the program \
# that moves mail from one machine to another.
# processname: sendmail
# config: /etc/sendmail.cf
# pidfile: /var/run/sendmail.pid
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Source sendmail configureation.
if [ -f /etc/sysconfig/sendmail ] ; then
. /etc/sysconfig/sendmail
else
DAEMON=yes
QUEUE=1h
fi

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ -f /usr/sbin/sendmail ] || exit 0
RETVAL=0
# See how we were called.
case "$1" in

start)
# Start daemons.

echo -n "Starting sendmail: "
/usr/bin/newaliases > /dev/null 2>&1

for i in virtusertable access domaintable mailertable ; do
if [ -f /etc/mail/$i ] ; then
makemap hash /etc/mail/$i < /etc/mail/$i fi done daemon /usr/sbin/sendmail $([ "$DAEMON" = yes ] && echo -bd) \ $([ -n "$QUEUE" ] && echo -q$QUEUE) RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/sendmail ;; stop) # Stop daemons. echo -n "Shutting down sendmail: " killproc sendmail RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/sendmail ;; restart|reload) $0 stop $0 start RETVAL=$? ;; status) status sendmail RETVAL=$? ;; *) echo "Usage: sendmail {start|stop|restart|status}" exit 1 esac exit $RETVAL

********* End of start/stop sendmail script ************

0) use /etc/rc.d/init.d/sendmail start/stop to start/stop sendmail
p) cd /etc/mail
q) touch local-host-names access domaintable mailertable virtusertable
r) if not exist, create dir /var/spool/mqueue
Sendmail installation is complete

Authentication with PAM

Edit /usr/lib/sasl/Sendmail.conf. Add the following line to it:
pwcheck_method: PAM

Create /etc/pam.d/smtp with following lines:

#%PAM-1.0
auth required /lib/security/pam_pwdb.so shadow
account required /lib/security/pam_pwdb.so
session required /lib/security/pam_pwdb.so

Test your setup, by using clients like Outlook Express and relay mail through this server.

Fedora Core 3, ASUS K8S MX, SiS 180 SATA

This document briefly explains, on configuring SATA (SiS 180) drive on an ASUS K85 MX motherboard

The following is the hardware setup:

1. AMD 2800+ 64 Bit

2. ASUS K8S MX mobo (with on-board SiS 180 SATA Controller)

3. 160 GB Seagate SATA drive (this was partitioned by my windows XP as NTFS)

4. OS (Fedora Core 3) installed on a 80 GB IDE HDD (/dev/hda).

The Process:

Note: the 2.6.9 kernel which ships with fedora core 3 does not have the S-ATA patch to work with the Sis driver. So, we upgrade the kernel.

1. Update the kernel (I used the SMP version) from Fedora Updates. Install using rpm -ivh kernel-smp-2.6.10-1.766_FC3.x86_64.rpm

2. Install NTFS drivers for this kernel from the Sourceforge NTFS project page.. Enable NTFS support by loading the kernel module using /sbin/modprobe ntfs. You can see if NTFS is enabled by running cat /proc/filesystem. You should be seeing an entry for NTFS in it.

3. Now, download the kernel source. Fedora no longer ships with the kernel-source RPM. You must install it separately.
* Download the kernel source from Fedora Updates.

* Install this using rpm -ivh kernel-2.6.10-1.766_FC3.src.rpm.

* Set it up using rpmbuild -bp –target=noarch /usr/src/redhat/SPECS/kernel-2.6.spec.

The source files will be properly located in ‘/usr/src/redhat/BUILD/kernel-2.6.10’.

* create a symlink to the source: ln -s /usr/src/redhat/BUILD/kernel-2.6.10/linux-2.6.10 /usr/src/linux-2.6.10-1.766_FC3smp



4. Download the SiS 180 SATA driver from SiS Driver Download Page

# tar -zxvf sis18x_2.6.10_1.00.00.tgz
# cd cd sis18x_2.6.10_1.00.00
# make
# make install
# modprobe sata_sis

* Run fdisk /dev/sda to check the partition.

5. You can mount mount the disk using mount -t ntfs /dev/sda1 /data/

Configuring Software RAID on RedHat linux

This document describes how to setup software RAID in linear mode on
a RedHat Linux  system. Linear mode combines the capacity of
multiple
disk partitions into a single large partition with no redundancy.

Step 1: Organise RAID partitions

All data on the constituent partitions will be erased!

Decide which partitions will be used to form the RAID device. The
system
ID on these partitions should be changed to “fd” (Linux Raid Auto) so
that
the RAID device can be automatically restarted after a reboot (and mkraid
sometimes complains if they’re not of type “fd”).  To change a
partition’s
system ID, start fdisk with the name of the physical drive device as an
argument. When prompte, type “t” for “change a partition’s system Id”
and
then select “fd”.

 

Step 2: Create a raidtab configuration file

If /etc/raidtab does not exist, create one using the sample
template
at /usr/share/doc/raidtools-0.90/raidtab.sample.

cp /usr/share/doc/raidtools-0.90/raidtab.sample /etc/raidtab

Note: If an error occurs due to the RAID configuration and
the
machine won’t boot correctly as a result, rename or move the raidtab
file to prevent the init processes from attempting to start the RAID
drivers.
The machine can then be rebooted successfully and further configuration
can be done.

Step 3: Raidtab settings

For linear raid configuration, edit /etc/raidtab to resemble
the
following settings:

#

# linear RAID setup, with no spare disks:

#

raiddev /dev/md0

   
raid-level               
linear


   
nr-raid-disks            
2


    persistent-superblock    
1


   
chunk-size               
32

   
device                   
/dev/hda7


   
raid-disk                
0


   
device                   
/dev/hdb7


   
raid-disk                
1


 

To add another device to the RAID, increment the nr-raid-disks
parameter and add another set of device and raid-disk
parameters.

The persistent-superblock option has to be switched on
(set
to 1) to enable the system to auto-detect the raid device
after
a reboot.

The chunk-size option is meaningless for a linear RAID
configuration
so this can have any value.

Step 4: Initialise the RAID device

Prior to initialising the RAID device, the consistuent partitions must
be unmounted:

umount /dev/hda7

umount /dev/hdb7

Use the mkraid command to initialise the partition:

mkraid /dev/md0

The /proc/mdstat virtual file can be used to check the
status
of the new RAID device.

[root@test big]# cat /proc/mdstat

Personalities : [linear]

read_ahead 1024 sectors

md0 : active linear hdb7[1] hda7[0]

      47664640 blocks 32k rounding

unused devices: <none>

 

Step 5: Create the filesystem

A RAID device does not rely on having a particular type of filesystem.
To create an ext2 filesystem on the new RAID device use the mke2fs
command:

mke2fs /dev/md0

To convert this filesystem to ext3, run the command:

tune2fs -j /dev/md0

 

Step 6: Mount the RAID partition

If the constituent devices are still listed in /etc/fstab
they
should be removed so that they are not mounted during a reboot.

Add a new entry to /etc/fstab for the RAID device as
follows:

/dev/md0        
/big  
ext3   defaults 1 2

Mount the RAID device as follows:

mount /big

Finally, check the size of the RAID device using  df -h:

Filesystem           
Size  Used Avail Use% Mounted on


/dev/hda1            
251M   91M  146M  39% /


/dev/hda6            
121M  6.9M  108M   6% /home


none                 
250M     0  250M   0% /dev/shm


/dev/hda2            
2.0G  354M  1.5G  19% /usr


/dev/hda5            
121M   21M   95M  18% /var


/dev/md0            
45G   20k   42G   1%  /big

Network Configuration Using the Command Line

Network Configuration for a Static IP Address Using the Command Line

1. Load the proper module(driver) for your ethernet card:
The list of compiled ethernet card drivers that come with your system are usually located under /lib/modules/2.2.14-5.0/net where 2.2.14-5.0 is your kernel version. The source code for these drivers are usually located at /usr/src/linux-2.2.14/drivers/net again where 2.2.14 is the kernel version you are running. Sometimes the comments at the beginning of the source code file will tell you which ethernet cards the driver is for. Some distributions will find it during installation and automatically load the driver for you. To see if this is the case, view the file /etc/modules.conf or /etc/conf.modules depending on your distribution. If you see a line that looks similar to alias eth0 ne2k-pci, then the third item on the line is the module being used for your ethernet card. In this example, ne2k-pci, the NE2000 driver is being used. To verify the module has been loaded successfully, issue the command /sbin/lsmod. This will display all modules successfully loaded in the system. Once your module is loaded, you are ready to move to the next step.
If the module is not loaded, but you know what module your network card uses, issue the following steps as root:
                  * Make sure the network is stopped by issuing /etc/rc.d/init.d/network stop.
                  * Manually load the module by issuing /sbin/insmod ne2k-pci replacing ne2k-pci with whatever your module is. This module must be present in the /lib/modules/2.2.14-5.0/net directory for lsmod to find it.
                  * Verify it loaded successfully by issuing /sbin/lsmod.
                  * Activate the eth0 device by issuing /etc/rc.d/init.d/network start
                  * Configure your network settings with steps 2-6. You must still be root to perform these steps.

2. Set the IP address and network mask:
                  /sbin/ifconfig -a eth0 192.168.1.5 netmask 255.255.255.0.
                  This example gives the machine the IP address 192.168.1.5, but you can use any combination of IP/netmask that will work with your network.

3. Verify the settings with /sbin/ifconfig eth0.

4. Add the default gatway:
                  /sbin/route add default gw 192.168.1.254 , replacing 192.168.1.254 with your gateway.

5. Verify the gateway setting:
                  /sbin/route
                  The line beginning with default should have your gateway under the gateway column.

6. Alternately, you can edit the file /etc/sysconfig/network-scripts/ifcfg-eth0 to look like (replace with your network numbers)
                                 DEVICE=eth0
                                 USERCTL=no
                                 ONBOOT=yes
                                 BOOTPROTO=none
                                 BROADCAST=192.168.1.255
                                 NETWORK=192.168.1.0
                                 NETMASK=255.255.255.0
                                 IPADDR=192.168.1.5
         and the file /etc/sysconfig/network to look like (replace with your network numbers and hostname)
                                 NETWORKING=yes
                                 HOSTNAME=name.host.net
                                 FORWARD_IPV4=yes
                                 GATEWAYDEV=
                                 GATEWAY=192.168.1.254

Ping the gateway and a few other computers on the network to verify your settings are correct.

Network Configuration for DHCP Using the Command Line

1. Load the proper module(driver) for your ethernet card:
The list of compiled ethernet card drivers that come with your system are usually located under /lib/modules/2.2.14-5.0/net where 2.2.14-5.0 is your kernel version. The source code for these drivers are usually located at /usr/src/linux-2.2.14/drivers/net again where 2.2.14 is the kernel version you are running. Sometimes the comments at the beginning of the source code file will tell you which ethernet cards the driver is for. Some distributions will find it during installation and automatically load the driver for you. To see if this is the case, view the file /etc/modules.conf or /etc/conf.modules depending on your distribution. If you see a line that looks similar to alias eth0 ne2k-pci, then the third item on the line is the module being used for your ethernet card. In this example, ne2k-pci, the NE2000 driver is being used. To verify the module has been loaded successfully, issue the command /sbin/lsmod. This will display all modules successfully loaded in the system. Once your module is loaded, you are ready to move to the next step.
If the module is not loaded, but you know what module your network card uses, issue the following steps as root:
         * Make sure the network is stopped by issuing /etc/rc.d/init.d/network stop.
         * Manually load the module by issuing /sbin/insmod ne2k-pci replacing ne2k-pci with whatever your module is. This module must be present in the /lib/modules/2.2.14-5.0/net directory for lsmod to find it.
         * Verify it loaded successfully by issuing /sbin/lsmod.
         * Activate the eth0 device by issuing /etc/rc.d/init.d/network start
         * Configure your network settings with steps 2-4. You must still be root to perform these steps.

2. Edit/create the file /etc/sysconfig/network-scripts/ifcfg-eth0 to use DHCP.
Sample ifcfg-eth0 file:
                  DEVICE=eth0
                  USERCTL=no
                  ONBOOT=yes
                  BOOTPROTO=dhcp
                  BROADCAST=
                  NETWORK=
                  NETMASK=
                  IPADDR=

3. Replace eth0 above with eth1 if it is the second network card in your system.

4. Edit/create the file /etc/sysconfig/network to use DHCP.
               NETWORKING=yes
               HOSTNAME=
               FORWARD_IPV4=yes
               GATEWAYDEV=
               GATEWAY=

5. Restart the network to probe the DHCP server for your network settings with the command
               /etc/rc.d/init.d/network restart

6. Verify your network settings with the command /sbin/ifconfig to make sure you have received an IP address from the DHCP server.

7. Ping the gateway and a few other computers on the network to verify your connection.

Configuring a DHCP Server

You can configure a DHCP server using the configuration file /etc/dhcpd.conf.

DHCP also uses the file /var/lib/dhcp/dhcpd.leases to store the client lease database. Refer to the Section called Lease Database for more information.

Configuration File
The first step in configuring a DHCP server is to create the configuration file that stores the network information for the clients. Global options can be declared for all clients, or options can be declared for each client system.

The configuration file can contain any extra tabs or blank lines for easier formatting. The keywords are case-insensitive, and lines beginning with a hash mark (#) are considered comments.

There are two types of statements in the configuration file:

Parameters – state how to perform a task, whether to perform a task, or what network configuration options to send to the client.

Declarations – describe the topology of the network, describe the clients, provide addresses for the clients, or apply a group of parameters to a group of declarations.

Some parameters must start with the option keyword and are referred to as options. Options configure DHCP options; whereas, parameters configure values that are not optional or control how the DHCP server behaves.

Parameters (including options) declared before a section enclosed in curly brackets ({ }) are considered global parameters. Global parameters apply to all the sections below it.

Important
If you change the configuration file, the changes will not take effect until you restart the DHCP daemon with the command service dhcpd restart.

In Example 12-1, the routers, subnet-mask, domain-name, domain-name-servers, and time-offset options are used for any host statements declared below it.

As shown in Example 12-1, you can declare a subnet. You must include a subnet declaration for every subnet in your network. If you do not, the DHCP server will fail to start.

In this example, there are global options for every DHCP client in the subnet and a range declared. Clients are assigned an IP address within the range.

Example 12-1. Subnet Declaration
subnet 192.168.1.0 netmask 255.255.255.0 {
option routers 192.168.1.254;
option subnet-mask 255.255.255.0;

option domain-name “example.com”;
option domain-name-servers 192.168.1.1;

option time-offset -18000; # Eastern Standard Time

range 192.168.1.10 192.168.1.100;
}

All subnets that share the same physical network should be declared within a shared-network declaration as shown in Example 12-2. Parameters within the shared-network but outside the enclosed subnet declarations are considered global parameters. The name of the shared-network should be a descriptive title for the network such as test-lab to describe all the subnets in a test lab environment.

Example 12-2. Shared-network Declaration

shared-network name {
option domain-name “test.redhat.com”;
option domain-name-servers ns1.redhat.com, ns2.redhat.com;
option routers 192.168.1.254;
more parameters for EXAMPLE shared-network
subnet 192.168.1.0 netmask 255.255.255.0 {
parameters for subnet
range 192.168.1.1 192.168.1.31;
}
subnet 192.168.1.32 netmask 255.255.255.0 {
parameters for subnet
range 192.168.1.33 192.168.1.63;
}
}

As demonstrated in Example 12-3, the group declaration can be used to apply global parameters to a group of declarations. You can group shared networks, subnets, hosts, or other groups.

Example 12-3. Group Declaration

group {
option routers 192.168.1.254;
option subnet-mask 255.255.255.0;

option domain-name “example.com”;
option domain-name-servers 192.168.1.1;

option time-offset -18000; # Eastern Standard Time

host apex {
option host-name “apex.example.com”;
hardware ethernet 00:A0:78:8E:9E:AA;
fixed-address 192.168.1.4;
}

host raleigh {
option host-name “raleigh.example.com”;
hardware ethernet 00:A1:DD:74:C3:F2;
fixed-address 192.168.1.6;
}
}

To configure a DHCP server that leases a dynamic IP address to a system within a subnet, modify Example 12-4 with your values. It declares a default lease time, maximum lease time, and network configuration values for the clients. This example assigns IP addresses in the range 192.168.1.10 and 192.168.1.100 to client systems.

Example 12-4. Range Parameter

default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option routers 192.168.1.254;
option domain-name-servers 192.168.1.1, 192.168.1.2;
option domain-name “example.com”;

subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.10 192.168.1.100;
}

To assign an IP address to a client based on the MAC address of the network interface card, use the hardware ethernet parameter within a host declaration. As demonstrated in Example 12-5, the host apex declaration specifies that the network interface card with the MAC address 00:A0:78:8E:9E:AA always receives the IP address 192.168.1.4.

Notice that you can also use the optional parameter host-name to assign a host name to the client.

Example 12-5. Static IP Address using DHCP
host apex {
option host-name “apex.example.com”;
hardware ethernet 00:A0:78:8E:9E:AA;
fixed-address 192.168.1.4;
}

Tip
You can use the sample configuration file in Red Hat Linux 7.3 as a starting point and then add your own custom configuration options to it. Copy it to its proper location with the command cp /usr/share/doc/dhcp-<version-number>/dhcpd.conf.sample /etc/dhcpd.conf

(where <version-number> is the DHCP version you are using).

For a complete list of option statements and what they do, refer to the dhcp-options man page.

Lease Database
On the DHCP server, the file /var/lib/dhcp/dhcpd.leases stores the DHCP client lease database. This file should not be modified by hand. DHCP lease information for each recently assigned IP address is automatically stored in the lease database. The information includes the length of the lease, to whom the IP address has been assigned, the start and end dates for the lease, and the MAC address of the network interface card that was used to retrieve the lease.

All times in the lease database are in Greenwich Mean Time (GMT), not local time.

The lease database is recreated from time to time so that it is not too large. First, all known leases are saved in a temporary lease database. The dhcpd.leases file is renamed dhcpd.leases~, and the temporary lease database is written to dhcpd.leases.

The DHCP daemon could be killed or the system could crash after the lease database has been renamed to the backup file but before the new file has been written. If this happens, there is no dhcpd.leases file that is required to start the service. Do not create a new lease file if this occurs. If you do, all the old leases will be lost and cause many problems. The correct solution is to rename the dhcpd.leases~ backup file to dhcpd.leases and then start the daemon.

Starting and Stopping the Server
Important
Before you start the DHCP server for the first time, it will fail unless there is an existing dhcpd.leases file. Use the command touch /var/lib/dhcp/dhcpd.leases to create the file if it does not exist.

To start the DHCP service, use the command /sbin/service dhcpd start. To stop the DHCP server, use the command /sbin/service dhcpd stop. If you want the daemon to start automatically at boot time, see Chapter 8 for information on how to manage services.

If you have more than more network interface attached to the system, but you only want the DHCP server to start on one of the interface, you can configure the DHCP server to start only on that device. In /etc/sysconfig/dhcpd, add the name of the interface to the list of DHCPDARGS:

# Command line options here
DHCPDARGS=eth0

This is useful if you have a firewall machine with two network cards. One network card can be configured as a DHCP client to retrieve an IP address to the Internet. The other network card can be used as a DHCP server for the internal network behind the firewall. Specifying only the network card connected to the internal network makes the system more secure because users can not connect to the daemon via the Internet.

Other command line options that can be specified in /etc/sysconfig/dhcpd include:

-p <portnum> – Specify the udp port number on which dhcpd should listen. The default is port 67. The DHCP server transmits responses to the DHCP clients at a port number one greater than the udp port specified. For example, if you accept the default of port 67, the server listens on port 67 for requests and responses to the client on port 68. If you specify a port here and use the DHCP relay agent, you must specify the same port on which the DHCP relay agent should listen. See the Section called DHCP Relay Agent for details.

-f – Run the daemon as a foreground process. This is mostly used for debugging.

-d – Log the DHCP server daemon to the standard error descriptor. This is mostly used for debugging. If this is not specified, the log is written to /var/log/messages.

-cf filename – Specify the location of the configuration file. The default location is /etc/dhcpd.conf.

-lf filename Specify the location of the lease database file. If a lease database file already exists, it is very important that the same file be used every time the DHCP server is started. It is strongly recommended that this option only be used for debugging purposes on non-production machines. The default location is /var/lib/dhcp/dhcpd.leases.

-q – Do not print the entire copyright message when starting the daemon.

DHCP Relay Agent
The DHCP Relay Agent (dhcrelay) allows you to relay DHCP and BOOTP requests from a subnet with no DHCP server on it to one or more DHCP servers on other subnets.

When a DHCP client requests information, the DHCP Relay Agent forwards the request to the list of DHCP servers specified when the DHCP Relay Agent is started. When a DHCP server returns a reply, the reply is broadcast or unicast on the network that sent the original request.

The DHCP Relay Agent listens for DHCP requests on all interfaces unless the -i argument is used to specify one or more interfaces to listen to.

To start the DHCP Relay Agent, use the dhcrelay command followed by the name of at least one DHCP server to which the requests should be relayed. It can be started with the following options:

Table 12-1. DHCP Relay Agent Options

Argument Description
-i Names of the network interfaces to configure. If no interface is specified, all network interfaces will be configured, eliminating non-broadcast interfaces if it can.
-p Port on which dhcrelay should listen. The DHCP Relay Agent transmits requests to the servers on this port and transmits responses to the clients on the port one greater than this port.
-d Force dhcrelay to run in the foreground always.
-q Disable printing the network configuration of dhcrelay on startup.

Sendmail – Taking copies of all outgoing mails

If we need to take a copy of all outgoing mails, we have the following hack.

if you have installed sendmail from source .. create a file called copyuser.m4
in {Sendmail Source Dir}/cf/hack with the following content:
———— Cut Here ————–
divert(0)dnl
VERSIONID(`copyuser.m4′)dnl
ifdef(`_MAILER_smtp_’,,`errprint(`*** MAILER(smtp) must appear before copymail mailer’)’)dnl
LOCAL_CONFIG
CPNOCOPY
LOCAL_NET_CONFIG
R$+<@$+.NOCOPY.> $#esmtp $@$2 $:$1<@$2.>
R$+<@$+.> $#copymail $@nohostneeded $:$1<@$2.NOCOPY>
R$+<@$+> $#copymail $@nohostneeded $:$1<@$2.NOCOPY>

MAILER_DEFINITIONS
# Copy a message by sending it back to sendmail with an additional address:
# Here, the mail is sent to user mailbackup.
Mcopymail, P=/usr/sbin/sendmail, F=fmSDFMu,S=11/31,
R=ifdef(`_ALL_MASQUERADE_’, `21/31′, `21′),A=sendmail mailbackup $u

———— Cut Here ————–

then in ur sendmail.mc file add line
hack(`copyuser’)

Then generate the cf file and use it ( you should have created account called mailbackup where the backedup mail goes)