|
-
Jan 30th, 2009, 11:44 AM
#1
Thread Starter
Frenzied Member
Assigning IP addresses
Lots of network questions just now, thanks for all the help, sometimes you can get a clearer answer over a forum.
Say you have a LAN with 2 PC's connected to a router.
So do you always need to manually assign each PC an IP address and subnet mask, i thought this is what DCHP does ?
Even if DCHP does do that, is there always a set IP for PC number 1 on a network(and how do you even tell what PC 1 is), if you do assign an IP it's something like 192.168.1.1 then the next PC would be 192.168.1.2(??), is this always the case why do i see IP's like 10.0.0.1 as LAN IP's
Or do you have a good guide to point me to for this?
Last edited by Jmacp; Jan 30th, 2009 at 11:51 AM.
-
Feb 1st, 2009, 12:29 PM
#2
Re: Assigning IP addresses
LANs behind a router often use private network numbers and rely on NAT for Internet access.
Normally a residential router contains an embedded DHCP server and this is how clients get IP addresses, though most routers allow static IP assignments as well. Such routers' DHCP services commonly try to maintain a MAC to IP mapping over time, so the IP addresses seldom change.
If you use Windows machines you can assign them to a common Workgroup, which allows you to do lookups by Hostname in your programs instead of screwing around with explicit IP addresses. If you have a machine named "Fred" running a Web server you can just get to it using:
http://Fred/ The Workgroup machines will perform name resolution via NetBIOS, so you won't need a private WINS or DNS server.
-
Feb 2nd, 2009, 07:29 PM
#3
Re: Assigning IP addresses
 Originally Posted by Jmacp
Say you have a LAN with 2 PC's connected to a router.
So do you always need to manually assign each PC an IP address and subnet mask, i thought this is what DCHP does ?
You are correct that is what DHCP is for. If you are using DHCP then you should avoid setting manual IP addresses. Apart from the lack of manageability, you may also find that you end up with duplicate IP addresses on the network (which causes lots of problems) because DHCP is unaware of the static (manual) IP addresses you have assigned so it may attempt to assign another computer an address you have already assigned via static IP.
Even if DCHP does do that, is there always a set IP for PC number 1 on a network(and how do you even tell what PC 1 is), if you do assign an IP it's something like 192.168.1.1 then the next PC would be 192.168.1.2(??)
No there is no set IP for any network device on your network unless you have manually told your DHCP server to assign the same IP to the same machine all the time (this is known as a DHCP reservation). Having said that, when DHCP dishes out IPs it does tend to be in order, so if you connect 5 PCs to your network at the same time then the likelyhood is that they will all get IPs that are one digit different from each other.
why do i see IP's like 10.0.0.1 as LAN IP's
An internal (aka LAN) IP can be a variety of things, depending on its subnet mask. Common internal subnets are 192.168.X.X and 10.X.X.X. As each segment in an IP address can contain any number between 1 and 254 then you can see that an IP address of 192.168.10.X would give you 254 available IP addresses, where as an IP address of 10.X.X.X gives you... well a hell of a lot, so larger business networks etc tend to go for these larger ranged subnets.
The subnet mask is what tells your computer which part of the IP address is used for the entire network and which is a number that can differ between different devices on the network.
In a common subnet such as 192.168.10.X the subnet mask will be 255.255.255.0. This means that the first 3 sections of the IP address, 192.168.10 in this case, are used for network identification so your computer knows that only the last section is going to vary between machines.
Hope that helps
-
Feb 3rd, 2009, 08:53 AM
#4
Re: Assigning IP addresses
look at your router and you should find a place where dhcp is set up. if you have other questions ask.
-
Feb 3rd, 2009, 12:11 PM
#5
Thread Starter
Frenzied Member
Re: Assigning IP addresses
I am getting home routers mixed up with cisco routers, i now see that cisco routers (unless they are switches + routers) don't directly connect to pc's rather they connect to switches or hubs and the s's or h's connect to the pc's. Whereas a home router really is a switch + router + modem....well the ones i have used anyway...?
I still don't actually see the purpose of a router, i know they work with ip's as oppsed to switches working with mac addresses and a few other differences between switches and routers but why not just make switches work with ip's and save having to make two pieces of hardware....?
So let me see, you have an incoming WAN connection coming into say a home LAN with 5 PC's on that LAN and the connection is ultimately tryiny to connect to say PC 3 on the LAN(can it even do that). So the incoming connection finds the LAN's router that's connected to the net from this routers internet IP(not it's LAN ip obvioulsy).... This LAN router then passes these packets to the switch. The switch then converts PC 3 internet IP into a mac address and forwards these packets onto PC 3. There are mistakes in this but getting closer....??
-
Feb 3rd, 2009, 12:46 PM
#6
Re: Assigning IP addresses
Yeah getting closer yes enterprise level routers like Cisco routers do not usually just connect straight to a PC. They are usually used as the bridge between two networks or a network and the internet.
And yes home routers do usually have modem's built in and they often have 4/8 port switches in them too for your home PCs to connect to. Having said that, enterprise level routers must also have a sort of switch in them. Without the switch part there would be nothing for the internet lines or other switches/hubs to connect to. Also, aside from the physical ports, the 'switch' part is what allows packets to be passed between the 2 (or more) networks that connect to the router.
As for the difference between a switch and a router, a switch just passes data from one port to another where as a router can be configured to do the same thing but based on specific conditions being met.
So for example, a router could be configured to forward any packets that have a destination subnet of 192.168.10.X to a specific port/interface (this port could have a line connected to it that linked to an external site such as a remote office or a factory network etc). So if you were using a PC that was sat on a network that had a subnet of 192.168.50.X and you tried to connect to something on the 192.168.10.X range the router would see that packet and pass it down the relevant line so that it ended up at the correct destination. A switch would not be able to do this... although you can get some managed switches now that can do quite a lot but I've not played with them enough to see exactly what they can and cant do.
I still don't actually see the purpose of a router, i know they work with ip's as oppsed to switches working with mac addresses and a few other differences between switches and routers but why not just make switches work with ip's and save having to make two pieces of hardware....?
Well you could just stick a router in the place of every switch on a network... but why over complicate things? The easiest way to look at this is to forget home networks because these things were all primarily designed for business use. So in a business network where you have say 100 computers and 3 servers. All of the PCs need to be able to communicate with the servers and vice versa, so just connecting everything to a switch (granted it would be more than one switch) allows that to happen with pretty much 0 configuration. You just plug them all in and the switch happily passes data around between the machines. That works fine, so why replace it with a router that can do more complex things when you wont be using any of those complex features?
Basically switches are just for mass connection and routers are for granular control over what traffic goes where.
That help clear things up at all?
EDIT: have a look around on the web too to get more info. Here's a straight forward breakdown of the differences between a router and a switch I just found on google: http://compnetworking.about.com/od/h...ervsswitch.htm
Last edited by chris128; Feb 3rd, 2009 at 12:51 PM.
-
Feb 3rd, 2009, 01:11 PM
#7
Re: Assigning IP addresses
a switch is a layer 2 device. this means that it operates on physical layer addresses.
a router is a layer 3 device. it operates on layer 3 addresses. it is used to separate networks.
a router maintains a list per interface that has layer 3 and matching layer 2 addresses.
when your pc sends an ip packet, the packet contains 4 pieces of information.
your layer 3 address
your layer 2 address
destination layer 3 address
destination layer 2 address
arp uses broadcast to find layer 2 addresses.
for packets that are going to a different network, the destination layer 2 address will have the mac address of the default gateway.
-
Feb 3rd, 2009, 01:24 PM
#8
Re: Assigning IP addresses
 Originally Posted by dbasnett
when your pc sends an ip packet, the packet contains 4 pieces of information.
your layer 3 address
your layer 2 address
destination layer 3 address
destination layer 2 address
What about the actual data thats being sent in the packet
-
Feb 3rd, 2009, 01:29 PM
#9
Thread Starter
Frenzied Member
Re: Assigning IP addresses
Very good info guys helped a lot, although i actually just clicked what a router was doing right after i posted, it's communicating between different subnets(just like you said) switches don't have this ability.
So i now need to learn the maths behind ip addressing which i have started on, router cli config commands and the OSI model which i have also started on.
-
Feb 3rd, 2009, 01:34 PM
#10
Re: Assigning IP addresses
lol good luck! You'll be teaching me soon
-
Feb 3rd, 2009, 01:43 PM
#11
Thread Starter
Frenzied Member
Re: Assigning IP addresses
I just realised something, i always thought that an ISP would have loads and loads of hardware which probably isn't actually the case, you could probably be an ISP if you leased a T1 line with only several routers/firewalls etc.. and operate it from your own house!
-
Feb 3rd, 2009, 05:22 PM
#12
Re: Assigning IP addresses
look at my signature... IP / Subnet
when i did large networks we always joked that the users (and their data) were just a test load for the network.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|