PDA

View Full Version : Wrong IP?


mugs
2004-09-23, 04:52 PM CDT
I dont use my network tnat often, but when I do it has worked fine. This morning, a different computer, not my main one, got turned on first...and it got an IP of 192.168.0.2 which is what my main one always gets. Now, it is showing 192.168.0.3 when I do ifconfig. In SMB4K, I can see the computer and another one on the network. I can see the shares on the other one, but I cannot mount any of them, it keeps asking me for user and password, but doesnt accept it. For itself, I cant even see the shares. It is showing an IP of 192.168.0.2 in the main window. If I set that IP to be the master, it cant find the network at all, saying it canf find the route to the host. I have tinkered with the settings in SMB4K, and a little bit in smb.conf. This is frustrating. What do I need to do to fix this? How can I get this computer to be 192.168.0.2??

Here is my smb.conf

# 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 commentry 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]

# workgroup = NT-Domain-Name or Workgroup-Name
workgroup = HOME
netbios name = LINUX

# server string is the equivalent of the NT Description field
server string = Samba Server

# 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
hosts allow = 192.168.1. 192.168.2. 192.168.0.3 192.168.0.4 192.168.0.5 192.168.0.6 127.

# if you want to automatically load your printer list rather
# than setting them up individually then you'll need this
printcap name = /etc/printcap

# It should not be necessary to spell out the print system type unless
# yours is non-standard. Currently supported print systems include:
# bsd, sysv, plp, lprng, aix, hpux, qnx
; printing = bsd

# Uncomment this if you want a guest account, you must add this to /etc/passwd
# otherwise the user "nobody" is used
; guest account = pcguest

# this tells Samba to use a separate log file for each machine
# that connects
log file = /var/log/samba/%m.log
# all log information in one file
# log file = /var/log/samba/smbd.log

# Put a capping on the size of the log files (in Kb).
max log size = 50

# Security mode. Most people will want user level security. See
# security_level.txt for details.
security = share
# Use password server option only with security = server
; password server = <NT-Server-Name>

# Password Level allows matching of _n_ characters of the password for
# all combinations of upper and lower case.
; password level = 8
; username level = 8

# 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
encrypt passwords = yes

# The following are needed to allow password changing from Windows to
# update the Linux system password also.
# NOTE: Use these with 'encrypt passwords' and 'smb passwd file' above.
# NOTE2: You do NOT need these to allow workstations to change only
# the encrypted SMB passwords. They allow the Unix password
# to be kept in sync with the SMB password.
; unix password sync = Yes
; passwd program = /usr/bin/passwd %u
; passwd chat = *New*UNIX*password* %n\n *ReType*new*UNIX*password* %n\n *passwd:*all*authentication*tokens*updated*success fully*

# Unix users can map to different SMB User names
; username map = /etc/samba/smbusers

# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
; include = /etc/samba/smb.conf.%m

# Most people will find that this option gives better performance.
# See speed.txt and the manual pages for details
socket options = TCP_NODELAY SO_SNDBUF=8192 SO_RCVBUF=8192

# Configure Samba to use multiple interfaces
# If you have multiple network interfaces then you must list them
# here. See the man page for details.
; interfaces = 192.168.12.2/24 192.168.13.2/24

# Configure remote browse list synchronisation here
# request announcement to, or browse list sync from:
# a specific host or from / to a whole subnet (see below)
; remote browse sync = 192.168.3.25 192.168.5.255
# Cause this host to announce itself to local subnets here
; remote announce = 192.168.1.255 192.168.2.44

# Browser Control Options:
# set local master to no if you don't want Samba to become a master
# browser on your network. Otherwise the normal election rules apply
local master =no

# OS Level determines the precedence of this server in master browser
# elections. The default value should be reasonable
; os level = 33

# Domain Master specifies Samba to be the Domain Master Browser. This
# allows Samba to collate browse lists between subnets. Don't use this
# if you already have a Windows NT domain controller doing this job
domain master = yes

# 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 = yes

# Enable this if you want Samba to be a domain logon server for
# Windows95 workstations.
; domain logons = yes

# if you enable domain logons then you may want a per-machine or
# per user logon script
# run a specific logon batch file per workstation (machine)
; logon script = %m.bat
# run a specific logon batch file per username
; logon script = %U.bat

# Where to store roving profiles (only for Win95 and WinNT)
# %L substitutes for this servers netbios name, %U is username
# You must uncomment the [Profiles] share below
; logon path = \\%L\Profiles\%U

# All NetBIOS names must be resolved to IP Addresses
# 'Name Resolve Order' allows the named resolution mechanism to be specified
# the default order is "host lmhosts wins bcast". "host" means use the unix
# system gethostbyname() function call that will use either /etc/hosts OR
# DNS or NIS depending on the settings of /etc/host.config, /etc/nsswitch.conf
# and the /etc/resolv.conf file. "host" therefore is system configuration
# dependant. This parameter is most often of use to prevent DNS lookups
# in order to resolve NetBIOS names to IP Addresses. Use with care!
# The example below excludes use of name resolution for machines that are NOT
# on the local network segment
# - OR - are not deliberately to be known via lmhosts or via WINS.
; name resolve order = wins lmhosts bcast

# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable it's WINS Server
wins support = yes

# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
; wins server = w.x.y.z


# WINS Proxy - Tells Samba to answer name resolution queries on
# behalf of a non WINS capable client, for this to work there must be
# at least one WINS Server on the network. The default is NO.
; wins proxy = yes

# DNS Proxy - tells Samba whether or not to try to resolve NetBIOS names
# via DNS nslookups. The built-in default for versions 1.9.17 is yes,
# this has been changed in version 1.9.18 to no.
dns proxy = no
winbind uid = 16777216-33554431
winbind gid = 16777216-33554431
restrict anonymous = no
max protocol = NT
ldap ssl = No
server signing = Auto

[homes]
comment = Home Directories
browseable = no
read only = no

# Un-comment the following and create the netlogon directory for Domain Logons
; [netlogon]
; comment = Network Logon Service
; path = /home/netlogon
; guest ok = yes
; writable = no
; share modes = no


# Un-comment the following to provide a specific roving profile share
# the default is to use the user's home directory
;[Profiles]
; path = /home/profiles
; browseable = no
; guest ok = yes


# NOTE: If you have a BSD-style print system there is no need to
# specifically define each individual printer
[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
# Set public = yes to allow user 'guest account' to print
guest ok = yes
printable = yes


Thanks

superbnerd
2004-09-23, 06:12 PM CDT
it looks like you need to setup your computers to use static ips. use the system-config-network tool under system settings > network. click the device you want to configure and click edit and choose static ip instead of dhcp. be sure to choose a static ip that will not be used by the dhcp server. so if you want the static ip of 192.168.0.2 tell your dhcp server to start from 192.168.0.3

mugs
2004-09-23, 06:17 PM CDT
Well, it worked fine before this morning, and if I set it to Static, I wont be able to get online, as I dont hafve a static ip from my DSL provider...right?

thanks

Also, this is my ifcfg-eth0

# nVidia Corporation|nForce2 Ethernet Controller
DEVICE=eth0
BOOTPROTO=dhcp
HWADDR=00:30:1B:28:26:B0
ONBOOT=yes
TYPE=Ethernet
IPADDR=192.168.0.2
USERCTL=no
PEERDNS=yes
IPV6INIT=no

it shows 192.168.0.2, yet it keeps showing as 192.168.0.3

superbnerd
2004-09-23, 06:20 PM CDT
hold on...please explain your configuration. I assumed you have a router that uses nat to share the dsl and server the dhcp.

mugs
2004-09-23, 06:31 PM CDT
yes, that is how I have it.

superbnerd
2004-09-23, 06:37 PM CDT
ok, follow my instructions above. yo will need to have access to your routers config section. usully you just put the router's ip (usually 192.168.0.1 or 192.168.1.1) in the browser and supply the default password (usually "admin"). go to the dhcp section and change the range to start after your static ip. you may have to consult your router's documentation unless you have a linksys router. I can walk you through it with that.

blammo
2004-09-23, 06:45 PM CDT
This don't look right here in your smb.conf:


hosts allow = 192.168.1. 192.168.2. 192.168.0.3 192.168.0.4 192.168.0.5 192.168.0.6 127.

Maybe change this to:

hosts allow = 192.168.0. 127.

mugs
2004-09-24, 06:13 AM CDT
First off, I did not receive email notification of the last 2 replies, weird.

Blammo, I took your suggestion, but it still doesnt work.

Supernerd, I am hesitant to change any router settings. I have had the router set up for several years, and have never had a problem. I really dont think the problem is there.

It is very weird. I have tired all different combinations of settings in SMB4K. Sometimes I am able to add the pc manually. Still with that, I cannot access the shares. What usually happens is that it will show 192.168.0.3 very briefly and then it changes back to 192.168.0.2. According to ifconfig, it is 192.168.0.3, but I guess Samba still thinks it is 192.168.0.2? I think if I could get it to go back to "2" my problems would be solved. I dont understand why it keeps giving me "3" now. When I checked from a different PC it showed up as 192.168.0.3. I was able to see the shares, but not mount them, as I am also having authentication issues, I guess. From that 2nd computer, itself showed as 192.168.0.4, which is correct. When I try from the pc in question, it doesnt show any ip in smb4k.

I hope this makes sense. I appreciate your patience and your help. I really need to get this working correctly again.

Thanks.

theninja
2004-09-24, 07:53 AM CDT
Mugs,
Go into your router settings and clear out the dhcp clients table. You probably have 192.168.0.2 still in there. Or you could just power cycle the router. Hope this helps.
theninja

mugs
2004-09-24, 08:56 AM CDT
Ok, but I want it to be 192.168.0.2, since that is what SAMBA sees it at. I am sorry if I am being dense, dont have a lot of experience with this. Thanks.

Tru
2004-09-24, 08:57 AM CDT
Yes, if you want to keep that computer as 192.168.0.2 then go into your router by opening a web browser and typing 192.168.0.1 or 192.168.1.1 this should bring up a screen of options. What you want will say DHCP SERVER or just DHCP click on this and there should be an option to turn it off, so turn it off and click save. Then you will assign your computers static internal ip's this will not make u lose your internet as you thought these are just internal ip's. Also dont worry that your router has worked for years as it will still work the same it just wont be giving out the internal ip's your computers will be giving them to themselves. Other info you will need is the 2 DNS server ips those you will find in your router page as well.

This might seem like a lot but it is really easy and is the only way you will be able to make your computers always have the same ip. To give you an idea of what this will look like I will type it out.

Ip Address 192.168.0.2

Subnet Mask 255.255.255.0

Defualt Gateway 192.168.0.1

Preffered DNS 202.176.198.2

Secondary DNS 202.176.198.3

Those DNS servers are just numbers i made up but it will be simliar you can prbly call your ISP to and get those DNS server IP's. Trust me doing this now will make your life easier later. Lets say on your main comp that is normaly 192.168.0.2 you forward some ports to that ip to make some service work then you boot up one morning and now your 192.168.0.3 your screwed and now your service wont work until you do some diffrent boot orders to try to get the same ip which is pretty lame. Hope you try this.

theninja
2004-09-24, 09:12 AM CDT
As tru stated, this is exactly what you need to do. Setting a static ip is the only way to ensure you will keep the same ip. With DHCP, everytime you boot, you are likely to get a new ip. This is very east to setup. If you have trouble, we are here to help.
I have 5 computer on my LAN at home all with static ips, but I leave DHCP enabled on the router. I do this because I have a work laptop that I connect to work via VPN. So just so you know it is possible to have bot static and DHCP system on the router.

mugs
2004-09-24, 09:56 AM CDT
I really appreciate the ideas. I will definitely do that with the router and the static ips.

So, I will need to set up each computer with a static ip, right? I will also have to input the mask, gateway, and dns settings?

I will do this this weekend and let you know how it goes.

Also, will this solve the problem of seeing the shares, but not being able to mount them, becuase it asks for authentication?

Thanks again!

Tru
2004-09-24, 10:37 AM CDT
Not sure about the mounts but I doubt it, but without a static ip you will always have problems because you will map certain ips for certain comps then your ips will change and you will be back to square one. So if I were you I would first just get all my computers on static ips and make sure everything like internet etc is working, then start over with your samba. As for leaving DHCP on I wouldnt reccomend it if you dont need it, it will be simpliar to just turn it off then assign each comp a ip.

mugs
2004-09-24, 11:06 AM CDT
So, I turn off DHCP on the router or on each machine?

Thanks.

blammo
2004-09-24, 11:27 AM CDT
I think there is still a configuration problem here. Samba doesn't require static IP's in order to work. If the network and samba are setup correctly, you should be able to browse/mount shares no matter what the DHCP server assigns to a machine, provided it's correct for the network, subnet mask, etc.

mugs
2004-09-24, 11:42 AM CDT
Blammo, that is what I thought. My computer is getting 192.168.0.3 now, instead of .2. I know it shouldnt matter, but in SMB4K, it still says it is .2. Appreciate your comments.

Thanks.

theninja
2004-09-24, 03:04 PM CDT
The purpose of the static would be that you do not get a new ip on each reboot. Not for samba working correctly. In your smb.conf file for the host allow = just put the first 3 octets like so
hosts allow = 192.168.1
thats it put nothing more on that line.
I still suggest using static ips though. Hope this works for ya.

theninja
2004-09-24, 03:05 PM CDT
oops, make that hosts allow = 192.168.1.
Don't forget the last .

theninja
2004-09-24, 03:08 PM CDT
errr, after reading the original post it looks like it should be
hosts allow = 192.168.0.

Thats it nothing more on that line.

mugs
2004-09-24, 03:36 PM CDT
I took a quick look at my router settings, i will look at it more closely later. Still, I dont know if I got the answer to my original question. Why wont this machine get an IP of 192.168.03 and/or how can I get Samba to recognize the actual IP?

Thanks.

theninja
2004-09-24, 04:03 PM CDT
Set the ip's as static! Then make sure the smb.conf file is correct. Restart samba. Done. No more problems with samba.

Here is my smb.conf file

# Samba config file created using SWAT
# Date: 2003/01/23 22:23:01

# Global parameters
[global]
encrypt passwords = Yes
wins support = Yes
username = theninja
guest account = slurp
valid users = theninja
admin users = theninja
hosts allow = 1.2.13.

[home]
path = /home
writable = yes

[stuff]
path = /stuff
writeable = yes

superbnerd
2004-09-24, 04:06 PM CDT
you might need to add the host mane and ip to you /etc/hosts file. of course that only works if you are suing static ips.

mugs
2004-09-26, 12:22 PM CDT
well, I turned off dhcp on my router, and now I have no internet or network. And, I cannot reconnect to my router to fix this!! The router is a netgear 314. :( :confused:

crackers
2004-09-26, 02:31 PM CDT
Set up any of the inside computers to have a static IP address of 192.168.0.1 - this should allow you to access the router through the browser again. If not, there's always the "reset" switch on the router to set it back to the factory settings.

mugs
2004-09-26, 04:50 PM CDT
not so simple. I tried that, I have spent all day trying to fix it, to no avail. I dont have a reset switch, rather I am supposed to hook up a serial cable. Well, that didnt work either, and now I am stuck with no network and NO Internet....

crackers
2004-09-26, 08:45 PM CDT
I dont have a reset switch, rather I am supposed to hook up a serial cable.
I'm not at all familiar with the product, but I find it hard to believe that there's no reset on it. It's not necessarily a visible switch, but rather a small hole to poke the end of a bent paper-clip into. Have you referred to the hardward docs?

mugs
2004-09-27, 05:29 AM CDT
I appreciate the ideas, Crackers. But, there is no reset switch or hole to poke a paper clip into. The router is 3-4 years old. It jus6t has a serial port labeled manager. I tried with a serial cable, but it didnt work. Perhaps my serial cable was bad or not the proper kind.

In the meantime...I am totally dead in the water. I brought the router to work with me to see if I have any better luck.

Tru
2004-09-27, 07:14 AM CDT
Hey Mugs, I feel bad as I was one of the people who told you to goto a static ip so I will do my best here to try to get this resolved.

Ok here is a check list of things to do.

1) after you turned off DHCP in your router you now have to give each comp a static ip, have you done this yet? Refer to my earlier post on how that should look, and exactly what numbers you need.

2) Even with DHCP off on your router you should still be able to access it thru the web browser with whatever the default gateway IP was. Unless the DHCP was assigning your router a number to which is highly unlikely as the default gateway should always have a static ip, would make it hard to access it if it was always changing LOL.

If you have done all those things please post back in greater detail about it so I can hopefully give you a better answer on what to try next, just make sure you have added your static ips first to your comp you wont be able to get to your router which I have a feeling is the problem since you didnt say you had assigned statice ips yet. Oh yeah if your default gateway was 192.168.1.1 then make your first ip to 192.168.1.2 and if it was 192.168.0.1 then make your first ip to 192.168.0.2 just to keep things easier.

mugs
2004-09-27, 08:16 AM CDT
Tru, dont feel bad. I feel bad, but that is because I am stuck with nothing. I did set my computer to a static ip, put in the dns numbers from my isp, I still cannot connect to the isp or the router. I used to get to the router with 192.168.0.1. The only thing I did was turn off dhcp. I can bring up eth0 with a static ip, just cant connect to the internet or the router. I tried with a serial cable, becuase my router has no reset switch. It didnt work, but I may not have had the correct serial cable. I will probably go buy one today as that seems to be my last option. I even brought the router to work to try on my win2k laptop, still I cannot telnet in. It is a netgear rt314 router. I have DSL with a speedstream modem. Originally this was all setup under windows, when I moved to Linux a couple of years ago, the transition was smooth, no configuring needed. I have installed several different versions of Linux and always no problem. But, when I turned off the dhcp, that is when the trouble started. I know if I could get into the router, I could fix it.

I appreciate your help and look forward to more suggestions. Let me know if you need any other info!

Thanks!

theninja
2004-09-27, 10:09 AM CDT
Mugs, Are you trying to access the router from linux or windows?? If from linux make sure you put the router ip in for the gateway. The file is /etc/sysconfig/network and should look something like this...

NETWORKING=yes
HOSTNAME=seraph
GATEWAY=10.37.8.1

mugs
2004-09-27, 10:21 AM CDT
well, I have tried it from both. I will try what you suggested, when I get home.

Thanks.

mugs
2004-09-27, 05:15 PM CDT
Whoo hoo! I am back on. Got a serial cable and was able to reset the router. thanks for everyones help.

Now, I need to go back to the first issue and get the network going...but not tonight! :D

Tru
2004-09-27, 07:45 PM CDT
Hey Mugs, now that you can access you should fix the static ip. If you venture into trying it again make sure that your router is staying at 192.168.0.1 you might have to assign it manullay when you take off DHCP just go thru your router stuff a little more to see.

mugs
2004-09-28, 03:49 AM CDT
Well, I should be scared of trying, but I am not. Maybe I did something wrong? What do I need to do exactly? Thanks.

Tru
2004-09-28, 08:26 AM CDT
Its hard for me to say without seeing some screenshots of what your router webpage looks like, there are diffrent. If you can access your main router page and take a screenshot and then take a screenshot of the section where you take off dhcp that might help. When you took off DHCP did it ask you to do anything else before it saved new settings?

mugs
2004-09-28, 08:36 AM CDT
Ok, I will post some screen shots when I get back home, thanks. Oh, the machine is getting 192.168.0.2 again, so that is good.

blammo
2004-09-28, 08:46 AM CDT
I just checked the Netgear site and in the support section they have a pretty in depth installation guide and reference guide that covers the RT314. If I was you I'd read these docs first before fiddling.

mugs
2004-09-28, 05:24 PM CDT
ok, back to my original problem...on smb4k, I have it working better, but there are still some shares that i cannot mount, it keeps aksing me for username and password, i put it in and it just asks over and over...

blammo
2004-09-28, 07:45 PM CDT
Check your samba logs. It might give you a hint as to why it's not taking the username/password. Share Level security mode is buggy, especially if you got Windows boxes on your network. Try switching to User Level security (security = user) in your smb.conf. Make sure the users have a system account and are added to the smbpasswd file. Try mounting the share using a different method other than smb4k, i.e.

smbclient //server/share -U username

Lastly, try using swat to configure samba, but backup your smb.conf file first.

Since I have no clue as to what your network consists of, I'm just making some suggestions here. HTH.