[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Memo: How to setup Slip tunnel between two machines



 
    
How to setup Slip tunnel between two machines:

Problem:

    1. bucket on a secure network, xauth cookie is forbidden to forward;
       so we can not run any X applications on bucket, e.g, emacs, xlogo ...

	[terrence@bucket bin]$ xlogo
	Error: Can't open display: 

Solution:

    1. compile slirp 1.0.9 (http://users.erols.com/tygris/slirp/, D/L from http://metalab.unc.edu/pub/Linux/system/network/serial/slirp-1.0.9.tar.gz) on 
       bucket:

	./configure --disable-ppp

    2. run a modified pty-redir (ftp://igloo.its.unimacq.edu.au/pub/Linux/pty-redir) on igloo:

	[terrence@igloo pty-redir-0.1]$ ./pty-redir /usr/bin/ssh crystal -t ssh bucket -t bin/slirp
	Using tty is: /dev/ttypd
	argv[1] = /usr/bin/ssh
	args = /usr/bin/ssh
	envs = (null)
	terrence@crystal's password: 

    3. on bucket, check whether slirp is runing:

	[terrence@bucket bin]$ ps -aef|grep slirp
	terrence  13259  30697  0.0 20:24:35 ttypa        0:00.01 grep slirp
	terrence   1765   3668  0.0 20:23:58 ttypc        0:00.03 bin/slirp

    4. on igloo, root does:

	[root@igloo /root]# slattach -L /dev/ttypd &
	
	[root@igloo tunnel]# cat /proc/net/dev
	Inter-|   Receive                                                |  Transmit
	 face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
	    lo:618464640 1054329    0    0    0     0          0         0 618464640 1054329    0    0    0     0       0          0
	  eth0:231148206 9632172    0    0    0     0          0         0 964916561 3164569    0    0    0 179422       0          0
	  ppp0:26067591   18984   81    0    0    42          0         0   282000   10504    0    0    0     0       0          0
	  ppp1:     450      21    0    0    0     0          0         0      581      21    0    0    0     0       0          0
	   sl0:       0       0    0    0    0     0          0         0     6872      61    0    0    9     2       0          0
	   sl1:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0

	[root@igloo tunnel]# ifconfig sl1 192.168.8.1 pointopoint 137.111.146.11

	[root@igloo tunnel]# route -n
	Kernel IP routing table
	Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
	137.111.146.11  0.0.0.0         255.255.255.255 UH    0      0        0 sl1
	137.111.20.252  0.0.0.0         255.255.255.255 UH    0      0        0 eth0
	192.168.6.2     0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
	137.111.20.128  0.0.0.0         255.255.255.128 U     0      0        0 eth0
	127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
	224.0.0.0       0.0.0.0         240.0.0.0       U     0      0        0 eth0
	0.0.0.0         137.111.20.129  0.0.0.0         UG    1      0        0 eth0

    5. have a test:

	[terrence@igloo slirp]$ ssh -n bucket xlogo &

Google