# [solved] Samba problems (also network)

## OtonVM

Hello!

If you are wondering: yes, this is another "I don't understand samba at all" thread. I'm sure this has been explained a dozen times before but please, if there are any good souls out there, help me!

I read the wiki and searched the forums. I did all that I could find but nothing worked.

I'm trying to connect two pcs through a switch. In in win the configuration is set as follows:

PC gentoo (linux):

IP: 192.0.0.10

Subnet: 255.255.0.0

Gateway: 192.0.0.1

PC work (winxp):

IP: 192.0.0.11

Subnet: 255.255.0.0

Gateway: 192.0.0.1

Both are in workgroup HOME. The network connects at startup on win with no problems.

I have Gentoo installed on the first pc. To connect to the seccond one I first used the gnome configuration and restarted samba. smb:/// was empty. Then I used swat but there was no big difference. And so on... Then I came here...   :Smile: 

So here are all the configuration files I though of when configuring:

```

smb.conf:

# Samba config file created using SWAT

# from 127.0.0.1 (127.0.0.1)

# Date: 2006/09/21 18:37:13

[global]

        workgroup = HOME

        server string = gentoo

        interfaces = eth0

[share]

        path = /home/otonvm/shares

        read only = No

        guest ok = Yes

/etc/conf.d/net:

dns_domain_lo="HOME"

config_eth0=( "adsl" )

/etc/hosts:

127.0.0.1       gentoo.HOME     gentoo  localhost

192.0.0.11      work.HOME    work

```

samba USE flags:

```

net-fs/samba-3.0.22-r3  USE="automount cups ldap pam python readline swat winbind xml -acl -async -doc -examples -kerberos -ldapsam -libclamav -mysql -oav -postgres -quotas (-selinux) -syslog"

```

and the kernel has built in smbfs.

I most of all need to see the files shared on the seccond pc (ntfs partition, btw). I also have a firewall running on gentoo.

That's it. Here my knowledge ends (not much, heh?   :Confused: ). Any suggestions?Last edited by OtonVM on Sun Oct 01, 2006 8:09 pm; edited 1 time in total

----------

## rullzer

I'm no gnome user myself but a quick 'emerge -pv gnome | grep samba' showed me that build gnome-base/gnome-vfs  app-admin/gnome-system-tools both have a samba use flag..

Did you compile those with the samba use flag?

rullz

----------

## OtonVM

Yeah, sorry, my bad:

```

Portage 2.1.1 (default-linux/x86/2006.1, gcc-4.1.1, glibc-2.4-r3, 2.6.17-emission8 i686)

=================================================================

System uname: 2.6.17-emission8 i686 AMD Athlon(tm) 64 Processor 3700+

Gentoo Base System version 1.12.5

Last Sync: Thu, 21 Sep 2006 07:50:01 +0000

app-admin/eselect-compiler: [Not Present]

dev-java/java-config: 1.3.6-r1, 2.0.29

dev-lang/python:     2.4.3-r1

dev-python/pycrypto: 2.0.1-r5

dev-util/ccache:     [Not Present]

dev-util/confcache:  [Not Present]

sys-apps/sandbox:    1.2.17

sys-devel/autoconf:  2.13, 2.59-r7

sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2

sys-devel/binutils:  2.16.1-r3

sys-devel/gcc-config: 1.3.13-r3

sys-devel/libtool:   1.5.22

virtual/os-headers:  2.6.17-r1

ACCEPT_KEYWORDS="x86"

AUTOCLEAN="yes"

CBUILD="i686-pc-linux-gnu"

CFLAGS="-Os -march=athlon64 -pipe -mmmx -m3dnow -msse -msse2 -msse3"

CHOST="i686-pc-linux-gnu"

CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/X11/xkb /usr/share/config /var/bind"

CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/gconf /etc/java-config/vms/ /etc/revdep-rebuild /etc/splash /etc/terminfo"

CXXFLAGS="-Os -march=athlon64 -pipe -mmmx -m3dnow -msse -msse2 -msse3"

DISTDIR="/usr/portage/distfiles"

FEATURES="autoconfig distlocks fixpackages metadata-transfer parallel-fetch sandbox sfperms strict"

GENTOO_MIRRORS="http://ftp.belnet.be/mirror/rsync.gentoo.org/gentoo/"

LDFLAGS="-Wl,-O1"

LINGUAS=""

MAKEOPTS="-j2"

PKGDIR="/usr/portage/packages"

PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --delete-after --stats --timeout=180 --exclude='/distfiles' --exclude='/local' --exclude='/packages'"

PORTAGE_TMPDIR="/var/tmp"

PORTDIR="/usr/portage"

PORTDIR_OVERLAY="/usr/local/portage /usr/portage/local/layman/portage-xgl /usr/portage/local/layman/sunrise /usr/portage/local/layman/stuart-desktop /usr/portage/local/layman/gentopia /usr/portage/local/layman/ebuild-exchange"

SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"

USE="x86 3dnow X a52 aac alsa asf avahi berkdb bitmap-fonts bzip2 cdr cli cups dbus dlloader dri dts dvd dvdr elibc_glibc encode esd firefox flac fortran gdbm gif glitz gnome gphoto2 gpm gstreamer gtk gtk2 hal imagemagick input_devices_keyboard input_devices_mouse ipod isdnlog java jpeg kernel_linux libg++ mad matroska mmx mng mp3 mpeg nautilus ncurses nls nptl nptlonly nsplugin nvidia ogg opengl pam pcre pdf perl png ppds pppd python quicktime readline real reflection samba session spell spl sse sse2 ssl svg symlink tcpd theora tiff truetype truetype-fonts type1-fonts udev unicode usb userland_GNU video_cards_nvidia video_cards_vesa vorbis win32codecs x264 xine xml xorg xprint xv xvid zlib"

Unset:  CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_RSYNC_EXTRA_OPTS

```

.... samba USE is global.

----------

## Su8l1me

You don't say whether or not any other sort of networking between the two machines works. Can you :

a) Ping them from each other ?

b) Use any other network utils to connect, e.g. telnet, ftp, ssh, http ?

----------

## darkphader

 *OtonVM wrote:*   

> I have Gentoo installed on the first pc. To connect to the seccond one

 

Just a note that you don't need Samba running to connect to the XP system. Samba is really the server and not the client. The package does, however, provide smbclient which provides ftp like access to Windows shares and some gui front ends use it.

Normally to mount a Windows share you would use the kernel modules cifs (preferable) or smbfs.

Chris

----------

## OtonVM

Su8l1me:

Ok, let's see.... No, I can't ping 192.0.0.11, I get no response. I can normally ping 192.0.0.10 (myself).

Don't know about other utilities since I never used them... But isn't ssh for remote admin? 

darkphader: 

I had no idea...   :Very Happy:  I have cifs & smbfs in kernel. But it seems I can't even see it in the first place... 

dammit, what's wrong??   :Mad: 

----------

## rullzer

well if you can't ping the other pc. There is a problem in your network.

DO both have acces to the internet?

rullz

----------

## GenYetiToo

 *OtonVM wrote:*   

> No, I can't ping 192.0.0.11

 

Set the IPs to 192.168.1.10 and 11 and try again.

M.

----------

## OtonVM

 *rullzer wrote:*   

> well if you can't ping the other pc. There is a problem in your network.
> 
> DO both have acces to the internet?
> 
> rullz

 

I was afraid of that... 

Yes, both connect to the net; both have one network card connected to the switch, wich is connected to the adsl modem.

I also tried to stop both firewalls (allowing all connections)... No results...  :Sad: 

----------

## OtonVM

 *GenYetiToo wrote:*   

>  *OtonVM wrote:*   No, I can't ping 192.0.0.11 
> 
> Set the IPs to 192.168.1.10 and 11 and try again.
> 
> M.

 

Ok, that's what I did (finally found some time...):

First I changed all ips and tested the settings in win and that's what ipconfig /all gives me:

```

Windows IP Configuration

Host Name . . . . . . . . . . . . : upstairs (aka. gentoo in linux)

Primary Dns Suffix  . . . . . . . :

Node Type . . . . . . . . . . . . : Unknown

IP Routing Enabled. . . . . . . . : No

WINS Proxy Enabled. . . . . . . . : No

Ethernet adapter Local Area Connection:

Connection-specific DNS Suffix  . :

Description . . . . . . . . . . . : NVIDIA nForce Networking Controller

Physical Address. . . . . . . . . : 00-0F-EA-31-73-E2

DHCP Enabled. . . . . . . . . . . : No

IP Address. . . . . . . . . . . . : 192.168.1.11

Subnet Mask . . . . . . . . . . . : 255.255.255.0

Default Gateway . . . . . . . . . :

```

I got the numbers from the net-config script in sabayon livedvd... The seccond pc's IP is now 192.168.1.10.

In gentoo now:

```

/etc/hosts:

# IPv4 and IPv6 localhost aliases

127.0.0.1   gentoo.HOME   gentoo   localhost

192.168.1.11   gentoo.HOME   gentoo

192.168.1.10   work.HOME   work

/etc/conf.d/net:

dns_domain_lo="DOMA"

config_eth0=( "192.168.1.11 netmask 255.255.255.0" )

config_eth0=( "adsl" )

```

however ifconfig eth0 gives me:

```

eth0      Link encap:Ethernet  HWaddr 00:0F:EA:31:73:E2

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:1611 errors:0 dropped:0 overruns:0 frame:0

          TX packets:1172 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:979218 (956.2 Kb)  TX bytes:194380 (189.8 Kb)

          Interrupt:18 Base address:0x4000

```

and I can't ping niether of the ip's (not even myself), I can however ping gentoo wich acts as 127.0.0.1, but not work (that acts normally as 192.168.1.10).

When I do: ifconfig eth0 192.168.1.11 netmask 255.255.255.0 up, ifconfig gives me:

```

eth0      Link encap:Ethernet  HWaddr 00:0F:EA:31:73:E2

          inet addr:192.168.1.11  Bcast:192.168.1.255  Mask:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:1650 errors:0 dropped:0 overruns:0 frame:0

          TX packets:1196 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:982665 (959.6 Kb)  TX bytes:196012 (191.4 Kb)

          Interrupt:18 Base address:0x4000

```

and I can ping 192.168.1.11 and gentoo (myself), but ping 192.168.1.10 geves me the nice:

```

From 192.168.1.11 icmp_seq=1 Destination Host Unreachable

From 192.168.1.11 icmp_seq=1 Destination Host Unreachable

From 192.168.1.11 icmp_seq=1 Destination Host Unreachable

............. and so on,,,

```

I'm really lost here...  :Sad: 

----------

## OtonVM

>-Bump!-<

No ideas??

----------

## ShadowHawkBV

Of note, you may have mis-typed because your windows and gentoo box both have the same IP addy of 192.168.1.11.  That would cause the problem.  But if that is just a typo,

Can the windows box ping the gentoo box? 

If the windows box can ping the gentoo box, I'd suggest modifying your /etc/conf.d/net to the following:

```

config_eth0=( "192.168.1.10 netmask 255.255.255.0" )

config_ppp0=( "ppp" )

link_ppp0="eth0"

plugins_ppp0=( "pppoe" )

username_ppp0='<real_username>'

password_ppp0='<real_Password>'
```

Follow this by 

```

rc-update add net.eth0 default

rc
```

This should ensure that the the gentoo box is set to use the proper ip and sub-net, as well as be able to manually connect to the internet.

The config_eth0=( "adsl" ) has apparently gone derelict.  I was having a problem much like your own.  This set-up fixed that problem.  Still doesn't automatically connect, but one step at a time.

Best of luck.

----------

## OtonVM

Oh finnaly someone with an idea what to do! Thank you for that.

It's not mistyped, the windows IP is from the same pc that runs linux and has (or should have) the same configuration. It was just to proove that the network works...

So I did as you sugested. eth0 connects with the given IP (haven tested ping yet). The problem becomes pppoe, wich is simply ignored:

```

 * Caching service dependencies ...                                       [ ok ]

 * Unmounting network filesystems ...                                     [ ok ]

 * Stopping firewall ...                                                  [ ok ]

 * Stopping eth0

 *   Bringing down eth0

 *     Shutting down eth0 ...                                             [ ok ]

 *     Stopping ADSL for eth0                                             [ ok ]

 * Starting eth0

 *   Bringing up eth0

 *     192.168.1.11                                                       [ ok ]

 * Mounting network filesystems ...                                       [ ok ]

 * Starting firewall ...                                                  [ ok ]

```

and I have no internet. In fact, the ppp0 device does not exist. If I comment the eth0 line and leave the ppp ones I get this:

```

 * Starting eth0

 *   Configuration not set for eth0 - assuming DHCP

 *   Bringing up eth0

 *     dhcp

 *       Running dhclient ...                                             [ !! ]

```

Is this the only thing you did? I'll now try creating a new net.ppp0 script to add at startup with only adsl in it. I'll post back. Anyway, thanks for the idea.

----------

## OtonVM

Uff, this is really booooring...  :Mad: 

I created /etc/init.d/net.ppp0.

Now if I start net.eth0, I get the 192.168.1.11 ip on eth0 and even avahi understands this as local network and this is a first. When I start net.ppp0, it creates a pppoe connection to the internet with local and remote ips (dynamic anyway). It sounds good, doesn't it? Well, it's not.

I can't nither see 192.168.1.10 (or ping it) nor can I ping anything else (google.com). First I thought it could be the firewall so I stopped&cleared shorewall... It didn't help. Then before I could connect back to the net I had to remove net.ppp0 and reconfigure pppoe-setup, then reboot. Even now I have both ppp0 and ppp1 for some reason...

/var/log/messages:

```
Oct  1 11:35:52 gentoo pppd[1358]: Plugin passwordfd.so loaded.

Oct  1 11:35:52 gentoo pppd[1358]: Plugin rp-pppoe.so loaded.

Oct  1 11:35:52 gentoo pppd[1358]: RP-PPPoE plugin version 3.3 compiled against pppd 2.4.4

Oct  1 11:35:52 gentoo pppd[11717]: pppd 2.4.4 started by root, uid 0

Oct  1 11:35:52 gentoo pppd[11717]: PPP session is 3634

Oct  1 11:35:52 gentoo pppd[11717]: Using interface ppp0

Oct  1 11:35:52 gentoo pppd[11717]: Connect: ppp0 <--> eth0

Oct  1 11:35:52 gentoo pppd[11717]: CHAP authentication succeeded

Oct  1 11:35:52 gentoo pppd[11717]: CHAP authentication succeeded

Oct  1 11:35:52 gentoo pppd[11717]: peer from calling number 00:90:1A:40:90:A7 authorized

Oct  1 11:35:53 gentoo pppd[11717]: local  IP address 193.77.241.217

Oct  1 11:35:53 gentoo pppd[11717]: remote IP address 213.250.19.90 (ip's are dynamic so I don't care...)

```

this seems to work, but I have no connection to the net...

and:

```
Oct  1 11:00:59 gentoo avahi-daemon[7080]: New relevant interface eth0.IPv4 for mDNS.

Oct  1 11:00:59 gentoo avahi-daemon[7080]: Joining mDNS multicast group on interface eth0.IPv4 with address 192.168.1.11.

Oct  1 11:00:59 gentoo avahi-daemon[7080]: Registering new address record for 192.168.1.11 on eth0.

Oct  1 11:03:24 gentoo avahi-daemon[7080]: Withdrawing address record for 192.168.1.11 on eth0.

Oct  1 11:03:24 gentoo avahi-daemon[7080]: Leaving mDNS multicast group on interface eth0.IPv4 with address 192.168.1.11.

Oct  1 11:03:24 gentoo avahi-daemon[7080]: IP_DROP_MEMBERSHIP failed: No such device

Oct  1 11:03:24 gentoo avahi-daemon[7080]: iface.c: interface_mdns_mcast_join() called but no local address available.

Oct  1 11:03:24 gentoo avahi-daemon[7080]: Interface eth0.IPv4 no longer relevant for mDNS.

```

for eth0 from avahi... now that I look at it... there are some errors... No idea about what to do... kernel?

----------

## ShadowHawkBV

I also ran into the pppoe connecting to the internet, but not allowing any pings etc.  If memory serves (It's been a week or so), I had to 

```

pppoe-stop

ifconfig ppp0 down

ifconfig eth0 down

ifconfig eth0 192.168.1.11 broadcast 192.168.1.255  Mask:255.255.255.0 up

pppoe-start

```

To be honest, I'm not sure why that worked, only that it did.  This was at the end of almost a week of fighting with that particular problem. (interspersed with ISP problems) You can also try commenting out all the pppo parts of the /etc/conf.d/net and getting the local net running 100%.  Then run the pppoe-setup, add the parts to the /etc/conf.d/net.  Barring this working, I'm pretty much out of ideas.  (My main box is packed, so I'm a tad limited with the laptop for experimenting)

----------

## OtonVM

Oh cool. At least part of it is solved and some progress is done.

Now I have a network and if I do pppoe-start manually I can connect to the net (as this post prooves it...). If I start net.eth0, than ppp0 lines are ignored. So I created again net.ppp0, but it doesn't start:

```

Oct  1 21:33:57 gentoo pppd[14800]: pppd 2.4.4 started by root, uid 0

Oct  1 21:33:57 gentoo pppd[14800]: Using interface ppp0

Oct  1 21:33:57 gentoo pppd[14800]: Connect: ppp0 <--> /dev/pts/2

Oct  1 21:33:57 gentoo pppoe[6419]: Interface ppp0 is not Ethernet

Oct  1 21:33:57 gentoo pppd[14800]: Modem hangup

Oct  1 21:33:57 gentoo pppd[14800]: Connection terminated.

Oct  1 21:33:57 gentoo pppd[14800]: Exit.

with:

 * Caching service dependencies ...                                                                                                  [ ok ] 

 * Starting ppp0

 *   Bringing up ppp0

 *     adsl

 *       Starting ADSL for ppp0

```

where before when ppp0 was beeing started pppd was called for the connection and adsl as a plugin.

Any fast ideas here? Or I'll make another thread only for that.

Anyway, you have been very helpfull, thank you!

----------

## OtonVM

Ok I have it:

/etc/conf.d/net:

```
config_eth0=( "192.168.1.11 netmask 255.255.255.0" )

config_ppp0=( "ppp" )

link_ppp0="eth0"

plugins_ppp0=( "pppoe" )

pppd_ppp0=( "updetach defaultroute usepeerdns" ) --- these are mine, check yours in net.example

username_ppp0='user'

password_ppp0='pass'

```

than ln -s /etc/conf.d/net.lo /etc/conf.d/net.ppp0 and that to default with rc-update.

I'll reboot now but I think it will work.

Thanks again for the help!

----------

