LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-30-2005, 09:30 PM   #1
adds2one
Member
 
Registered: Aug 2005
Location: Vancouver, BC
Distribution: Ubuntu 6.06
Posts: 154

Rep: Reputation: 30
DHCP and Linux-WinXP network?


Is it possible for me to network my Slackbox with my WindowsXP laptop if both of them are using DHCP for their internet connections? They are both connected to a hub but I have had no luck going through the tutorials on Linux Questions or by reading the Samba man pages or by reading the Slackbook chapter on Samba. I'd like to try to ping the two computers but how can I do this if I don't know the IP address?

All the examples I have found seem to have static IP addresses. Could this be my problem. It seems so simple to set up in all the stuff I have read and yet I have been trying to get these machines to talk to one another for three days to no avail.

Any good links to tutorials or info would be much appreciated.
 
Old 11-30-2005, 09:56 PM   #2
rkelsen
Senior Member
 
Registered: Sep 2004
Distribution: slackware
Posts: 3,457
Blog Entries: 7

Rep: Reputation: 1786Reputation: 1786Reputation: 1786Reputation: 1786Reputation: 1786Reputation: 1786Reputation: 1786Reputation: 1786Reputation: 1786Reputation: 1786Reputation: 1786
Re: DHCP and Linux-WinXP network?

Quote:
Originally posted by adds2one
I'd like to try to ping the two computers but how can I do this if I don't know the IP address?
On Slack:

Open a console and su to root. Then run 'ifconfig'. This will tell you the IP address of the Slackbox.

In Windows:

Click Start -> Run and enter 'cmd' into the box and hit enter. Then run 'ipconfig'. This will tell you the IP address of the Windows box.

Then you should be able to ping to & fro.

If not, then maybe you need a switch in place of your hub.
 
Old 12-01-2005, 12:42 AM   #3
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086
If you want your machines to get an IP address through DHCP, there must of course be a DHCP server that serves IP addresses.. it looks as if your LAN does not have a DHCP server.
People with broadband connections that use a NAT router between their LAN and the internet (so that multiple computers may use the internet connection) usually have a DHCP server running on that router. If you have such a box between the hub and your cable/adsl modem, you should verify if the DHCP server has been activated in the router's configuration.

If you do not have a DHCP server on your network, you will have to use static IP addresses. Use the netconfig command on your Slackware box to setup an IP address and use the network applet in your XP computer's Control Panel to setup a static IP address there.

For this to work, the two IP addresses (Linux and XP) must be in the same IP network range. This is determined by the network mask. Without a DHCP server present, you will also have to configure the IP address for the default gateway (for Slackware, that is also done using the netconfig command) and you will have to enter one or more IP addresses for DNS servers if you want to surf the internet using names instead of IP numbers.

All in all, DHCP is a nice thing to have...

Eric
 
Old 12-01-2005, 05:09 AM   #4
maginotjr
Member
 
Registered: Aug 2004
Location: BR - Floripa
Distribution: Ubuntu 9.10 - 2.6.x.x
Posts: 661

Rep: Reputation: 34
if the ip in windows is 169.x.x.x them you have to set an IP and dont try ping this ip from your linux box because it will not work.
 
Old 12-01-2005, 10:31 AM   #5
adds2one
Member
 
Registered: Aug 2005
Location: Vancouver, BC
Distribution: Ubuntu 6.06
Posts: 154

Original Poster
Rep: Reputation: 30
I DO have DHCP through my ISP, it is how both of my systems connect to the internet. My confusion is that I thought that with DHCP my system would be assigned a different IP Address each time I start up. All the tutorials I have found for setting up networking are referencing static IP's. SO my question is still "can I network two PCs that are both using DHCP?"
 
Old 12-01-2005, 02:26 PM   #6
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086
If both PC's are assigned an IP address through the ISP's DHCP server, then they should be able to communicate with each other. After all, both are getting an IP address that you can use on the Internet, and so the two PC's should be able to find one another.

Now, DHCP-assigned IP addresses are dynamic in nature, but that does not mean that you get a different IP address each time you refresh the lease by powering up the PC or by explicitly renewing the lease using dhcpcd (in Linux) or ipconfig (in Windows XP).

A DHCP server that still has unused IP addresses in it's address pool will give your PC the same address it had received before, unless the PC explicitly asks for another address. Only when the DHCP server runs out of free IP addresses will it delete the lease for an address that is not actively used at that moment, so it can hand out that IP address to a new client that asks for an IP address.
ISPs will have more than enough IP addresses for the customers they serve, so normally you will not get a new IP address each day.

Another reason for losing your IP address to someone else is when you shut down your PC long enough that the lease on your IP address expires. When that heppens, the DHCP server will be able to re-use your IP address when a new dhcp client on the network asks for an address. Lease times can vary between hours and weeks, depending on the ISP and the plans it has with its network topology.

What does sometimes happen (at least with my ISP) is that an ISP grows so fast, that in certain areas the number of customers becomes bigger than the number of IP addresses in that particular network segment. The ISP will then have to re-shuffle the network address ranges that it owns, and then it may happen that one day your neighborhood will get IP addresses in a completely different IP range.

This all sums up to: the IP addresses assigned to your PC's will (most probably) not change each time your PC boots up.
I think it will make your life easier if you use a "Dynamic DNS" service such as for instance http://dyndns.org/ (DynDNS.org is not the only site that provides this service for free by the way) and register a host name for each of your PC's. That hostname will then always point to your computer's IP address, even if your PC eventually gets another IP address. You will have to install a DynDNS client on the computers to watch over the IP address. This DynDNS client will also update the hostname record at dyndns.org at regular intervals so that it will not be deleted because of inactivity.

If you do not want to use a DynDNS hostname, then you must find out your computers' IP addresses and use them in communication.

Eric
 
Old 12-01-2005, 02:41 PM   #7
tobyl
Member
 
Registered: Apr 2003
Location: uk
Distribution: slackware current
Posts: 767

Rep: Reputation: 62
Alien Bob said it all really, but I spent ages typing this before I saw his post, and it has a slightly different slant, so I'm going to post it anyway, hope you don't mind Bob:

Your isp will only offer you one IP address at a time (unless you pay for more that is) whether it be static or dynamically assigned to you.

So a typical configuration might be that your router will negotiate an IP address from your ISP, and hold it until you restart your router (or have it set to time out). Your router then serves IP addresses to the boxes on your network, again statically or via DHCP. These IP addresses will be in the same IP network subnet range, eg 192.168.1.2 and 192.168.1.3 (192.168.xxx.0 & 192.168.xxx.255 are reserved for special purposes). Even with DHCP in use, your boxes will normally get the same ip addresses issued to them, as the router will cache the previous assignments.

Ranges beginning with 192.168 (amongst others) are reserved for local networks. This range is set in the router config.The router will also have a gateway ip address in the same range, often it is the first available, 192.168.1.1 in this example. The boxes on your local network will connect to the gateway address to access the net, and the router manages the link between the gateway and the IP address your isp assigned to you. This way, your local network can be kept separate from the internet, and pass traffic which is restricted to your network only.

If you do not have a router that can serve ip addresses to your two boxes, (statically or via DHCP) then you cant really have a local network unless one box is served from the other, meaning the box first in line to the net must be on to allow the second to connect to the net (somewhat inconvenient). Should the first box be running XP, then it can be configured to use ICS (internet connection sharing) to pass on the internet connection to the other box.If the first box was linux, you would invoke ip_forward to the second box.

A hub can pass on ip addresses assigned by a router (either hardware or an OS on a box) but it is not smart enough to issue ip addresses on its own.


tobyl
 
Old 12-01-2005, 09:10 PM   #8
adds2one
Member
 
Registered: Aug 2005
Location: Vancouver, BC
Distribution: Ubuntu 6.06
Posts: 154

Original Poster
Rep: Reputation: 30
Thanks so much everyone for all the info.

Perhaps I cannot set up a home LAN without having one of my systems serve the other. But I'm still not positive. I will describe my setup in more detail:

I have a Linksys ADSL Ethernet Modem which feeds into a hub which both my Windows and Linux systems are connected to. Both are currently using DHCP to connect to the internet.

On the Windows system the IP address (from ipconfig) is 207.6.238.15 and on the Linux system (from ifconfig) the IP address is 207.6.248.104

I can ping and get a response when pinging from the Windows box to the Linux box, but nothing happens if I try to ping the Windows box from the Linux box(the cursor just sits there and does nothing)

It seems that my ISP's DHCP is giving me two unique IP address'.

So, even though I don't have a router, is it possible for me to get these two PC's to network and share files given that they do have seperate IP's?

Also, if I want to serve my Wndows laptop from my Slackbox do I need two NIC cards or can I do it through the hub?

Last edited by adds2one; 12-01-2005 at 09:18 PM.
 
Old 12-02-2005, 06:15 AM   #9
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086
Quote:
On the Windows system the IP address (from ipconfig) is 207.6.238.15 and on the Linux system (from ifconfig) the IP address is 207.6.248.104
It would be interesting to see more detail, because the netmask will determine whether the two IP addresses are in the same subnet. When they are, then network traffic from one to the other will never leave your home. If they are in separate IP subnets, then all traffic between the two computers will go via the default gateway. That gateway may be your ADSL router, or a router at your ISP's location (which would be bad for performance and security of course... you want to keep your traffic inside the house)

You could post the results of ifconfig -a (Linux) and ipconfig /all (Windows) here so that you can get answers about it.

Quote:
I can ping and get a response when pinging from the Windows box to the Linux box, but nothing happens if I try to ping the Windows box from the Linux box(the cursor just sits there and does nothing)
Maybe the Windows computer runs a "personal firewall" that blocks ping and possibly other network traffic as well. If that is the case, you will have to configure the firewall to see the IP addresses in your local network as "trusted".

Quote:
Also, if I want to serve my Wndows laptop from my Slackbox do I need two NIC cards or can I do it through the hub?
You just need one NIC, and configure Samba with a couple of shares that the Windows machine can access.

Eric
 
Old 12-03-2005, 01:41 AM   #10
adds2one
Member
 
Registered: Aug 2005
Location: Vancouver, BC
Distribution: Ubuntu 6.06
Posts: 154

Original Poster
Rep: Reputation: 30
Here are the results of ipconfig /all in windows xp:

Windows IP Configuration

Host Name . . . . . . . . . . . . : lappy
Primary Dns Suffix . . . . . . . :
Node Type . . . . . . . . . . . . : Unknown
IP Routing Enabled. . . . . . . . : No
WINS Proxy Enabled. . . . . . . . : No
DNS Suffix Search List. . . . . . : bc.hsia.telus.net

Ethernet adapter Local Area Connection:

Connection-specific DNS Suffix . : bc.hsia.telus.net
Description . . . . . . . . . . . : Broadcom 570x Gigabit Integrated
Con
troller
Physical Address. . . . . . . . . : 00-0D-56-72-CB-12
Dhcp Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
IP Address. . . . . . . . . . . . : 207.6.238.15
Subnet Mask . . . . . . . . . . . : 255.255.224.0
Default Gateway . . . . . . . . . : 207.6.224.254
DHCP Server . . . . . . . . . . . : 209.53.4.133
DNS Servers . . . . . . . . . . . : 154.11.128.59
154.11.128.187
209.53.4.150
209.53.4.130
Lease Obtained. . . . . . . . . . : Friday, December 02, 2005
9:12:57 AM

Lease Expires . . . . . . . . . . : Tuesday, December 06, 2005
9:12:57 A
M

Ethernet adapter Wireless Network Connection:

Media State . . . . . . . . . . . : Media disconnected
Description . . . . . . . . . . . : Dell TrueMobile 1300 WLAN
Mini-PCI C
ard
Physical Address. . . . . . . . . : 00-90-4B-19-5D-13


And here are the results of ifconfig -a in linux:

eth0 Link encap:Ethernet HWaddr 00:01:03:2E:24:70
inet addr:207.6.248.104 Bcast:207.6.255.255 Mask:255.255.224.0
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:55514 errors:0 dropped:0 overruns:0 frame:0
TX packets:35158 errors:0 dropped:0 overruns:0 carrier:0
collisions:52 txqueuelen:1000
RX bytes:6383255 (6.0 Mb) TX bytes:6249377 (5.9 Mb)
Interrupt:3 Base address:0xdc00

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:200 (200.0 b) TX bytes:200 (200.0 b)

Also I do have Norton Internet Security on my Windows machine so I will try to add my Slackbox IP to the allowed list for the firewall.

So what do you make of the IP info?
 
Old 12-03-2005, 05:15 AM   #11
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086
Both computers show similar information:
For both, the NETMASK = 255.255.224.0, which creates an IP subnet that can hold 8190 IP addresses that are all local to each other (i.e. they can communicate directly with each other and do not need to pass the data through the default gateway).
This ipcalc URL shows that nicely: http://jodies.de/ipcalc?host=207.6.2...5.224.0&mask2=

So, conclusion is that your computers will talk to each other and their network traffic will stay inside your house.
The fact that Windows cannot be pinged must be due to your Norton Internet Security firewall.

Get an account at http://www.dyndns.org/ and create host names for your computers, install a dyndns client on both PC's and start using hostnames (for instance adds2one.dyndns.org) instead of IP addresses to talk to the other computers.

Eric
 
Old 12-04-2005, 11:55 PM   #12
adds2one
Member
 
Registered: Aug 2005
Location: Vancouver, BC
Distribution: Ubuntu 6.06
Posts: 154

Original Poster
Rep: Reputation: 30
I added the IP for my Slackbox to the safe addresses in Norton and now I can not only ping but also see each computer from the other! I can see the Windows laptop from KDE in Remote Places->Samba Shares->Home and I can see my Slackbox in Windows under My Network Places->Entire Network->Microsoft Windows Network->Home.

I am almost there but not quite.

When I try to access the files on my WIndows Laptop from KDE I get asked for a username and password but none of my usernames or passwords seem to work. Any idea what username and password would be needed for this? Would it be something set on the Windows machine or in Linux?

When I go onto my Linux box from my laptop I see a folder that says Printers and Faxes but no folders or files. How do I add access to files and folders on my Linux box?

Thanks so much for all your time and for getting me this far.

I also registered two DNS names from dyndns.org and will set about setting those up shortly. Anyone reccomend a particular dyndns client for windows and one for linux. There seems to be quite a few choices.
 
Old 12-05-2005, 02:52 AM   #13
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086Reputation: 8086
Quote:
Originally Posted by adds2one
When I try to access the files on my WIndows Laptop from KDE I get asked for a username and password but none of my usernames or passwords seem to work. Any idea what username and password would be needed for this? Would it be something set on the Windows machine or in Linux?
This is because you have not setup filesharing on your Windows box (yet) - you can create a share in WIndows that does not require a user/password when you access it over the network.

Quote:
When I go onto my Linux box from my laptop I see a folder that says Printers and Faxes but no folders or files. How do I add access to files and folders on my Linux box?
You will need to create Samba shares.

Eric
 
Old 12-05-2005, 09:46 PM   #14
adds2one
Member
 
Registered: Aug 2005
Location: Vancouver, BC
Distribution: Ubuntu 6.06
Posts: 154

Original Poster
Rep: Reputation: 30
whoo hoo!! I've got it all working! Thanks alien bob!

I can now ping using the DSN names, www.lapy.homeip.net and www.boxy.homeip.net but I am currently not making use of them. I know that I use them instead of the IP address's asigned by DHCP but I don't know where to put them.
 
Old 12-06-2005, 10:07 AM   #15
adds2one
Member
 
Registered: Aug 2005
Location: Vancouver, BC
Distribution: Ubuntu 6.06
Posts: 154

Original Poster
Rep: Reputation: 30
And now I am running into the problem that my ip is changing each time I reboot so that I have to reconfigure the firewall each time I start up. How do I make use of the DNS names?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
simplest possible network, linux and winxp can't ping each other frankie_DJ Linux - Networking 1 07-23-2005 06:58 AM
Adding a WinXP printer on network to Linux MI3GTO Linux - Newbie 7 01-01-2005 07:49 AM
WinXP network can't see Linux box jillyt Linux - Networking 3 12-28-2003 04:54 PM
want to have Linux server for WinXP network Avatar Linux - Newbie 2 07-21-2003 05:17 PM
Samba: Linux Not establishing itself on network, WinXP cannot see Linux either shassouneh Linux - Networking 5 07-27-2002 06:28 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration