Linux - Networking This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
11-29-2004, 10:38 AM
|
#1
|
Member
Registered: Nov 2004
Posts: 33
Rep:
|
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?
|
|
|
11-29-2004, 10:55 AM
|
#2
|
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:
|
What do you have your netmask set to?
|
|
|
11-29-2004, 11:00 AM
|
#3
|
Member
Registered: Nov 2004
Posts: 33
Original Poster
Rep:
|
Netmask is set to 255.255.252.0 on all machines.
|
|
|
11-30-2004, 06:10 AM
|
#4
|
Member
Registered: Sep 2004
Distribution: Debian, Ubuntu, BeatrIX, OpenWRT
Posts: 273
Rep:
|
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
|
|
|
11-30-2004, 09:03 AM
|
#5
|
Member
Registered: Nov 2004
Posts: 33
Original Poster
Rep:
|
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.
|
|
|
11-30-2004, 09:40 AM
|
#6
|
Member
Registered: Sep 2004
Distribution: Debian, Ubuntu, BeatrIX, OpenWRT
Posts: 273
Rep:
|
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
|
|
|
11-30-2004, 11:55 AM
|
#7
|
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:
|
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.
|
|
|
11-30-2004, 04:21 PM
|
#8
|
Member
Registered: Sep 2004
Distribution: Debian, Ubuntu, BeatrIX, OpenWRT
Posts: 273
Rep:
|
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
|
|
|
All times are GMT -5. The time now is 05:56 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|