3

For study purpose i want to set a slip-serial tcp connection between a new linux machine and old xenix machine wich run on VirtualBox. I've setup xenix Virtual Machine with two serial ports: one on /dev/ttyS0(host pipe) and the other on /tmp/xenixserial(file pipe),the second port tested with minicom is ok. On linux i did

echo 1 > /proc/sys/net/ipv4/ip_forward
slattach -s 9600  -d -p slip  /dev/ttyS0
ifconfig sl0 192.168.7.1 dstaddr 192.168.7.2 netmask 255.255.255.252 mtu 576 up
iptables -t nat -A POSTROUTING -s 192.168.7.0/24 -j MASQUERADE

On xenix i did

mkdev slip: only ask for relink kernel,of course answered yes
mkdev tcp:  and set 192.168.7.2 as local 192.168.7.1 as remote and tty1a 9600 for serial

On reboot i can see all works

sl0: flags=51<UP,POINTOPOINT,RUNNING>                                                                                   
    inet 192.168.7.2 --> 192.168.7.1 netmask ffffff00  

But no ping,neither from host to guest,no from guest to host. I also tried to add route

    route add default 192.168.7.1 1

but nothing. Suggestion?Thanks

  • Try first without the iptables rule. It might be interfering by trying to NAT the pings between the 2 hosts. Once you have local communication working between the hosts, then start introducing things like NAT as desired. By the way, one thing I notice is that the netmask is wrong: it shows ffffff00 but it should be fffffffc which is equal to 255.255.255.252 which is the same as /30 which is what you specified earlier. But typically it would work anyway despite that. – Celada Feb 27 '15 at 1:48
  • I wrote wrong netmask,sorry of course i have used same netmask 24 for all,but nothing to do – elbarna Feb 27 '15 at 15:13
0

Solution found,TTYS0 is a driver/module wich point to an existing physical serial(enable on my motherboard). To use a setup like this,must use the pty driver(pts/0,1,2,etc) but is not supported by virtualbox,qemu support it,if intersted here is the procedure.

On Qemu host

#run qemu,256m ram disk not over 512M,pc-bios important otherwise give error
#control wich pts is running qemu,you will must use later
qemu-system-i386  -serial pty -hda Xenix.disk -boot c -fda floppy.img -no-fd-bootchk -m 256  -L pc-bios

#ip_forward
echo 1 1>/proc/sys/net/ipv4/ip_forward
#slattach
slattach -s 19200 -d -p slip /dev/pts/4 #pts/4 is used by qemu

#192.168.7.1 is on host,192.168.7.2 is guest
ifconfig sl0 192.168.7.1 dstaddr 192.168.7.2 netmask 255.255.255.252 mtu 576 up 
#enable routing iptables
iptables -t nat -A POSTROUTING -s 192.168.7.0/30 -j MASQUERADE 

On Xenix

mkdev slip #answer yes to all
reboot
mkdev tcp   #set 19200 serial speed and 192.168.7.2 ip,and correct netmask

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.