Chapter 3. PCMCIA configuration

Revision History
Revision 0.22002-04-14JN
corrected and edited
Revision 0.12002-03-15JN
initial revision

Table of Contents

Objectives
Step 1: declare the ppp and the pcmcia packages
Step 2: declare the ppp modules in modules.lrp
Step 3: configure ppp
Step 4: configure pcmcia
Step 5: configure your interfaces file
Step 6: configure Shorewall
Step 7: reboot...

Objectives

We assume here that your cable/ADSL connection is down and that you need to setup a router on your old laptop equipped with a combo Ethernet/Modem PCMCIA card. What follows describe the configuration of this emergency dial-up modem router. Your external interface (to the internet) will be using the modem facility of your PCMCIA card whereas your internal interface (to your internal network) will be connected to the ethernet network plug of your PCMCIA card (eth0).

What follows has been tested with Bering v1.0-rc1 and the pmcia_xircom.lrp package on a NEC Versa SX using a Xircom RealPort EThernet 10/100 + Modem 56k - ref REM56G-100BTX.

The PCMCIA-Howto and the PPP-Howto are useful references for this section.

Comments on this section should be addressed to its maintainer: Jacques Nilo .

Step 1: declare the ppp and the pcmcia packages

Boot a Bering floppy image. Once the LEAF menu appears get access to the linux shell by (q)uitting the menu. Edit the syslinux.cfg file and replace the pump entry by ppp,pcmcia in the LRP= list of packages to be loaded at boot. Check the Bering installation guide to learn how to do that.

Your syslinux.cfg file could look like (adjust to your taste):

display syslinux.dpy
timeout 0
default linux initrd=initrd.lrp init=/linuxrc rw root=/dev/ram0 boot=/dev/fd0u1680:msdos
	PKGPATH=/dev/fd0u1680 LRP=root,etc,local,modules,iptables,ppp,pcmcia,keyboard,shorwall,ulogd,dnscache,weblet

Important

The last two lines ("default linux ... dnscache,weblet") must be typed as a single one in syslinux.cfg

The ppp package is provided on the standard Bering floppy. The pcmcia.lrp package is available in the Bering download packages area. Check the Bering installation guide.

Step 2: declare the ppp modules in modules.lrp

In order to have a modem dialup connection working, you need to have ppp support enabled through the appropriate kernel modules.

To configure your modules, go to the LEAF Packages configuration menu and choose modules. Enter 1) to edit the /etc/modules file and enter the following information:

# Modules needed for PPP connection
slhc
ppp_generic
ppp_async
ppp_deflate

# Masquerading 'helper' modules
ip_conntrack_ftp
ip_conntrack_irc
ip_nat_ftp
ip_nat_irc

Backup the modules.lrp package.

Step 3: configure ppp

Connection with your ISP will be handled by PPP. The PPP How-to document will give you very detailed information about this protocol and how to set-up its numerous parameters.

Please refer to the Serial Modem section of this user's guide to learn how to configure your ppp package.

Step 4: configure pcmcia

First make sure to install in your pcmcia package the PCMCIA kernel modules that will be needed by your hardware. Refer to the Bering installation guide to learn how to do that.

For our Xircom card the following modules were used:

# ls -la /lib/modules/pcmcia
drwxr-xr-x    2 root     root         4096 avr 25 07:54 ./
drwxrwxrwt   27 root     root         4096 avr 25 07:52 ../
-rw-r--r--    1 root     root        11248 avr 25 07:53 ds.o
-rw-r--r--    1 root     root        33728 avr 25 07:53 i82365.o
-rw-r--r--    1 root     root        57272 avr 25 07:54 pcmcia_core.o
-rw-r--r--    1 root     root         8204 avr 25 07:54 serial_cs.o
-rw-r--r--    1 root     root        19680 avr 25 07:54 xirc2ps_cs.o

Once your package is ready, enter the LEAF Package configuration menu and choose pcmcia. The following menu will appear

                        pcmcia configuration files

        1) pcmcia default parameters
        2) pcmcia configuration
        3) wireless configuration

  q) quit
  ----------------------------------------------------------------------------
        Selection:

Entry 1) allows to edit the /etc/default/pcmcia file which defines the pcmcia parameters that will be used by the cardmgr program and the /etc/init.d/pcmcia script.

In our practical example (a Xircom RealPort EThernet 10/100 + Modem 56k - ref REM56G-100BTX) this file will contain:

PCMCIA=yes
PCIC=i82365.o
PCIC_OPTS=
CORE_OPTS=
CARDMGR_OPTS=

Entry 2) allows to edit the /etc/pcmcia/config.opts file. Please refer to the PCMCIA How-to for the explanation of the different options.

The default /etc/pcmcia/config.opts file provided in the pcmcia.lrp package is the default file provided in the pcmcia-cs package. It looks like:

include port 0xa00-0xaff
#
# Resources we should not use, even if they appear to be available
#
# First built-in serial port
exclude irq 4
# Second built-in serial port
exclude irq 12
# First built-in parallel port
exclude irq 7

Entry 3) is only used if you are using a wireless PCMCIA card. If not this file can only contain:

*,*,*,*)
    ;;

Refer to the wireless section of this user's guide if you need to setup wireless.

Step 5: configure your interfaces file

Trough the LEAF configuration menu type 1 to access to the network configuration menu and 1 again to edit your /etc/network/interfaces file. Enter the following information:

auto lo

iface lo inet loopback

iface eth0 inet static
        address 192.168.1.254
        masklen 24
        broadcast 192.168.1.255
up pon
up /etc/init.d/dnscache restart
up shorewall restart
down shorewall stop
down /etc/init.d/dnscache stop
down poff

No interface (except lo) is activated automatically. The pcmcia package will start cardmgr through the /etc/init.d/pcmcia script executed at boot time. The cardmgr program will then call the /etc/pcmcia/network script which will activate the eth0 interface using the information from the /etc/network/interfaces file. Here, the /etc/network/interfaces says for eth0:

  • Assign ip address 192.168.1.254/24 to the interface

  • Once eth0 is up, start the ppp connection through the pon script

  • Then restart dnscache, since dnscache was unable to start at boot time, eth0 being not available at that time

  • Then restart shorewall for the same reason

When stopping pcmcia the same command are executed in the reverse order through the down statement.

Backup the etc.lrp package.

Step 6: configure Shorewall

Through the LEAF packages configuration menu, choose shorwall and check the two following files:

A/ The interfaces file (entry 3) defines your interfaces. Here connection to the net goes through ppp0. So we must set:

(...)
#ZONE   INTERFACE       BROADCAST       OPTIONS
net     ppp0            -
loc     eth0            detect          routestopped
#LAST LINE -- ADD YOUR ENTRIES BEFORE THIS ONE -- DO NOT REMOVE

Warning

Do not forget the "-" under the BROADCAST heading for the net/ppp0 entry.

B/ The masq file (entry 7). In this context it should look like:

(...)
#INTERFACE              SUBNET
ppp0                    eth0
#LAST LINE -- ADD YOUR ENTRIES ABOVE THIS LINE -- DO NOT REMOVE

Backup the shorwall.lrp package.

Step 7: reboot...

Your modem connection should be established automatically. Type plog to check the login sequence with your ISP. If there is no output check /var/log/syslog to get a clue on potential problems.

Tip

If you want to be sure that your modem and/or script parameters are OK before backing up ppp.lrp and/or pcmcia.lrp, you can activate the pcmcia connection manually by typing launch the connection manually just by typing /etc/init.d/pcmcia start. Use /etc/init.d/pcmcia stop to stop the pcmcia connection, remove the modules and bring down eth0 and ppp0.