[Simh] How to set up network bridge for SIMH on Solaris host?

lists at openmailbox.org lists at openmailbox.org
Sun Jan 3 08:19:40 EST 2016


On Sun, 3 Jan 2016 04:49:58 -0800
Mark Pizzolato <Mark at infocomm.com> wrote:

> On Sunday, January 3, 2016 at 4:40 AM, lists at openmailbox.org wrote:
> > On Sun, 3 Jan 2016 04:24:23 -0800 Mark Pizzolato <Mark at infocomm.com>
> > wrote:
> > 
> > > On Sunday, January 3, 2016 at 1:46 AM, lists at openmailbox.org
> > 	wrote:
> > > > Can anyone please explain how to set up a network bridge on a
> > > > Solaris host for SIMH? I have searched the net and can't find any
> > > > examples of people running SIMH on Solaris. Thank you.
> > >
> > > I haven't tried building on Solaris for quite a while, but things
> > > should still work.
> > 
> > I don't think that it doesn't work. I just don't have much idea what I'm
> > doing.
> > 
> > > Can you explain what you are trying to achieve with your 'network
> > > bridge'?
> > 
> > I may not even be using the correct terms. I want the VMS OS instance
> > running on SIMH to be able to use the network of the Solaris host. If I
> > run it as root it works fine. If I run it as a user it doesn't.
> > 
> > I found magic recipes for Linux and OpenBSD hosts running SIMH and they
> > work fine. I don't know how to get it to work on a Solaris host.
> > 
> > > Can you describe the network topology you're working with and which
> > > devices on the network you'd like your simh instance to communicate
> > with?
> > 
> > I would like it to be able to use the host network as transparently as
> > possible without running as root. It should be able to serve telnet and
> > ftp (no competing instances running on the host) and apps running under
> > VMS should be able to reach the internet via ftp, etc.
> 

sim> show version
VAX simulator V3.9-0 [64b data, 64b addresses, Ethernet support]

> Have you tried:
> 	sim> ATTACH XQ NAT:
Eth: pcap_open_live_error - nat:: No such device exists (/dev/nat: missing
unit number)

> You should look at "HELP XQ ATTACH"
Too many arguments

sim> help attach
at{tach} <unit> <file> attach file to simulated unit


> You can setup incoming port mappings which will route host ports to
> simulated ports so FTP and TELNET can work as well.  If you want to use
> standard TELNET and FTP ports you will have to run as root to bind those
> network ports.

That is not how I have been using it so far.

In Linux and OpenBSD the bridge scripts set up a "bridge" whatever that
means. After that the SIMH instance runs as an unprivileged user but has
access to the host network as if the SIMH guest OS had its own network. Here
are the two scripts I found that work for me.

This is the one I use on OpenBSD. It allows the SIMH OS instance to get a
DHCP lease and use the host network transparently. The bridge is set up as
root and then the unprivileged SIMH instance can use it.

#!/bin/ksh
ifconfig tun0 create
ifconfig tun0 link0
ifconfig tun0 up
ifconfig bridge0 create
ifconfig bridge0 add re0 add tun0
ifconfig bridge0 up

For Linux I found this script:

#!/bin/bash
# Based on script at: # https://github.com/simh/simh/blob/v3.9-0/0readme_ethernet.txt
# Changes by <toby at telegraphics.com.au>
# Tested on Gentoo

set -e

# If you want the tunnel interface owned by an unprivileged user, give the user name as 1st argument
USER=${1:+-u $1}
# Interface (if not eth0) is 2nd argument
INTERFACE=${2:-eth0}

BRIDGENAME=simh

ifconfig $INTERFACE | grep inet | (
  read SKIP HOSTIP SKIP HOSTNETMASK SKIP HOSTBCASTADDR
  HOSTDEFAULTGATEWAY=`route | grep ^default | awk '{print $2}'`
  echo "Host IP: $HOSTIP Netmask: $HOSTNETMASK Broadcast: $HOSTBCASTADDR"
  echo "Default gateway: $HOSTDEFAULTGATEWAY"

  tunctl -t tap0 $USER
  ifconfig tap0 up
 
  # Now convert eth0 to a bridge and bridge it with the TAP interface
  brctl addbr $BRIDGENAME
  brctl addif $BRIDGENAME $INTERFACE
  brctl setfd $BRIDGENAME 0
  ifconfig $INTERFACE 0.0.0.0
  ifconfig $BRIDGENAME $HOSTIP netmask $HOSTNETMASK broadcast $HOSTBCASTADDR up
  # set the default route to the br0 interface
  route add -net 0.0.0.0/0 gw $HOSTDEFAULTGATEWAY
  # bridge in the tap device
  brctl addif $BRIDGENAME tap0
  ifconfig tap0 0.0.0.0

  echo "Bridge is now configured (ip:$HOSTIP) between $INTERFACE and tap0."
  echo "To inspect, run   brctl show"
)

# Run simulator and "attach xq tap:tap0"


Same thing here. I run the script as root and then SIMH as a user.

Can the same thing be done on a Solaris host?

Thanks.







-- 
Please DO NOT COPY ME on mailing list replies. I read the mailing list.
RSA 4096 fingerprint 7940 3F02 16D3 AFEE F2F8  ACAA 557C 4B36 98E4 4D49


More information about the Simh mailing list