How to set Auto eth0 IP address

Yes, I’ve set the mask to 255.255.255.0, the gateway is 192.168.1.1, and by DNS I meant the DNS IP for dynamic IPs which is the same as the router’s 192.168.1.1 but the router is set up with openDNS IP addresses for internet. Should I set DNS for local machines? Or only for the router? But as the IP is set dynamically by the router I don’t see how DNS can be set.

The clients are all openSUSE-11.4. All set up with dynamic DHCP. I can connect to NAS with smb://dataserver or to its admin panel through http://dataserver. But autofs can’t auto mount it with NFS.

Here’s ifconfig -a:


# ifconfig -a
eth0      Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx  <- I changed this to xx here
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interrupt:47 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:188 errors:0 dropped:0 overruns:0 frame:0
          TX packets:188 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:13492 (13.1 Kb)  TX bytes:13492 (13.1 Kb)

vboxnet0  Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx  <- I changed this to xx here  
          inet6 addr: fe80::800:27ff:fe00:0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 b)  TX bytes:468 (468.0 b)

wlan0     Link encap:Ethernet  HWaddr xx:xx:xx:xx:xx:xx  <- I changed this to xx here  
          inet addr:192.168.1.102  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::21e:64ff:fe23:ab92/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2827 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2698 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2283571 (2.1 Mb)  TX bytes:512106 (500.1 Kb)

Here’s the cat /etc/hosts:


# cat /etc/hosts
#
# hosts         This file describes a number of hostname-to-address
#               mappings for the TCP/IP subsystem.  It is mostly
#               used at boot time, when no name servers are running.
#               On small systems, this file can be used instead of a
#               "named" name server.
# Syntax:
#    
# IP-Address  Full-Qualified-Hostname  Short-Hostname
#

127.0.0.1       localhost

# special IPv6 addresses
::1             localhost ipv6-localhost ipv6-loopback

fe00::0         ipv6-localnet 

ff00::0         ipv6-mcastprefix 
ff02::1         ipv6-allnodes 
ff02::2         ipv6-allrouters 
ff02::3         ipv6-allhosts 
127.0.0.2       laptop.site laptop
192.168.1.2     dataserver.site dataserver

Here’s the server ping:


# ping dataserver
PING dataserver.site (192.168.1.2) 56(84) bytes of data.
64 bytes from dataserver.site (192.168.1.2): icmp_req=1 ttl=64 time=3.84 ms
64 bytes from dataserver.site (192.168.1.2): icmp_req=2 ttl=64 time=1.04 ms
64 bytes from dataserver.site (192.168.1.2): icmp_req=3 ttl=64 time=1.03 ms
^C
--- dataserver.site ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2001ms
rtt min/avg/max/mdev = 1.037/1.977/3.847/1.322 ms

On Fri April 15 2011 03:36 am, linuxoidoz wrote:

> But autofs can’t auto mount it with NFS.
linuxoidoz;

I assume you followed through on tararpharazon’s post and verified that the
NFS client was running. Did you also verify that it was an allowed service
through the firewall?

YaST>Security and Users>Firewall>Allowed Services

Make sure that NFS client is allowed. I would even suggest you try disabling
all firewalls for testing, just be sure to re-enable them when you’re done.

You might want to also check /var/log/messages and look in /var/log/apparmor/
to see if there is any information there that might relate to your inability
to auto mount.

As you can access the NAS through smb:, have you tried a standard CIFS mount
or even a standard NFS mount rather than autofs? Here is a HowTo on CIFS:
http://opensuse.swerdna.org/susesambacifs.html
See also “man mount” and/or “info mount”


P. V.
“We’re all in this together, I’m pulling for you.” Red Green

Something’s still messed up on machines with dynamic IPs. I had exactly the same problem on my desktop but as soon as I changed its IP from dynamic to static, it started working. Or this may be a pure coincidence.

I tried both adding an NFS service to firewall and turning off firewall completely - no change. Rebooted everything many times, restarted autofs - no change.

I checked NFS client and it’s not running. The NFS service is only required if you want to hard mount an NFS share. If you use autofs, NFS service is not required. And, of course because I don’t have anything in fstab, it doesn’t start the NFS client.

The thing is - I have not changed anything other than played around with IP addresses. All worked perfectly well before that.

I don’t have AppArmor.

I can’t find anything in the logs, they’re all empty.

I prefer auto mount with nfs. I don’t want to hard mount (my wife will scream like there’s no tomorrow if her laptop locks when I’m not at home).

On Fri April 15 2011 10:36 pm, linuxoidoz wrote:

> I don’t have AppArmor.
>
> I can’t find anything in the logs, they’re all empty.

I find that hard to believe. Try:


sudo tail -n20 /var/log/messages

This should give the last 20 lines of the file

>
> I prefer auto mount with nfs. I don’t want to hard mount (my wife will
> scream like there’s no tomorrow if her laptop locks when I’m not at
> home).

linuxoidoz;

OpenSuse 11.4 installs Apparmor by default and it is almost impossible to get
rid of since it is more tightly bound to the kernel than in previous
releases. Just how did you get rid of Apparmor?

Does the NAS restrict IPs that can connect?

Even if you do not use the classical mounts as a permanent solution it might
help to debug this if you tested to see if they work. Just try to mount the
NAS in a terminal window on one of the clients. (mount needs root
permissions)


P. V.
“We’re all in this together, I’m pulling for you.” Red Green

On Fri April 15 2011 11:30 pm, PV wrote:

> On Fri April 15 2011 10:36 pm, linuxoidoz wrote:
>
<snip>
>
> Does the NAS restrict IPs that can connect?
>
<snip>

PS: In particular what is in the “exports” file?


P. V.
“We’re all in this together, I’m pulling for you.” Red Green

Oh, when I open the messages with KWrite, the file is empty. But the console shows the messages. The nfs error is this:

nm-dispatcher.action: Script ‘/etc/NetworkManager/dispatcher.d/nfs’ exited with error status 2.

I’ll post the 20 messages just after this post.

The first thing I do during every installation is YAST->Software Management->Patterns->Novell AppArmor->All in this list->Taboo–Never Install, which doesn’t install AppArmor. But regardless of the details, I haven’t changed anything on my laptops except for IP addresses.

I haven’t touched the NAS settings except for making its IP static. And it provides access based on a user and group, not IP address.

I can’t get to the NAS export file, it’s a Seagate Blackarmor NAS 110 and the firmware is inaccessible.

I’ll try to hard mount NAS and see what happens.

# tail -n20 /var/log/messages
Apr 16 16:18:46 netbook NetworkManager[1233]: <info> Activation (wlan0) Stage 4 of 5 (IP4 Configure Get) started...
Apr 16 16:18:46 netbook NetworkManager[1233]: <info>   address 192.168.1.101
Apr 16 16:18:46 netbook NetworkManager[1233]: <info>   prefix 24 (255.255.255.0)
Apr 16 16:18:46 netbook NetworkManager[1233]: <info>   gateway 192.168.1.1
Apr 16 16:18:46 netbook NetworkManager[1233]: <info>   nameserver '192.168.1.1'
Apr 16 16:18:46 netbook NetworkManager[1233]: <info> Activation (wlan0) Stage 5 of 5 (IP Configure Commit) scheduled...
Apr 16 16:18:46 netbook NetworkManager[1233]: <info> Activation (wlan0) Stage 4 of 5 (IP4 Configure Get) complete.
Apr 16 16:18:46 netbook NetworkManager[1233]: <info> Activation (wlan0) Stage 5 of 5 (IP Configure Commit) started...
Apr 16 16:18:46 netbook avahi-daemon[1139]: Joining mDNS multicast group on interface wlan0.IPv4 with address 192.168.1.101.
Apr 16 16:18:46 netbook avahi-daemon[1139]: New relevant interface wlan0.IPv4 for mDNS.
Apr 16 16:18:46 netbook avahi-daemon[1139]: Registering new address record for 192.168.1.101 on wlan0.IPv4.
Apr 16 16:18:47 netbook NetworkManager[1233]: <info> (wlan0): device state change: 7 -> 8 (reason 0)
Apr 16 16:18:47 netbook NetworkManager[1233]: <info> Policy set 'Home' (wlan0) as default for IPv4 routing and DNS.
Apr 16 16:18:47 netbook NetworkManager[1233]: <info> Activation (wlan0) successful, device activated.
Apr 16 16:18:47 netbook NetworkManager[1233]: <info> Activation (wlan0) Stage 5 of 5 (IP Configure Commit) complete.
Apr 16 16:18:48 netbook if-up.d/21-dhcpcd-hook-samba: No dhcpcd info nor dhclient leases file found for wlan0.
Apr 16 16:18:48 netbook kernel:  2392.386030] wlan0: no IPv6 routers present
Apr 16 16:18:49 netbook SuSEfirewall2: Setting up rules from /etc/sysconfig/SuSEfirewall2 ...
Apr 16 16:18:49 netbook SuSEfirewall2: Firewall rules successfully set
Apr 16 16:18:49 netbook nm-dispatcher.action: Script '/etc/NetworkManager/dispatcher.d/nfs' exited with error status 2.

I tried the following:


# mount -t nfs dataserver:/DataVolume/Data /mnt/Temp
mount.nfs: requested NFS version or transport protocol is not supported

Which is nonsense as it works on my desktop.

Plus I have this error message:


Apr 16 16:48:16 netbook nm-dispatcher.action: Script '/etc/NetworkManager/dispatcher.d/netcontrol_services' exited with error status 127.
Apr 16 16:49:29 netbook automount[6752]: key ".directory" not found in map source(s).

Ah, wait a minute, of course it won’t mount from root as root is not part of the ‘datagroup’ which has got permissions to access the NAS. How does autofs mount NFS from a non-root user? Is there any way to hard mount it from a non-root user?

I’ve also checked the auto.misc files on both the desktop and netbook, they’re identical.

linuxoidoz wrote:

>
> I tried the following:
>
> Code:
> --------------------
>
> # mount -t nfs dataserver:/DataVolume/Data /mnt/Temp
> mount.nfs: requested NFS version or transport protocol is not supported
>
> --------------------
>
> Which is nonsense as it works on my desktop.

Does either of the following work?

Code:

mount -t nfs -o proto=udp dataserver:/DataVolume/Data /mnt/Temp


or

Code:

mount -t nfs -o vers=4 dataserver:/DataVolume/Data /mnt/Temp



Don

It’s difficult to help when the OP doesn’t follow through on requested information or suggestions. And the OP bounces from issue to issue.
DHCP provides IP addresses to LAN and generally obtains IP addresses from ISP. Some people use static IP addressing or reserved IP addressing by MAC address.
DNS provides name resolution to translate IFQN to IP addresses as in resolving Internet names to IP addresses.
If you specify dynamic DNS from OpenDNS on the router that will be the resolver used for your LAN whether you code it static, leave blank or leave dynamic on each machines eth0/wlan configuration.

For instance, my install of OS 11.4, which installed and enabled AppArmor, does not start or use autofs but nfs client is enabled and all my imported NFS volumes defined in /etc/fstab are mounted. I can use the -o noauto to bypass auto mounts. I would suggest using NFS3, unless you are sure your NAS Server is using NFS4. There should be a terminal or panel on your NAS Server that shows your exported NFS volumes.

Please post output using SUSE Paste :
from your /etc/fstab
from mount
from ifconfig

Please enable NFS Client using YaST2 and add the volumes you from your NAS server you are trying to access.
Allow access through firewall, especially if your NAS Server is accessed through the external interface.
You can turn it off later and as I mentioned you should turn off NFS4 unless you are 100% sure your NAS Server is using NFS4.

On Sat April 16 2011 02:06 am, linuxoidoz wrote:

>
> Ah, wait a minute, of course it won’t mount from root as root is not
> part of the ‘datagroup’ which has got permissions to access the NAS. How
> does autofs mount NFS from a non-root user? Is there any way to hard
> mount it from a non-root user?
>
> I’ve also checked the auto.misc files on both the desktop and netbook,
> they’re identical.
>
linuxoidoz;

To be honest, I’m running out of ideas. Try a cifs mount. You can specify
the username and password to use when connecting with the options “user=”
and “password=”. (See man mount.cifs)

If in fact all you did was change IP’s, as you stated, and if it had worked
before this, the only thing I can think of is a filter blocking the higher
IPs. Notice that your desktop can connect (192.168.1.3) yet the other
client cannot (192.168.1.101).

It’s possible some timing issue takes place when you assign IPs dynamically.
But if you restarted autofs after the network was initialized and it still
fails it something is blocking 192.168.1.101. Is there a log file on the
NAS that gives, or could if enabled, any information?


P. V.
“We’re all in this together, I’m pulling for you.” Red Green

venzkep:

If in fact all you did was change IP’s, as you stated, and if it had worked
before this, the only thing I can think of is a filter blocking the higher
IPs. Notice that your desktop can connect (192.168.1.3) yet the other
client cannot (192.168.1.101).

You may be onto something here. I’ve got an idea. I’ll set a static IP to my laptop and see if it works. This will eliminate the idea that it may be something to do with filtering in the router.

tararpharazon:

It’s difficult to help when the OP doesn’t follow through on requested information or suggestions.

Like what? I think I’ve done everything everyone has suggested. If you mean “to make sure NFS client is running”, I’ve already said it doesn’t.

For instance, my install of OS 11.4, which installed and enabled AppArmor, does not start or use autofs but nfs client is enabled and all my imported NFS volumes defined in /etc/fstab are mounted. I can use the -o noauto to bypass auto mounts. I would suggest using NFS3, unless you are sure your NAS Server is using NFS4. There should be a terminal or panel on your NAS Server that shows your exported NFS volumes.

As I said, the first thing I do during installation is go to the software selection and select AppArmor - All in this list – Do not install. I don’t have AppArmor, I never had. If it still installs something, it doesn’t bother me and it will be the same on both static and dynamic IP machines.

As I said earlier, NAS does NOT support NFSv4, so I use -fstype=nfs which usses v3. And it used to work before. I have not changed the autofs config files at all.

Please post output using SUSE Paste :
from your /etc/fstab
from mount
from ifconfig

Will the hard mount work if root is not part of authorized access users on NAS? I don’t know how mount is different to autofs, but autofs mounts non-root users while mount doesn’t, at least not from console.

drab:

mount -t nfs -o proto=udp dataserver:/DataVolume/Data /mnt/Temp

It said:
Using NFS over UDP can cause data corruption
mount.nfs: requested NFS version or transport protocol is not supported

mount -t nfs -o vers=4 dataserver:/DataVolume/Data /mnt/Temp

It said:
mount.nfs: requested NFS version or transport protocol is not supported

linuxoidoz wrote:

> drab:
>
> # mount -t nfs -o vers=4 dataserver:/DataVolume/Data /mnt/Temp
> It said:
> mount.nfs: requested NFS version or transport protocol is not supported

Sorry. I meant

-o vers=3

but in either case I misunderstood. I see elsewhere in your reply that you
do not have nfs-client running. In that case I would not expect these
commands to work.


Don

I’ll set a static IP to my laptop and see if it works.

That brings me back to the original question, how can I set a static IP for the default eth0 interface in NetworkManager (NM, not ifup!) to always connect with that static IP? Does NM have a config file?

In the router, is the IP-MAC reservation for static IPs or dynamic IPs?

The file for that connection is /etc/NetworkManager/system-connections/“Auto eth0” (if I recall correctly). I do not know whether it is possible to edit that file to force a static IP. If you have gnome on one of your systems, try configuring that connection with the gnome nm-applet.

I’m not sure what you are asking. If you reserve an IP for a particular MAC, then that pretty much makes that a static IP, unless the MAC is for a USB adapter. Routers are different in how they handle IPs and MACs. My current router allows me to reserve any IP for a particular MAC (within the LAN subnet of course). An earlier router that I had would automatically reserve an IP for a MAC (write it to non-volatile memory), though you could delete that entry and try again. And another router gave my laptop a different IP for linux than for windows, even though the MAC was the same.

On Sat April 16 2011 10:06 pm, linuxoidoz wrote:

>
>> I’ll set a static IP to my laptop and see if it works.
> That brings me back to the original question, how can I set a static IP
> for the default eth0 interface in NetworkManager (NM, not ifup!) to
> always connect with that static IP? Does NM have a config file?
>
> In the router, is the IP-MAC reservation for static IPs or dynamic IPs?
>
>
linuxoidoz;

I’ve never setup Network Manager with fixed IP, but I assume (and may well be
wrong) that you could set up a static IP just as you do for ifup.
YaST>Network Device>Network Settings. In the Global section check “Network
Manager” and then set the other values as with ifup.

If you get your IP from the router it is still dynamic even if it is always
the same IP. Have you tried a CIFS mount? Even if you do not finally use
this, it would be nice to know if it can succeed or also fails.

P. V.
“We’re all in this together, I’m pulling for you.” Red Green

Alright, it’s the router. I’ve rebooted and connected with a static IP - doesn’t mount NFS. Now I’m also out of ideas. Now it’s exactly the same set up as it used to be before I started changing IPs.

Yes, I can mount cifs and access NAS with smb:/dataserver in Dolphin.

The file for that connection is /etc/NetworkManager/system-connections/“Auto eth0” (if I recall correctly). I do not know whether it is possible to edit that file to force a static IP.

Yes, the file is there but it’s not editable with Kwrite, may be binary?

linuxoidoz wrote:

>> I’ll set a static IP to my laptop and see if it works.
> That brings me back to the original question, how can I set a static IP
> for the default eth0 interface in NetworkManager (NM, not ifup!) to
> always connect with that static IP? Does NM have a config file?

Did you try the workaround I already posted?


Don

Alright, it’s the router.

That should read “it’s **NOT **the router.” It doesn’t seem to be the router, as it still can’t automount with a static IP. I’ve gone through all router options and made sure I don’t have any filters set. I can’t think of anything else. This is SO strange. How can it be messed up so much? I’ve been doing this for more than 2 years with all sorts of computers and now can’t make it to work.

drab,

Did you try the workaround I already posted?

You mean the script? I was going to try it. But as I tried it again with a static IP which didn’t work, the script won’t fix it. The problem is somewhere else.

I’m on the verge of reinstalling but have doubts whether that would help.

Can anyone think of anything why one would auto mount it and another won’t? What sort of config files would you suggest I check?