Samba over ssh tunnels again broken

Today, I can no longer access the samba through ssh mount. The putty log shows the following error messages:

2009-10-19 17:45:08 Local port 10.0.0.1:139 forwarding to lehre4:139 failed: Network error: Cannot assign requested address
2009-10-19 17:45:08 Local port 10.0.0.1:445 forwarding to lehre4:139 failed: Network error: Cannot assign requested address

Grmpf. Which address? 10.0.0.1 or lehre4:139? what does “assign” mean? – Again an error message which gives no sense. I find nothing useful with google. I do NOT want to look into the source code of putty!

I try reboot, change lehre4 to lehre4.rad.univie.ac.at, etc. Situation unchanged.

I have installed a aon wireless connection on my contryside house recently. This crappy connection needs a special software, it cannot connect with the windows wireless setup. Maybe this corrupts the setup?

Even if the putty is not running,
“c:\Program Files”\nc.exe -l -s 10.0.0.1 -p 445
yields
Can’t grab 10.0.0.1:445 with bind

I should work now, not play around…
I check my loopback adapter. ipconfig /all reveals that it has a strange ip-adress now? DPHC is activated! Refering to http://www.blisstonia.com/eolson/notes/smboverssh.php (what I used for setting it up) it’s ip should be 10.0.0.1 – somehow this has changed? I set the addresses to:
Ethernet-Adapter LAN-Verbindung 4:

Verbindungsspezifisches DNS-Suffix:
Beschreibung. . . . . . . . . . . : Microsoft Loopbackadapter
Physikalische Adresse . . . . . . : 02-00-4C-4F-4F-50
DHCP aktiviert. . . . . . . . . . : Nein
Autokonfiguration aktiviert . . . : Ja
IPv4-Adresse . . . . . . . . . . : 10.0.0.1(Bevorzugt)
Subnetzmaske . . . . . . . . . . : 255.255.255.0
Standardgateway . . . . . . . . . :10.0.0.0
DNS-Server . . . . . . . . . . . : 131.130.1.11
131.130.1.12
NetBIOS über TCP/IP . . . . . . . : Deaktiviert

Putty now yields:
2009-10-19 19:00:38 Local port 10.0.0.1:139 forwarding to lehre4:139
2009-10-19 19:00:38 Local port 10.0.0.1:445 forwarding to lehre4:139 failed: Network error: Permission denied

This looks good…
reboot.

Worked!

However, I suspect that there is still a problem: I think the aon stuff needs the loopback-adapter with 10.0.0.1 set to DHPC. Actually, it was no good idea from me to use 10.0.0.1 for my loopback-adapter: the first local ip adress, the chances that some program would collide were for sure high.

I decide to rebuild the stuff for my a new loopback-adapter 10.0.0.137.

I cite from http://www.blisstonia.com/eolson/notes/smboverssh.php with the adress substituted:

1. System->Control Panel->Add Hardware
2. Yes, Hardware is already connected
3. Add a new hardware device (at bottom of list)
4. Install the hardware that I manually select
5. Network adapters
6. Microsoft , Microsoft Loopback Adapter
7. (Go through the installation procedure.)

Now we configure the new localhost adapter.

1. Open up your existing (real) ethernet adapter and write down your gateway and DNS server addresses.
2. Open your new fake ethernet adapter (Network Connections) , enter a made-up IP address (I suggest 10.0.0.1, which is a privately routable address that most folk don’t use.)
3. Enable Client for Microsoft Networks.
4. Disable File and Printer Sharing for Microsoft Networks
5. Enable Interent Protocol (TCP/IP)
6. Click on properties for TCP/IP.
7. Enter your chosen IP address (10.0.0.137), subnet mask (255.255.255.0), and gateway (Peter Steier: I guess 10.0.0.0) and DNS information you got from your real adapter.
8. Under advanced->WINS, Enable LMHosts Lookup and Disable NetBIOS over TCP/IP
9. Enter 9999 for the interface metric. (Necessary?)

At this point I had to reboot; it didn’t tell me to, but it wasn’t working.

Actually, I do not reboot, just disable/enable.

ipconfig /all
yields:
Ethernet-Adapter LAN-Verbindung 5:

Verbindungsspezifisches DNS-Suffix:
Beschreibung. . . . . . . . . . . : Microsoft Loopbackadapter #2
Physikalische Adresse . . . . . . : 02-00-4C-4F-4F-50
DHCP aktiviert. . . . . . . . . . : Nein
Autokonfiguration aktiviert . . . : Ja
IPv4-Adresse . . . . . . . . . . : 10.0.0.137(Bevorzugt)
Subnetzmaske . . . . . . . . . . : 255.255.255.0
Standardgateway . . . . . . . . . :10.0.0.0
DNS-Server . . . . . . . . . . . : 131.130.1.11
131.131.1.12
NetBIOS über TCP/IP . . . . . . . : Deaktiviert

Putty:
forward 10.0.0.137:139 -> lehre4:139
foward 10.0.0.137:445 -> lehre4:139

(lehre4 is our samba server; it serves only port 139)

I disconnect my Y: network drive and map it new to \\10.0.0.137\data
-> I get a connection! However, it probably woould not work after the next reboot, since vista would grab 10.0.0.137:445 then… change my boot script!

It looks now like:
REM batch file to start the smb service without port 445
REM Peter Steier 2009-02-28
start “bind_port_445” “C:\Program Files\nc.exe” -l -s 10.0.0.137 -p 445 2>C:\temp\bin_port_445.log
net start smb
ping 127.0.0.1 -n 2 -w 1000 > nul
taskkill /fi “Windowtitle eq bind_port_445”
(remember, port 139 wasn’t the problem. So I could go back to the first version only blocking 445 from vista grabbing)

I set loopback-adoptor 10.0.0.1 to DPHC again, to avoid problems with aon wireless.

reboot…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: