How to replace SLATTACH with TUN in JNOS 2.0 ---------------------------------------------- Maiko Langelaar, VE4KLM, 25Nov2004 * updated February 7, 2008 1) Introduction ------------ I will explain how to do this, using configurations which I have run, or am currently running. Note, I use Slackware 9.1 as my linux platform. I mention that, just incase you are wondering why the path of my 'rc.local' file does not match that of your 'rc.local' file. I use Jnos 2.0 as my NOS platform. I will do the 'before' verses 'after' approach using examples ... 2) Here is my existing SLIP connection (BEFORE) -------------------------------------------- Most existing JNOS systems interface to the linux networking using a slip connection between linux and JNOS. On the linux side the program, 'slattach', is run (usually from the /etc/rc.d/rc.local or similar file). On the JNOS side, an 'attach' command is placed in the autoexec.nos file to do the slip. 1) /etc/rc.d/rc.local # # Initialize the SLIP interface for the JNOS router # /usr/sbin/slattach -s 38400 -p slip /dev/ptyp0 & # sleep 3 # /sbin/ifconfig sl0 192.168.1.130 /sbin/ifconfig sl0 netmask 255.255.255.224 /sbin/ifconfig sl0 pointopoint 192.168.1.131 /sbin/ifconfig sl0 mtu 1500 /sbin/ifconfig sl0 up # 2) /jnos/autoexec.nos # attach asy ttyp0 - slip sl0 4096 256 38400 # ifconfig sl0 ipaddress 192.168.1.131 ifconfig sl0 netmask 255.255.255.0 ifconfig sl0 mtu 1500 # 3) Here is my new TUN connection (AFTER) ------------------------------------- First of all, there is no entry in the 'rc.local' file anymore. You should either comment out or remove the SLIP related stuff. With tun, it is all done from the JNOS side, there is no need to run the 'slattach' anymore, it's all done in the autoexec.nos now : # #attach asy ttyp0 - slip sl0 4096 256 38400 # attach tun tun0 1500 0 # ifconfig tun0 ipaddress 192.168.1.131 ifconfig tun0 netmask 255.255.255.0 ifconfig tun0 mtu 1500 # # sleep a second to make sure TUN driver is up pause 1 # # note, NOS creates the TUN device, so NOS needs to do a postconfig shell ifconfig tun0 192.168.1.130 pointopoint 192.168.1.131 mtu 1500 up # A couple of things to note. The attach for the slip is commented out, and there is a new attach command for the tun device. In the above example, I've renamed the sl0 interface to tun0, but you don't have to of course. The three ifconfig lines don't change from before. There are two new lines, one to give the tun device a chance to come up (probably not necessary, but doesn't hurt), and secondly a shell out to linux to do a linux side configuration of the new tun device. 4) IMPORTANT CONCEPT TO UNDERSTAND ------------------------------- The tun device is created by NOS itself, when it does an open on the kernel tun device (/dev/net/tun). BEFORE you run JNOS, you won't be able to access the device. For example, using ifconfig to create and configure the device will not work, because it won't exist YET. Once JNOS is up and running, the device then becomes available. I don't believe this to be a big issue for most installations, and it works fine for my setup here at home. Copyright (c) 2008 by Maiko Langelaar / VE4KLM