LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-29-2004, 10:38 AM   #1
hello321_1999
Member
 
Registered: Nov 2004
Posts: 33

Rep: Reputation: 15
How does the IP address affect nslookup?


The following 3 machines exist in my LAN:

- Both DNS and DHCP for my LAN are served from the same UNIX server: 10.108.11.224 (\\NetworkServer).

- I have a Linux machine inside this LAN. It has a static IP address: 10.108.11.133 (\\LinuxMachine).

- I have a NT computer also in this LAN: 10.108.8.162 (\\TestMachine)

On LinuxMachine, I type:
> nslookup TestMachine
The DNS server successully finds the IP of \\TestMachine and returns 10.108.8.162.

Now, I change the IP address of \\LinuxMachine from 10.108.11.133 to 10.108.15.133. I also make the necessary changes in the DNS server to reflect this change.

I execute the same nslookup command again, but now get this response:
> nslookup TestMachine
;; connection timed out; no servers could be reached

Does anyone know why my Linux machine can no longer reach the DNS server because I changed the 3rd part of the IP address?
 
Old 11-29-2004, 10:55 AM   #2
sigsegv
Senior Member
 
Registered: Nov 2004
Location: Third rock from the Sun
Distribution: NetBSD-2, FreeBSD-5.4, OpenBSD-3.[67], RHEL[34], OSX 10.4.1
Posts: 1,197

Rep: Reputation: 47
What do you have your netmask set to?
 
Old 11-29-2004, 11:00 AM   #3
hello321_1999
Member
 
Registered: Nov 2004
Posts: 33

Original Poster
Rep: Reputation: 15
Netmask is set to 255.255.252.0 on all machines.
 
Old 11-30-2004, 06:10 AM   #4
kees-jan
Member
 
Registered: Sep 2004
Distribution: Debian, Ubuntu, BeatrIX, OpenWRT
Posts: 273

Rep: Reputation: 30
That pretty much explains it.

The netmask defines which ips are on the same subnet. I.e subnet is ip & netmask (that's a bit-wise and). After changing the ip-addres, the linuxmachine belongs to a different subnet (even though it is still connected to the same cable.

If you want to connect to a machine that's not on your subnet (such as the dns server), then you have to go through a gateway.

So there are a few things you can do about this
  • Configure a gateway and define a routing table on each machine, pointing to the gateway
  • Modify the netmask on all machines, such that the linuxmachine is on the same subnet as the others. For example, 255.255.0.0 will do
  • Choose for the linuxmachine an ip that is in the subnet of the others, for example with a third part of 12 or 13 or 10

Groetjes,

Kees-Jan
 
Old 11-30-2004, 09:03 AM   #5
hello321_1999
Member
 
Registered: Nov 2004
Posts: 33

Original Poster
Rep: Reputation: 15
Thanks very much for that.
I cannot do option 2 as my LAN has approximately 30-40 computers, so changing the netmask would require alot of effort and involves risk.
I cannot do option 3 as I ultimately want to move this LinuxMachine into the DMZ, which is defined as a subnet of 10.108.15.x

This leaves option 1 (Configure a gateway and define a routing table on each machine, pointing to the gateway)

Can you give me a little more detail about how I do this;
1. I can set a default gateway using Yast2, but what gateway do I use?
2. Do I need to purchase any new hardware (for the gateway) to make this work?
3. From where do I define a routing table in Linux (I'm using SuSE Linux Enterprise Server)

Thanks very much for your help with this.
 
Old 11-30-2004, 09:40 AM   #6
kees-jan
Member
 
Registered: Sep 2004
Distribution: Debian, Ubuntu, BeatrIX, OpenWRT
Posts: 273

Rep: Reputation: 30
Disclaimer: Everything below is based solely on my understanding of networks. I've never actually tried this

You have (at least) two subnets: 10.108.8.0 and 10.108.12.0 (obtained by computing ip & netmask), and possibly an internet connection.

A gateway is a machine connecting two or more networks. It can be one of the computers you already have, or a dedicated device.

If you have an internet connection, the first thing to decide is whether you want two gateways (one connecting the two subnets and one connecting one of the subnets to the internet) or one (connecting everything together)

In the scenario of having one gateway, all you should need to do is modifying its netmask such that it includes both networks (i.e. 255.255.0.0). At this point, you should be able to contact all machines (i.e. ping them) from the gateway. Also, all machines should be able to reach the gateway.

Since all machines in your network are already configured to send non-local traffic to the gateway, that should basically be it.

If you choose to have two gateways, then configuring the gateway is essentially the same. Next, you should tell the gateways how to find eachother, such that traffic can be routed between them. Modifying routing tables depends on OS and/or distribution. I don't have a SuSE machine handy, so all I can do is refer to the documentation.

Groetjes,

Kees-Jan
 
Old 11-30-2004, 11:55 AM   #7
sigsegv
Senior Member
 
Registered: Nov 2004
Location: Third rock from the Sun
Distribution: NetBSD-2, FreeBSD-5.4, OpenBSD-3.[67], RHEL[34], OSX 10.4.1
Posts: 1,197

Rep: Reputation: 47
Quote:
Originally posted by hello321_1999
Netmask is set to 255.255.252.0 on all machines.
As kees-jan points out, this is your problem.

This is by no means a VLSM or CIDR tutorial, but ... 255.255.252.0 gives you 14 bits for subnets and 10 bits for hosts, or 1022 hosts on 16382 networks ... anyway, all your machines live on 10.108.0.0/22. So, on your network, you have the following subnets:

Code:
           first        second        third         forth
subnet: 10.108.0.0    10.108.4.0    10.108.8.0   10.108.12.0   ... etc
\\TestMachine @ 10.108.8.162 is in the third subnet
\\NetworkServer @ 10.108.11.224 is in the third subnet
\\LinuxMachine @ 10.108.11.133 is also in the third subnet

When you move \\LinuxMachine to 10.108.15.133 however, you've moved it on to the forth subnet, and therefore, your netmask is incorrect. You either need a router to join the two networks, fix your subnet mask, or use a different IP for LinuxMachine. With 30 computers, you can fit about 30 times that many on the 10.108.8.0/22 network

kees-jan -- Not saying you were wrong on anything (quite the opposite ), I was just elaborating

Last edited by sigsegv; 11-30-2004 at 11:56 AM.
 
Old 11-30-2004, 04:21 PM   #8
kees-jan
Member
 
Registered: Sep 2004
Distribution: Debian, Ubuntu, BeatrIX, OpenWRT
Posts: 273

Rep: Reputation: 30
No problem. I knew I probably needed more elaborating, but I didn't quite have all the facts handy, and I did have a lot of other work.

So many thanks to you

Groetjes,

Kees-Jan
 
  


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
Will re-install affect things? ginda SUSE / openSUSE 2 06-11-2005 04:02 AM
how to get ip address, broadcast address, mac address of a machine sumeshstar Programming 2 03-12-2005 04:33 AM
How does the compile affect performance claudiup Linux - Software 3 12-11-2004 12:21 PM
Does loadkeys affect X? Golovko Linux - General 1 07-30-2004 10:22 PM
Changes in resolution only affect root lasalsademuerte Slackware 0 11-21-2003 02:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:12 PM.

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