notes on configuring asynchronous transfer mode in a linux+cisco+fore environment |
---|
as freebsd no longer supports ATM networking as of 7.1-release, i found that i had to migrate to linux if i wanted to keep using ATM in my network. fortunately ATM support in linux remains actively supported and it was fairly easy to sit down and come up with an equivalent way to accomplish what i was doing with freebsd. i am using debian linux so my procedure will center around that, but really any linux distribution will work just fine; we will have to build most of the pertinent bits from scratch anyway. |
first we will load a fairly bare bones debian linux system using the following procedure. this will give us a system without too much cruft; fairly equivalent to the stock freebsd installation. |
1. boot up off the debian netinst cdrom 2. select 'install' 3. language 'english', country 'united states', keymap 'american english' 4. hostname can be 'debian' for now, we will change it later. 5. specify the domain name for your site when prompted. 6. time zone 'eastern'. 7. use 'manual' partitioning and partition the disc as desired. 8. the installer will do its thing as it installs the base system. 9. set the password for the root user when prompted. 10. create an account for a regular user and set the password for it when prompted. 11. archive mirror country 'united states'. i like to use 'mirrors.kernel.org'. leave http proxy blank. 12. participate in package usage survey 'no'. 13. install just the 'standard system' and continue. be sure to deselect the 'desktop environment' option. 14. yes, 'install grub to the master boot record'. 15. the installation will complete. pull the installation cd-rom from the drive and let the system reboot. |
once the system reboots, we will need to install some stuff; just use the ethernet for this. |
apt-get install gcc apt-get install bison apt-get install make apt-get install flex apt-get install ncurses-dev apt-get install csh |
now that we have the base linux system up and running, we can build the custom kernel and the ATM support software. you will have to gather all the requisite parts from various locations. |
1. the pca200e.bin firmware file, from the pca200e-0.4.tar.gz driver package. you can get it here.
2. linux-2.6.34.tar.gz, the most modern kernel available at the time of this writing. you can get it from ftp.kernel.org. 3. linux-atm-2.5.1.tar.gz, source for the ATM userland support binaries. you can get it here. |
grab all of these files and save them to /usr/src. extract them, then set up the usual and customary kernel symlink. and run a kernel configuration. |
ln -s /usr/src/linux-2.6.34 /usr/src/linux cd /usr/src/linux make menuconfig |
by default, the kernel will basically include support for just about everything. we just need to make sure that ATM support (drivers, CLIP, etc) is enabled for all the cards that we are interested in. to enable drivers for ATM cards, go to the following section in menuconfig. |
device drivers->network device support->atm drivers |
the pca-200e remains my workhorse ATM card so i want to make sure that "pca-200e support" is enabled. if you want to enable the forerunner LE-155 NICstar based device, you can also select "use SUNI phy driver (155 MBps)" under the "IDT 77201 (NICstar) (ForeRunner LE)" heading. if you have another type of ATM card that i did not mention, enable that. otherwise you may leave the kernel configuration as default. |
note that the 2.6.26.8 kernel is the most recent linux kernel that we can use which has the fore binary microcode blobs included. subsequent kernel releases have had these removed and thus fore pca-200e cards will not work until this binary blob is installed from another source. if you are just using the LE-155 nicstar based cards, this isnt really an issue as they do not depend on an external microcode blob. |
after adding support for the desired ATM cards, exit out of menuconfig and save the new configuration when prompted. now run through the kernel build procedure. |
make bzImage make modules make modules_install |
once the kernel and modules have been built and installed, create the initrd file |
mkinitramfs -o /boot/initrd.img-2.6.34 2.6.34 |
now install the new kernel itself and the associated System.map and config files. |
cp System.map /boot/System.map-2.6.34 cp arch/i386/boot/bzImage /boot/vmlinuz-2.6.34 cp .config /boot/config-2.6.34 |
now add the kernel to the grub configuration file. |
update-grub |
you can also add the requisite lines to the menu.lst file manually; they will look like the following. |
title Debian GNU/Linux, kernel 2.6.34 root (hd0,0) kernel /vmlinuz-2.6.34 root=/dev/sda2 ro quiet initrd /initrd.img-2.6.34 title Debian GNU/Linux, kernel 2.6.34 (single-user mode) root (hd0,0) kernel /vmlinuz-2.6.34 root=/dev/sda2 ro single initrd /initrd.img-2.6.34 |
finally we need to install the binary blob firmware for the pca-200e cards. find the pca-200e firmware file in the linux pca-200e driver package, rename it to pca200e.bin, and place it in the /lib/firmware directory. |
after the system comes up, test it out. try to insmod the fore_200e.ko module. it should load without any errors in dmesg and it should bring the card up to the point where the link will show as up on the ATM switch for the port. if all is well, now you are ready to build the ATM userland tools. |
cd /usr/src tar xvfz linux-atm-2.51.tar.gz cd linux-atm-2.51 ./configure && make && make install |
note that you will need to have GNU flex installed before building the ATM userland tools. after the build has finished, you may need to run an ldconfig if the system complains that it cant load libatm. |
now, configure a test circuit on our Fore ATM switch. for the purposes of this exercise we will use circuit 0/90. the cisco router is connected to port 1A1, and the linux machine is connected to port 1C4. |
configuration vcc new 1A1 0 90 1C4 0 90 configuration vcc new 1C4 0 90 1A1 0 90 |
then configure the test circuit on the Cisco router. for the purposes of this exercise, the router will have IP address 192.168.0.1 and the linux machine will have the IP address 192.168.0.2. |
interface ATM1/0.90 point-to-point description ATM link to linux machine -- 1C4 mtu 9180 ip unnumbered BVI1 no ip redirects no snmp trap link-status pvc 0/70 protocol ip 192.168.0.2 broadcast encapsulation aal5snap ! ip route 192.168.0.2 255.255.255.255 atm1/0.90 |
this should all be fairly familiar from my tutorial regarding the use of freebsd and ATM. what is really new here is how we will configure the circuit in linux, as follows. |
atmarpd -b atmarp -c atm0 ifconfig atm0 192.168.0.2 netmask 255.255.255.0 mtu 9180 up atmarp -s 192.168.0.1 0.0.90 # VPI/VCI 0/90 for this circuit route add -net 0.0.0.0 gw 192.168.0.1 netmask 0.0.0.0 route delete -net 192.168.0.0/24 |
really, the methodology is very similar to that which was used in freebsd with NATM. we bring the interface up with an IP address, tell the system how to find the other end of the point to point link with the VPI/VCI, add the default route, then clean up the local subnet route that is automatically created when the interface is brought up. |
bringing up the ATM interface manually in this way is great for testing, but for production use we will want to modify the system init scripts such that the link is brought up automatically at startup. i found that the best way to do this was simply to modify the /etc/init.d/networking script, as follows. |
case "$1" in start) process_options log_action_begin_msg "Configuring network interfaces" if ifup -a; then log_action_end_msg $? else log_action_end_msg $? fi # Bring up the ATM interface /usr/local/sbin/atmarpd -b /usr/local/sbin/atmarp -c atm0 /sbin/ifconfig atm0 192.168.0.2 netmask 255.255.255.0 mtu 9180 up /usr/local/sbin/atmarp -s 192.168.0.1 0.0.90 /sbin/route add -net 0.0.0.0 gw 192.168.0.1 netmask 0.0.0.0 /sbin/route delete -net 192.168.0.0/24 ;; |
at this point, you should be up and running with your new ATM interface. the system should behave exactly as it would in the case of the example prepared with freebsd. if you have further questions, you may find the following references useful. |
ATM configuration on linux: http://www.linuxjournal.com/article/3005 main linux-ATM site: http://linux-atm.sourceforge.net/ |
home |