Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Location: Slovakia, currently working in Liverpool UK
Distribution: Gentoo 2006.0
Posts: 97
Rep:
smb4k + 2 networks problem
hi,
i've recently installed samba to connect to my friends wintendo box. we are connected via ethernet cable with adresses 192.168.0.x and 192.168.0.y.
we also have an internet connection via wireless router with adresses 192.168.1.x and 192.168.1.y.
i'd like to use smb4k to browse local network, because i like it, but here lies the problem.
whenever smb4k searches for new computers, it finds my friends box, but only through router adress. this makes file transfer incredibly slow. if i type lan adress into search bar it finds it but that's all. i can ping my friend, and he can connect to my box no problem.
so how can i tell smb4k to scan only 192.168.0.x adresses? i played with config files by myself, which resulted in re-emerging of samba :-( so now i'm seeking some proffesional advice;-)
i can connect to my friend in konqueror via samba io slave (smb://) and copy data ~2-3mb/s (which is slow, but hey, it's samba). so problem is in smb4k config, but i can't seem to find the relevant settings.
This sounds much more like a routing issue and a problem with smb4k. Open a konsole and run the command 'netstat -r' without the quotes. Look for an entry for the 192.168.0.x sub-net. I suspect you will need to add one.
Location: Slovakia, currently working in Liverpool UK
Distribution: Gentoo 2006.0
Posts: 97
Original Poster
Rep:
Quote:
Originally Posted by camorri
This sounds much more like a routing issue and a problem with smb4k. Open a konsole and run the command 'netstat -r' without the quotes. Look for an entry for the 192.168.0.x sub-net. I suspect you will need to add one.
Code:
sammael@high-flyer ~ $ netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 wlan0
loopback * 255.0.0.0 U 0 0 0 lo
default dsldevice.lan 0.0.0.0 UG 0 0 0 wlan0
i don't see route for 192.168.0.x interface, how do i add it?
To add a route, you use the 'route add' command. Here is an example.
Quote:
route add -net 192.56.76.0 netmask 255.255.255.0 dev eth0
You will have to edit the example and change the network, the mask should be correct for a class c network. Also will have do determine if the wired connection is eth0 or eth1 or what ever.
Use teh netstat -r to dump the routing table after you add the route, and try pinging the other machines on that sub-net. Once you have the pinging working, try smb4k again. I think it will work once the pinging works.
Location: Slovakia, currently working in Liverpool UK
Distribution: Gentoo 2006.0
Posts: 97
Original Poster
Rep:
well, after that, my routing table looks like this:
Code:
sammael@high-flyer ~ $ netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 wlan0
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
loopback * 255.0.0.0 U 0 0 0 lo
default dsldevice.lan 0.0.0.0 UG 0 0 0 wlan0
i can ping 192.168.0.x and 192.168.1.x subnets, but smb4k still finds the other computer through wrong way: screenshot
and i found another interesting thing. if i check in smb4k configuration "Try to bind to port 137 to receive UDP datagrams", smb4k seems unable to find any adress, but after searching for an IP i know is on the subnet, it finds it, then i can click on add button and suddenly i see whole subnet...
I wished I could. I have only used smb4k a little, an I have only a single lan connection for my machines. I think we have fixed one issue, the routing table. The windows protocol used I don't understand very well. I hope someone else can give you some direction on making it work better.
Location: Slovakia, currently working in Liverpool UK
Distribution: Gentoo 2006.0
Posts: 97
Original Poster
Rep:
hey, i restarted samba & net.eth0 and it works exactly as i wanted. thanks a bunch.
one more question: are the changes to routing table permanent or only until restart? and how do i add route for eth0 with dhcp... because sometimes i am connected to net via eth0...
one more question: are the changes to routing table permanent or only until restart?
As far as I know, they are permenant, at leat until you do a route del. The changes are saved in a file /proc/net/route. This is a read only file, so I think the only way you should add routes is through the command line, or some front end designed to run the command, ( possibly WebMin ).
Quote:
and how do i add route for eth0 with dhcp... because sometimes i am connected to net via eth0...
Route add adds a route to your linuxs kernel routing table. What this does is give the kernel some options on where to forward various IP packets. A static route add ( which this is ), isn't for a particular network connection. Before we added the route, the only option the kernel had was to forward the packet to the 'default'. We simply gave it more knowledge about one more physical connection, so the packets got sent to that net. Your router is connected and belongs to your 192.168.1.x net, it can not route to your 192.168.0.x net.
There are many commercial routers with many more interfaces. If you had another interface, you could have plugged the 192.168.0.x lan in, and the router could then do the routing. BTW an interface is not just a lan connection, it has its own IP address. Most home routers have only two interfaces, one for the ISP side and one for the home lan side.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.