First post, by mike_canada
Hello,
After reading guides, I am able to access internet through DOSBOX but I want to also run a webserver designed in Qbasic with it but that part will not work. For the rest of this post, I'll call the qbasic web server the DBWS (for DosBox Web server).
I got the web server software from here: http://rubbermallet.org/software/webserv.html
I have configured DOSBOX startup script in the dosbox config file as follows under the autoexec section:
mount C /path/to/dos/drive
C:
ethersl -p 0x60 3 0x2F8 115200
set MTCPCFG=\dosbox.cfg
ping google.ca
Under the serial section I have:
serial2=nullmodem server:127.0.0.1 port:8001 transparent:1
\dosbox.cfg is necessary so the mTCP suite knows what internet info to use for its applications. \dosbox.cfg contains:
TIMESTAMP unknown 2
packetint 0x60
ftpsrv_password_file NUL
ftpsrv_log_file NUL
IPADDR 192.168.7.2
NETMASK 255.255.255.252
GATEWAY 192.168.7.1
NAMESERVER 8.8.8.8
LEASE_TIME 6000
This is the script I execute to make everything in action:
#!/bin/bash
killall socat > /dev/null
killall slattach > /dev/null
echo 1 > /proc/sys/net/ipv4/ip_forward
echo DOSBOX with networking
echo Uses ETHERSL dos driver + socat
socat -4 PTY,link="/tmp/dbnet",raw,echo=0 TCP4-LISTEN:"8001" &
sleep 1
slattach -d -s 115200 -p adaptive "/tmp/dbnet" &
sleep 1
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/30 -j MASQUERADE
sleep 1
dosbox
I am able to ping from google.ca inside DOSBOX no problem, but the problem happens when I run the DBWS.
The DBWS when launched indicates that it is ready.
I launch seamonkey on the host machine and try to access DBWS. I get a response "The document contains no data. The network link was interrupted while negotiating a connection. Please try again.".
If instead of seamonkey, I run a linux console and used wget on the same ip, I get "--2020-12-26 (try: X) http://192.168.7.2/
Connecting to 192.168.7.2:80... connected.
HTTP request sent, awaiting response... Read error (Connection reset by peer) in headers.
Retrying."
where X is the attempt number. and the console will continue to spit that message out.
Now when I stop the DBWS, then on the local machine, seamonkey and wget report different results. Seamonkey reports:
"Failed to Connect
The connection was refused when attempting to contact 192.168.7.2.
Though the site seems valid, the browser was unable to establish a connection.
Could the site be temporarily unavailable? Try again later.
Are you unable to browse other sites? Check the computer's network connection.
Is your computer or network protected by a firewall or proxy? Incorrect settings can interfere with Web browsing."
and wget reports:
" (try: 4) http://192.168.7.2/
Connecting to 192.168.7.2:80... failed: Connection refused."
If I replaced the DOSBOX environment with a PC running the same environment, the whole thing works. The only difference is, I'll need 2 active PC's and the initial network packet driver isn't ethersl because I'm connecting that PC to the router via an RJ45 cable, but the steps after loading the packet driver are exactly the same.
I wonder if there is something I can do on the linux side of things to make things work. Do I need to do another thing with iptables or something?