[nos-bbs] TUN0 addressing w/JNOS atop Linux

Tim Gorman ab0wr at ab0wr.net
Wed Jan 11 22:30:27 EST 2006


Jay,

Here is what I get from a route command in jnos:

jnos> route
Destination      Len Interface Gateway          Metric P Timer  Use
44.0.0.0         8   pk0                        1        man    0
192.168.10.1     32  tun0                       1        man    0
default          0   tun0                       1        man    0
jnos>


Here is what my linux box looks like:

bagend:~ # netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.10.33   0.0.0.0         255.255.255.255 UH        0 0          0 tun0
192.168.10.0    0.0.0.0         255.255.255.0   U         0 0          0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U         0 0          0 lo
0.0.0.0         192.168.10.1    0.0.0.0         UG        0 0          0 eth0
bagend:~ #

Here is what my ifconfig shows:

bagend:~ # ifconfig
eth0      Link encap:Ethernet  HWaddr 00:E0:7D:95:C4:6B
          inet addr:192.168.10.12  Bcast:192.168.10.255  Mask:255.255.255.0
          inet6 addr: fe80::2e0:7dff:fe95:c46b/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:465449126 errors:790 dropped:16 overruns:16 frame:0
          TX packets:872663854 errors:14581 dropped:0 overruns:11 
carrier:29162
          collisions:12364203 txqueuelen:1000
          RX bytes:4091330498 (3901.7 Mb)  TX bytes:2695195206 (2570.3 Mb)
          Interrupt:11 Base address:0xa000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:4640157 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4640157 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:453907239 (432.8 Mb)  TX bytes:453907239 (432.8 Mb)

tun0      Link encap:Point-to-Point Protocol
          inet addr:192.168.10.12  P-t-P:192.168.10.33  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:10
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

My system is a standalone linux box on my local 192.168.x.x network. The box 
has an address of 192.168.10.12 to everything on the ethernet. I assigned 
192.168.10.33 to the jnos system running on the box. Linux looks at it like 
another box on the network. All the other boxes on the network use my system 
at 192.168.10.1 as a router so I had to add a route statement in 192.168.10.1 
to point 192.168.10.33 back to the 192.168.10.12 as a gateway box. 


my system would be like:

         (world)
           |
         (eth0)
           |
     192.168.10.1,     192.168.10.2, ......  (local network)
           |
         (eth1)
           |
     192.168.10.12  (linux) (gateway for 192.168.10.33)
           |
         (tun0)
           |
     192.168.10.33  (jnos)
           |
         (pk0)
           |
        44.x.x.x  (pk232mbx)

I don't have my boxes set up as 44.x.x.x gateways but that is on the list of 
things to do. 


Here is my setup in autoexec.nos:

---------------------------------------------------------
attach tun tun0 1500 0
#
ifconfig tun0 ipaddress 192.168.10.33
ifconfig tun0 netmask 255.255.255.0
ifconfig tun0 mtu 1500
#
pause 1
#
shell ifconfig tun0 192.168.10.12 pointopoint 192.168.10.33 mtu 1500 up
#
#
attach asy modem - ax25 pk0 4096 256 9600
#
ifconfig pk0 description "packet port on 145.03 Mhz"
#
param pk0 2 256
param pk0 3 1
param pk0 5 1
#
param pk0 TxDelay 25
#
#
start ax25
route add 192.168.10.1/36 tun0
route add default tun0
route add 44/8 pk0

----------------------------------------------------------


It would help if you would post the results of a route command from your jnos 
system.

The big problem I see is no tun0 entry in your ifconfig command. Nor do I see 
a 44.x.x.x routing entry in your route command output. The linux box should 
have a route entry of something like:

44.102.128.1   0.0.0.0     255.255.255.255 UH     0 0     0 tun0

Without this your linux box won't know how to send anything to the jnos 
system.

I suspect the ifconfig command is failing because your system doesn't know 
anything about your 192.168.2.2 address. It isn't defined anywhere so linux 
doesn't know what to do with it.

As the root user try doing a cd command to /var/log and do a 

             grep ifconfig messages

and see if any error messages come up when you try to run jnos. I'll bet 
you'll see something associated with tun0.

I am guessing the autoexec.nos should have the shell command of:

shell ifconfig tun0 44.102.128.1 pointopoint 216.144.222.182 mtu 1500 up

You probably also need to set up a linux route command like

route add -net 44.0.0.0 netmask 255.0.0.0 dev tun0

And you will probably need a jnos route command like

route add default tun0


See if any of this helps and let us know what happens.

tim ab0wr

On Wednesday 11 January 2006 02:42, Jay Nugent wrote:
> Greetings,
>    Okay, I give up!  Someone who has *ACTUALLY* done this, please explain
> to me how to set up the TUN0 addressing *and* the route table that needs
> to be built on the linux side.
>
>    A friend insists on running JNOS2.0d on Linux.  He's been 4 MONTHS
> trying to get it to run.  Is there any wonder why I told him to trash the
> idea and just keep it simple and run JNOS on DOS.  Sweet. clean and
> simple.  He could have been up and operational in 20 minutes!
>
>    Now I've been pulled into the mess to try to figure out what he has
> done wrong, and/or how it should be done right.
>
>    This box will be configured as a HamGate, so his Public IP on his eth0
> interface (216.144.222.182) *MUST* be delivered to the JNOS application
> because he *will* be running IPIP encapsulation to all the other HamGates
> across the world and this IP is what's published in encap.txt.
>
>    This is how he has it set up (which doesn't work):
>
>
>     JNOS application
>       44.102.128.1
>
>            | TUN0
>
>       44.102.128.1  P-t-P 192.168.2.2
>
> His route table on Linux:
> =========================
> Destination     Gateway         Genmask         Flags Metric Ref Use Iface
> 192.168.2.2     0.0.0.0         255.255.255.255 UH    0      0     0 tun0
> 216.144.222.176 0.0.0.0         255.255.255.248 U     0      0     0 eth0
> 0.0.0.0         216.144.222.177 0.0.0.0         UG    0      0     0 eth0
>
> Ifconfig eth0:
> ==============
> eth0 Link encap:Ethernet  HWaddr 00:20:78:1D:99:8B
>      inet addr:216.144.222.182  Bcast:216.144.222.183 Mask:255.255.255.248
>      inet6 addr: fe80::220:78ff:fe1d:998b/64 Scope:Link
>      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>      RX packets:13285 errors:0 dropped:0 overruns:0 frame:0
>      TX packets:5245 errors:0 dropped:0 overruns:0 carrier:0
>      collisions:1 txqueuelen:1000
>      RX bytes:1043289 (1018.8 KiB)  TX bytes:696201 (679.8 KiB)
>      Interrupt:10 Base address:0x8000
>
>
>
>    NO traffic EVER goes up the TUN0 interface....
>
>
> Pertinent parts of his autoexec.nos:
> ====================================
> #
> ip address 44.102.128.1
> #
> # Create a network interface. This allows us to talk to the linux
> # box on which JNOS is running - and in turn - to the internet.
> #--------------------------
> attach tun tun0 1500 0
> #
> ifconfig tun0 ipaddress 44.102.128.1
> ifconfig tun0 netmask 255.255.255.0
> ifconfig tun0 mtu 1500
> #
> # Give it a chance to come up
> pause 3
> #
> # JNOS creates the TUN device, so JNOS needs to do some post
> # configuration, by shelling out to the linux command line and
> # running 'ifconfig' command.
> shell ifconfig tun0 44.102.128.1 pointopoint 192.168.2.2 mtu 1500 up
> #
>
>
>    Any suggestions where he went wrong?
>
>    Thanks!
>
>       --- Jay Nugent  WB8TKL
>
> "Those that sacrifice essential liberty to obtain a little temporary safety
>  deserve neither liberty nor safety."  -- Ben Franklin (1759)
> +------------------------------------------------------------------------+
>
> | Jay Nugent   jjn at nuge.com    (734)484-5105    (734)544-4326/Fax        |
> | Nugent Telecommunications  [www.nuge.com]     (734)649-0850/Cell       |
> |   Internet Consulting/Linux SysAdmin/Engineering & Design/ISP Reseller |
> | ISP Monitoring [www.ispmonitor.net] ISP & Modem Performance Monitoring |
> | Web-Pegasus    [www.webpegasus.com] Web Hosting/DNS Hosting/Shell Accts|
> | LinuxNIC, Inc. [www.linuxnic.net]   Registrar of the .linux TLD        |
>
> +------------------------------------------------------------------------+
>   3:01am  up 3 days,  1:42,  4 users,  load average: 0.00, 0.01, 0.00
>
>
> _______________________________________________
> nos-bbs mailing list
> nos-bbs at lists.tapr.org
> https://lists.tapr.org/cgi-bin/mailman/listinfo/nos-bbs




More information about the nos-bbs mailing list