VOICE Home Page: http://www.os2voice.org |
November 2002
[Newsletter Index]
|
By Michael W. Cocke © November 2002 |
Section 1 covers getting Netbios over TCP/IP (TCPBEUI) configured on OS/2.
Section 2 covers getting Samba configured on Linux.
Note: A reasonable understanding of OS/2 and Linux is assumed.
Please note: When I wrote this, the procedure detailed did work - for up to 12 hours. There appears to be some sort of problem with Samba (I tried version 2.2.5-pre1, Your mileage may vary) The link from OS/2 to Linux works indefinitely. From Linux to OS/2 dies sometime overnight. If you shutdown and restart Linux, it will work fine again - until the next day.
I ultimately switched my network to NFS, which works fine (and considerably faster than Samba). I'll cover that in a future article.
First, you'll need to configure OS/2 to use the protocol "Netbios over TCP/IP", which is usually referred to in the OS/2 documentation as TCPBEUI. Go to the "System setup" folder, open the "Install/remove" folder, select "OS/2 Lan services installation/configuration" and select "Tailored ", then select "Configure this workstation".
Note: The reason that we do it this way instead of using MPTS is that I'm assuming that you have a pre-existing LAN using Netbios. There is (and has been since Warp 4.0 first shipped) a bug in MPTS wherein if you have a pre-existing Netbios LAN and you try to add Netbios over TCP/IP, or add another NIC, or try practically any other action, your IBMLAN.INI file will be generated complete with errors. We do it this way so you don't have to try to figure out what went wrong later. For more information on the problems caused by this bug and how to correct them manually, see "Mike's Notebook - unusual networking problems (and solutions) in OS/2 and eCS".
After a few more questions (the answers will vary depending on your system, so I'll skip them here), you should see something like (yours will be different) this;
In the image above, note a few things; My system is configured to use TCP/IP (for the internet and because Netbios over TCP/IP requires it), Netbios (because I have a fairly large and complex network and use both Netbios and Netbios over TCP/IP to communicate with different computers), and Netbios over TCP/IP to communicate with my Linux system.
Do you need Netbios? It depends. If you have several OS/2 computers using "Warp Peer", you can use either Netbios or Netbios over TCP/IP to communicate between them. I prefer Netbios for this purpose because it's simple to configure. If you have OS/2 and Windows computers communicating, the same answer applies. (Despite persistent rumors that you need to use Netbios over TCP/IP for this purpose, Netbios works just fine, if it's available for your version of Windows).
If you have a very large LAN (physically) you probably need Netbios over TCP/IP because simple Netbios isn't routable (it doesn't pass thru routers), while Netbios over TCP/IP is (and does).
And in order to communicate from OS/2 to Linux, you need Netbios over TCP/IP. I happen to use both, using Netbios with some computers and Netbios over TCP/IP (TCPBEUI) with others. If you configure OS/2 properly, which protocol is connecting to what system is transparent.
Add the appropriate protocols for your needs as usual (I did say that I'm assuming that you either have a pre-existing network or have at least installed OS/2 before, so you've been thru this.) After you've done that, double click on the "Netbios over TCP/IP protocol"
You can accept the defaults on "Driver parameters", but the other two choices are mandatory. Click on "names list" then "Configure".
Here's where we start counting on the fact that you're already familiar with networks and OS/2.
The "Netbios name prefix" is simply the Netbios machine name. If you've already configured Samba on Linux, this will be the hostname. If you've already configured Netbios on OS/2, again, this is the hostname. If you've already configured your local hosts file, this is the machine name prefix of the hostname. See the idea? And the IP address is exactly that. Now, here's an important point. You cannot just enter the name of the Linux system(s) here and have it work - you must also enter the information for the machine that you're configuring, and you cannot just use localhost. In the example above, opus is the Linux system and mwc is the local system. I won't pretend I understand why (although I can make a guess), but if you omit the local system info, this won't work.
After you enter and save this information, click on "broadcast list" then "configure".
Enter the IP addresses of the machines that you'll need to communicate with over Netbios over TCP/IP, including the IP address of the local machine that you're configuring. Ok, save your changes and hit "OK". Next, you'll see this screen;
Select "Configure a component" and click "OK". Select "Lan Services adapters" and click "Configure".
Now here's another bit of information that it took me a while to figure out; The adapter numbers mentioned above are NOT physical adapters - they're the logical adapter numbers assigned way back in
Honestly, you'd think I'd be used to the way IBM bounces back and forth between talking about physical adapters vs. logicals without ever actually mentioning which they're talking about, but I missed this one for a long time...
If you have Netbios and Netbios over TCP/IP both configured, make sure that both of the appropriate adapters are selected for OS/2 peer. If you only have Netbios over TCP/IP, it will be the only adapter listed.
On the following "Netbios resource" screens, accept the defaults. If you've got to muck with those, you can do it later.
And here we are back at
Due to an irritating bug, you'll have to go thru configuring the FFST every time you do this. Go ahead, I'll wait. When your finished, you'll be back to
Don't forget to "apply the changes"! Now you can go ahead and exit everything. You'll need to reboot for this to take effect - I'll wait. Please note: you aren't finished yet, so don't try this and be surprised when it doesn't work.
And we're back.
Now we need to set up a few things in your TCP/IP configuration. See why I said Netbios is simpler to configure? I'm assuming that you already have TCP/IP configured for access to the internet, so I'll only mention the bits that you'll need for Netbios over TCP/IP use.
Open up "TCP/IP configuration(local)" which should be located in the "TCP/IP" folder of the "System Setup" folder. When the notebook opens, click the "Host Names" tab (on the top), then click the "Hosts" tab (on the bottom).
Make sure that appropriate entries are here for all of the systems entered way back in the names list.
Most important: Make certain that "look through hosts before going to name server" (on the bottom) is checked!
Save your changes and exit. You'll have to reboot unless the "look through hosts before going to name server" was already set.
Ok. If you're configuring tcpbeui on multiple OS/2 computers, repeat this procedure on all of them. When you're finished, you should have a basic Netbios over TCP/IP LAN to use warp peer on.
Let me mention a few assorted tips here:
If you have more than approximately nine shares on one system, you'll need to twiddle with ibmlan.ini a bit. The entries that will need adjustment are maxshares and maxconnections, both in the [peer] section.
If you have a broadband connection to the internet (or even if you don't), YOU
NEED TO CHECK YOUR FIREWALL. Make CERTAIN that ports137-139 are blocked!
Those ports can 'bleed' your internal lan onto the internet. This is a bad thing.
(that last was an example of a massive understatement).
Troubleshooting: First, make certain that
If you have a problem, start with "net view". Can you see all of the Netbios over TCP/IP systems on your LAN? If not, try pinging the appropriate IP address for whatever system(s) that you cannot see. If ping fails, the problem is in the TCP/IP configuration somewhere. If ping works but net view fails AND the svrhidden=no setting is correct, it's in the Netbios over TCP/IP or peer configuration.
If "
You should now have Netbios over TCP/IP configured on your OS/2 system(s).
There are MANY advanced features in Samba. We won't be discussing them.
I'm not going to get into printer sharing at this point, since lpr works just fine. I'm also skipping all of the advanced security stuff, since most of you aren't using a PDC (Primary Domain Controller). If you're using one of those, you probably don't need this how-to, you're a networking professional.
This will cover 'share level' security, like Windows and OS/2 Warp use. Each shared device is assigned a password. In order to access it, you need the password. Fairly simple, I think.
Reminder - we're talking about Linux in this section, so case may be important.
First, you need to configure Samba. In
#This is the main Samba configuration file. You should read the
#smb.conf(5) manual page in order to understand the options listed
#here. Samba has a huge number of configurable options (perhaps too
#many!) most of which are not shown in this example
#
#Any line which starts with a ; (semi-colon) or a #(hash)
#is a comment and is ignored. In this example we will use a #
#for commentary and a ; for parts of the config file that you
#may wish to enable
#
#NOTE: Whenever you modify this file you should run the command "testparm"
#to check that you have not made any basic syntactic errors.
#
#======================= Global Settings =====================================
[global]
#1. Server Naming Options:
#workgroup = NT-Domain-Name or Workgroup-Name
workgroup = IBMPEERS (Assuming you took the default when you installed OS/2)
#netbios name is the name you will see in "Network Neighbourhood",
#but defaults to your hostname
#Be careful with this, the NET USE command seems to be case sensitive
netbios name = opus
#server string is the equivalent of the NT Description field
server string = opus
#3. Logging Options:
#this tells Samba to use a separate log file for each machine
#that connects
log file = /var/log/samba/log.%m
#Put a capping on the size of the log files (in Kb).
max log size = 50
#Set the log (verbosity) level (0 <= log level <= 10)
log level = 0 (I keep logging disabled for housekeeping reasons - I advise setting this between 2 and 4 for now)
#4. Security Options:
#This option is important for security. It allows you to restrict
#connections to machines which are on your local network. The
#following example restricts access to two C class networks and
#the "loopback" interface. For more examples of the syntax see
#the smb.conf man page. Do not enable this if (tcp/ip) name resolution does
#not work for all the hosts in your network.
#My local network is on the class C subnet 192.168.1.
#You MUST also list the localhost (127.0.0.1) for this to work.
hosts allow = 192.168.1. 127.
security = share
#Password Level allows matching of _n_ characters of the password for
#all combinations of upper and lower case.
; password level = 8
; username level = 8
This will vary depending on how sloppy your users are with remembering that Linux is case sensitive. Set it to 8 if they're impossible.
And here's where we define the share. This is set up wide-open. If you want to allow access to only a part of the Linux filesystem, adjust the 'path' statement below. If you want to allow multiple shares, you can do that too. Copy the whole section and change the name from public to something else, and changing the path as appropriate.
#You may wish to use password encryption. Please read
#ENCRYPTION.txt, Win95.txt and WinNT.txt in the Samba documentation.
#Do not enable this option unless you have read those documents
#Encrypted passwords are required for any use of samba in a Windows NT domain
#The smbpasswd file is only required by a server doing authentication, thus
#members of a domain do not need one.
; encrypt passwords = yes
smb passwd file = /etc/samba/smbpasswd
#5. Browser Control and Networking Options:
#Most people will find that this option gives better performance.
#See speed.txt and the manual pages for details
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
#Preferred Master causes Samba to force a local browser election on startup
#and gives it a slightly higher chance of winning the election
preferred master = no
#Windows Internet Name Serving Support Section:
#WINS Support - Tells the NMBD component of Samba to enable it's WINS Server
wins support = no
#============================ Share Definitions ==============================
hosts allow = 192.168.1. 127. (only allow hosts from the local LAN access)
unix password sync = no
map to guest = never
password level = 0
null passwords = no
allow hosts = 192.168.1. (only allow hosts from the local LAN access. Don't ask why you need to specify it twice in two different ways)
os level = 0
preferred master = no
domain master = no
wins support = no
dead time = 0
debug level = 0
keep alive = 60
protocol = LANMAN2 (important if you want long filename support and the default is wrong!)
short preserve case = yes
And that was the worst of it. You'll also need to do the configuration for your Linux tcp/ip, making certain to set up the local host resolution (/etc/hosts) file for correct name resolution - just like you did in OS/2 tcp/ip configuration notebook only without the notebook GUI. See 'man hosts'.
[public]
comment = Opus root with read-write access
path = /
guest ok = no
writeable = yes
short preserve case = yes
For automatic mounting of the OS/2 shares when you start Linux, put a line like this in /etc/fstab, one line per share;
where mwc_dt is the name of the system.
mwc-c is the name of the share.
/mnt/mwcdt/c is the mountpoint where the share is to be mounted.
smbfs is the type of filesystem
_netdev means don't mount this until the network is available.
username and password should be a username and password with the correct access rights to the share.
fmask and dmask are the file and directory permissions to assign to files and directories on the share. This is because OS/2 doesn't have a permission system such as that of Linux, so we have to fake one.
Several people in both comp.os.os2.misc and alt.os.Linux.mandrake helped me out
with some of this information. Thanks especially to Richard Steiner and Dave Hough.
References:
|
Mike's Notebook - http://www.catherders.com/mwcexp.shtml web site contains an assortment of frequently updated articles and tips for OS/2 users.
[Feature Index]
editor@os2voice.org
[Previous Page] [Newsletter Index] [Next Page]
VOICE Home Page: http://www.os2voice.org