|
Basic Ethernet to Serial Router
|
|
Several of these were constructed to provide basic dial in access from remote Ethernet LANs to an office LAN via Windows NT Remote Access Services. The configuration below assumes that the router is dialing into a RAS connection and has been assigned a fixed IP address and that no service (such as FTP, Web Server, etc.) are running on the LAN. Configuration settings for server-assigned IP addresses, support for local services (Web Server, FTP, etc.), are described in the configuration examples at Dave Mischler's IPRoute Web Site.
One router was built using a internal modem and another using a external ISDN adapter. Aside from the differences due to internal versus external and the different dialing requirements for the modem and the ISDN the two are essentially the same.
The common materials used were:
- IPRoute v 1.18
- MSDOS
- a 1.44 floppy drive
- a used PC, in these cases 386sx-16/20 machines.
- a 10MB Ethernet card
- a high speed internal modem or
- a high speed serial port and a Motorola BitSURFR Pro for the ISDN version
The software expects a "packet driver" interface to the Ethernet and most cards come with this driver in the package. It can also be setup using either an ODI or NDIS driver and a packet "shim" such as "ODIPKT" or "NDISPKT" as appropriate. A Wireless LAN router using the ODI/ODIPKT approach is described later.
Using the packet driver approach there are only two things that need to be configured, AUTOEXEC.BAT and the IPRoute configuration file. The AUTOEXEC.BAT setup obviously depends on the name of your card driver but basically looks like:
AUTOEXEC.BAT
meth16pd.com 0x60 0xA 0x0300
------^----- --^- -^- --^---
| | | \_The card I/O address
| | \_The card hardware IRQ
| \_software interrupt to use
\_the packet driver name
ipr isdn.ipr
The value of the "software interrupt" is used in by IPRoute to communicate with the Ethernet card so must match the value used it the configuration file. The configuration file below is for a dual channel 128kb ISDN interface using a high speed serial card and a Motorola BitSURFR Pro ISDN Terminal Adapter.
The serial interface in this file is configured for an external Motorola BitSURFR Pro ISDN Adapter connected on a high speed serial card based on the 16550 UART chip. This card, a Model TC-200-S6-1 from Byte Runner Technologies, allows interface speeds up to 460,800 BPS and has sufficient buffering to keep up with the ISDN link. The card has jumpers to double or quadruple the interface speed, so in this case setting the interface to 115200 BPS actually results in a 230400 BPS output to the ISDN adapter.
We found that the BitSURFR could not be reset and redialled reliably when set at 230 kBPS so this configuration forces the BitSURFR to reset to factory defaults, and resets the external interface to 115,200, before attempting a redial. This portion of the configuration file should be deleted for a modem interface.
ISDN.IPR
; 4:29 PM 2/22/98
;
; IPR script for example configuration with PPP using
; a static (fixed) IP address and no incoming services.
;
; This script assumes the modem is configured for 8 bit
; data, no parity, 1 stop bit, RTS/CTS flow control,
; and DTR and CD operate normally.
; Start a command interpreter on the console
command
ftpd
; Telnet Daemon - This goes in the top part of the
; script (startup section)
telnetd do_tel
user username password *:21
;
; Configure ethernet interface with IP address
; 192.168.1.254 Note that /24 specifies the network
; prefix width, i.e. the number of ones in the netmask.
; the /24 corresponds to 255.255.255.0
packet en0 0x60 192.168.1.254/24
; Configure the modem port on COM 1 and make it the
; default route (IPRoute doesn't like the value 115200
; here so use 57600 to start) The interface card
; doubles the speed so 57600 is really 115200 at
; the BitSURFR
async sl0 0x3f8 4 57600 do_sl0
delay .25
; Make this interface the default route
route * sl0 perm
; Broadcast RIP routes on the ethernet
rip en0
; Log everything to the console.
; set log file con
; Logs to local SysLog
; set log udp 192.168.1.1
exit
;
; Script for filter and NAT configuration on sl0,
; with demand dial out, etc.
;
do_sl0:
; Turn on debug stuff.
set trace on
set log raw on
;
; Set up NAT
;
; allows telnet/ftp to router using non-standard ports
nat sl0 tcp 192.168.1.254:21 www.xxx.yyy.zzz:2021
nat sl0 tcp 192.168.1.254:23 www.xxx.yyy.zzz:2023
; pass the ping to the router so we can ping it from
; the upline side
nat sl0 icmp 192.168.1.254 www.xxx.yyy.zzz
; pass everything else to host
nat sl0 * 192.168.1.1 www.xxx.yyy.zzz
nat * * www.xxx.yyy.zzz
; general reset for unknown packets
set nat send-reset on
;
; Configure modem control and set up for immediate dial.
;
set interface rts flow
hangup:
; Hangup will cause DTR to drop, which should set the
; BitSURFR to basic speed
; First, set the interface speed back to something
; slower (doubled in the card) or the BitSURFR will
; usually not respond --- this sets the speed to
; 115200
set interface sl0 speed 57600
delay .25
; Then reset the interface
set interface dtr off
delay .25
set interface dtr on
delay .25
; Then send a general reset
send sl0 "atz0\r"
wait 1 "OK"
; Sets the interface for dial on demand
; remove for immediate dial
on packet dialout
wait 0
;
; Dial the phone, wait for a connection, and run PPP.
; This assumes the remote end will request PAP or CHAP
; authentication. Hang up if no packets are received
; for 20 minutes - use a keepalive on the clients.
;
dialout:
; BitSURFR specific
; Before dialing, tell the BitSURFR to run at
; 230400 BPS
send sl0 "at@p2=230400\r"
wait 1 "OK"
; Then change the to 115200 (doubled by serial card)
; and the whole lashup SHOULD be running at 230K
set interface sl0 speed 115200
delay .25
; Then set interface to reset to basic values when
; DTR goes low (&D3)
send "AT&F&C1&D3%A2=95%A4=0@B0=2\r"
wait 1 "OK"
; And dial it
send "ATDnnn-nnn1 & nnn-nnn2\r"
on timeout hangup
; this is ISDN so we don't have to wait long for a
; connection this "wait" will have to be longer for
; a modem
wait 15 "CONNECT"
; Read the rest of the CONNECT message into symbol
; "speed".
on cd lineup
read 5 "\r" $speed
lineup: on cdloss hangup
on timeout hangup
log "Connected at $speed"
set ppp login rasname raspassword
set ppp trace on
; 15 minute timeout
ppp 900 www.xxx.yyy.zzz/24
goto hangup
; This will run for each incoming telnet connection.
do_tel:
on cdloss drop_tel
wait 1
on timeout drop_tel
send "\r\nlogin: "
set echo on
read 60 "\r\n" NAME
send "\r\nPassword:"
set echo off
read 60 "\r\n" PASS
authenticate NAME PASS *:21
log "$NAME logged in from $IPADDR:$PORT"
send "\r\n\n"
command
drop_tel:
exit
This router configuration provides reliable throughput with either a 56kb modem or a 128kB ISDN link.
|