cancel
Showing results for 
Search instead for 
Did you mean: 

smbclient to CIFS gives 'BAD_NETWORK_NAME'

scottcarson
Champ in-the-making
Champ in-the-making
Hi everyone,

This just came out of nowhere. I've spent days on it and am drawing blanks so I humbly request your assistance.

Alfresco Community 3.4d
Kubuntu Linux

IP Tables are like so:

echo 1 > /proc/sys/net/ipv4/ip_forward
modprobe iptable_nat
iptables -F
iptables -t nat -F
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT

iptables -t nat -A PREROUTING -p tcp -d 192.168.3.8 –dport 445 -j REDIRECT –to-ports 1445
iptables -t nat -A PREROUTING -p tcp -d 192.168.3.8 –dport 139 -j REDIRECT –to-ports 1139
iptables -t nat -A PREROUTING -p udp -d 192.168.3.8 –dport 137 -j REDIRECT –to-ports 1137
iptables -t nat -A PREROUTING -p udp -d 192.168.3.8 –dport 138 -j REDIRECT –to-ports 1138

iptables -t nat -A OUTPUT -p tcp -d 192.168.3.8 –dport 445 -j REDIRECT –to-ports 1445
iptables -t nat -A OUTPUT -p tcp -d 192.168.3.8 –dport 139 -j REDIRECT –to-ports 1139
iptables -t nat -A OUTPUT -p udp -d 192.168.3.8 –dport 138 -j REDIRECT –to-ports 1138
iptables -t nat -A OUTPUT -p udp -d 192.168.3.8 –dport 137 -j REDIRECT –to-ports 1137


When I run
smbclient \\\\192.168.2.69\\alfresco -U admin -p 1139

… it works! Meaning Linux connects just fine. But when I do a Win test like this:
smbclient \\\\192.168.2.69\\alfresco -U admin
or
smbclient \\\\192.168.2.69\\alfresco -U admin -p 139

I get:
tree connect failed: NT_STATUS_BAD_NETWORK_NAME

So I can connect but then get kicked out.
This happens when Samba is running. I have cleared /tmp. I have tried it with Samba turned off (which results in CONNECTION_REFUSED.

The only blip is that I changed my server's name from 'CYCLONE' to 'cyclone', but I made the necessary changes throughout the system so that every name/hosts reference does return 'cyclone'

It seems like iptables, but I don't know what else I can do!

Please help! Thanks,
-Scott.
6 REPLIES 6

scottcarson
Champ in-the-making
Champ in-the-making
One more thing! I followed the steps here: http://andoylang.wordpress.com/2010/07/20/alfresco-with-cifs/ adding the STATE rules in iptables:
iptables -A INPUT -p udp -m state –-state NEW –-dport 137 -j ACCEPT
iptables -A INPUT -p udp -m state -–state NEW –-dport 138 -j ACCEPT
iptables -A INPUT -p tcp -m state –-state NEW –-dport 139 -j ACCEPT
iptables -A INPUT -p tcp -m state –-state NEW –-dport 445 -j ACCEPT
Also, no luck - same old BAD_NETWORK_NAME error …

scottcarson
Champ in-the-making
Champ in-the-making
Update!
I ran one huge batch of iptables commands, then committed them, then restarted networking. Now, I'm getting NT_STATUS_CONNECTION_REFUSED. Here's the full listing:

echo 1 > /proc/sys/net/ipv4/ip_forward
modprobe iptable_nat
iptables -F
iptables -t nat -F
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT

iptables -t nat -A PREROUTING -p tcp -d 192.168.2.69 –dport 445 -j REDIRECT –to-ports 1445
iptables -t nat -A PREROUTING -p tcp -d 192.168.2.69 –dport 139 -j REDIRECT –to-ports 1139
iptables -t nat -A PREROUTING -p udp -d 192.168.2.69 –dport 137 -j REDIRECT –to-ports 1137
iptables -t nat -A PREROUTING -p udp -d 192.168.2.69 –dport 138 -j REDIRECT –to-ports 1138

iptables -t nat -A OUTPUT -p tcp -d 192.168.2.69 –dport 445 -j REDIRECT –to-ports 1445
iptables -t nat -A OUTPUT -p tcp -d 192.168.2.69 –dport 139 -j REDIRECT –to-ports 1139
iptables -t nat -A OUTPUT -p udp -d 192.168.2.69 –dport 138 -j REDIRECT –to-ports 1138
iptables -t nat -A OUTPUT -p udp -d 192.168.2.69 –dport 137 -j REDIRECT –to-ports 1137

iptables -A INPUT -p udp -m state –state NEW –dport 137 -j ACCEPT
iptables -A INPUT -p udp -m state –state NEW –dport 138 -j ACCEPT
iptables -A INPUT -p tcp -m state –state NEW –dport 139 -j ACCEPT
iptables -A INPUT -p tcp -m state –state NEW –dport 445 -j ACCEPT

iptables-save > /etc/iptables.rules
/etc/init.d/networking restart

smbclient -U admin \\\\192.168.2.69\\alfresco -p 139
Error connecting to 192.168.2.69 (Connection refused)
Connection to 192.168.2.69 failed (Error NT_STATUS_CONNECTION_REFUSED)

smbclient -U admin \\\\192.168.2.69\\alfresco -p 1139
Password:
Domain=[CYCLONE] OS=[Java] Server=[Alfresco CIFS Server 5.1.0]
smb: \>

smbclient -U admin \\\\192.168.2.69\\alfresco
Error connecting to 192.168.2.69 (Connection refused)
Connection to 192.168.2.69 failed (Error NT_STATUS_CONNECTION_REFUSED)

So now it's definitely a port thing …… right???

scottcarson
Champ in-the-making
Champ in-the-making
Yet another update…
smbclient -U admin \\\\192.168.2.69\\alfresco
Error connecting to 192.168.2.69 (Connection refused)
Connection to 192.168.2.69 failed (Error NT_STATUS_CONNECTION_REFUSED)
smbclient -U admin \\\\127.0.0.1\\alfresco
Password:
Domain=[CYCLONE] OS=[Unix] Server=[Samba 3.0.28a]
tree connect failed: NT_STATUS_BAD_NETWORK_NAME
smbclient -U admin \\\\cyclone\\alfresco
Password:
Domain=[CYCLONE] OS=[Unix] Server=[Samba 3.0.28a]
tree connect failed: NT_STATUS_BAD_NETWORK_NAME
Now it looks like it's a difference of name?

Maybe we're getting there!?

scottcarson
Champ in-the-making
Champ in-the-making
Now on version 4.2.e I'm STILL getting this error! The best I can find on Google is "some permission error on some directory" but I've re-installed the software and haven't performed any chmod commands.
Surely somebody can help???

SOLVED.
The problem was iptables.
Peter (genius) kept it simple in this post:
http://forums.alfresco.com/forum/installation-upgrades-configuration-integration/installation-upgrad...


modprobe iptable_nat
iptables -F
iptables -t nat -F
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -t nat -A PREROUTING -p tcp –dport 445 -j DNAT –to-destination :1445
iptables -t nat -A PREROUTING -p tcp –dport 139 -j DNAT –to-destination :1139
iptables -t nat -A PREROUTING -p tcp –dport 137:139 -j DNAT –to-destination :1137-1139
iptables -t nat -A PREROUTING -p udp –dport 137:139 -j DNAT –to-destination :1137-1139

In alfresco-global.properties, be sure to either comment authentication.chain (to accept default) or set it to something other than Ntlm:
# authentication.chain=alfrescoNtlm1:alfrescoNtlm
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.