FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora User

 
 
LinkBack Thread Tools
 
Old 06-16-2011, 04:46 PM
Tim
 
Default Two elementary questions on LANs

On Thu, 2011-06-16 at 16:27 +0200, Timothy Murphy wrote:
> It's as though there is a lease somewhere
> and I have to wait for it to expire.

That's when you use commands like "dhclient -r" to try and get your
client to release its current lease.

In the absence of being told to use some specific IP, a client will
generally ask to use the same IP as it used last time. Removing DHCP
data on the client may stop this, causing the client to just as for an
IP, not a specific one. And removing DHCP data on the server may cause
it to assign a different IP, so long as the server is randomly doling
out IPs. But if it has a fixed set of rules, than the server will try
to give it the same IP.

I don't know about Linux clients, but other personal computers were
known to try requesting their prior IP, and if not assigned anything
else may actually just go ahead and use it. Though, that's a very old
behaviour. These days, it's more common for a client to assign itself a
random IP, in a completely different range, if it doesn't get given one
by a server.

It's a long time since I fiddled with DHCP servers, trying to
deliberately change addresses. But I remember doing things like:

Getting the client to release its IP.
Stopping its network.
Stopping the DHCP server, changing its configuration, deleting data from
its lease file, then restarting the server.
Bringing up the client's network, and letting it request an IP.

As I said, the client may still get the same IP. It depends on the DHCP
server configuration. It may simply dole out the same IP because those
particular numbers were the next set that would be given out.

--
[tim@localhost ~]$ uname -r
2.6.27.25-78.2.56.fc9.i686

Don't send private replies to my address, the mailbox is ignored. I
read messages from the public lists.



--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 06-16-2011, 04:56 PM
Tim
 
Default Two elementary questions on LANs

On Thu, 2011-06-16 at 13:00 +0200, Timothy Murphy wrote:
> Who decides the IP address of a device?

The DCHP server. And if it considers that 192.168.1 and 192.168.2 are
the same network, because its netmask puts the boundary at 192.168, you
may have lots of fun and games.

> 2) I also had a problem with the default gateway,
> but this is more a matter of understanding an elementary networking issue.
> I guess what I need is a short primer on networking for simpletons.
> Is there anything along those lines online?

Have you searched the Linux documentation project website?

> Suppose machine A has default gateway machine B,
> and suppose machine B has default gateway machine C.
> Now suppose that on machine A I ping, or ssh to, an address not on the LAN.
> Shouldn't this go to machine B, and then automatically get forwarded to C?

Theoretically, yes. So long as the netmask and IP address combinations
show that the address is foreign. And so long as IP forwarding is
enabled on all the machines the traffic goes *through* (IP forwarding is
not enabled on the client behind all the gateways).

> Concretely,
> my laptop 192.168.2.7 has default gateway 192.168.2.2 (a desktop)
> and the desktop has default gateway 192.168.1.254 (my ADSL modem/router).
> It seems to me that if I now ping www.google.co.uk (for example)
> this should go to the internet and be responded to by google.
> But it doesn't seem to be.

Try some other addresses. Perhaps google.co.uk doesn't respond to
pings. Or, what happens when you try pinging it while on the gateway
computer?

> Incidentally, someone (I guess NM) keeps emptying my /etc/resolv.conf .
> However, I fill it up each time.

Did you say how you set it?

If you're putting overrides into the NetworkManager configuration, then
I'd expect them to get entered into the resolv.conf file, when
NetworkManager brings the interface up.

If you're simply bodging them into the resolv.conf file, then I expect
them to be lost.

> Incidentally, I notice that my laptop, running Fedora-15,
> seems to behave slightly differently to my desktop, running CentOS-5.6 ,
> Changes to the routing table on the latter, eg changing the default gateway,
> do not seem to come into force until I re-boot.

How are you trying to bring about the gateway change? Are you bringing
its interface down and back up again, to force a configuration reload?

To be honest, my opinion about NetworkManager is thus: You'd only use
it on clients. All servers and gateways would have manually set network
configurations, and be using the old network service.

--
[tim@localhost ~]$ uname -r
2.6.27.25-78.2.56.fc9.i686

Don't send private replies to my address, the mailbox is ignored. I
read messages from the public lists.



--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 06-16-2011, 07:58 PM
jackson byers
 
Default Two elementary questions on LANs

I *seem to recall (many *years ago)having to access my linksys routerusing a web browser , to *192.168.2.1 in my case,and using Setup command.username,password * admin, admin.

maybe you have already done this?
HTHJack
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 06-16-2011, 08:03 PM
Timothy Murphy
 
Default Two elementary questions on LANs

Tim wrote:

> On Thu, 2011-06-16 at 16:27 +0200, Timothy Murphy wrote:
>> It's as though there is a lease somewhere
>> and I have to wait for it to expire.
>
> That's when you use commands like "dhclient -r" to try and get your
> client to release its current lease.
>
> In the absence of being told to use some specific IP, a client will
> generally ask to use the same IP as it used last time.

I'm sure that is true.
But where does the machine keep the old IP?
I couldn't find it anywhere.

> Removing DHCP
> data on the client may stop this, causing the client to just as for an
> IP, not a specific one. And removing DHCP data on the server may cause
> it to assign a different IP, so long as the server is randomly doling
> out IPs. But if it has a fixed set of rules, than the server will try
> to give it the same IP.

Actually, I have solved my problems now.
The basic problem was that as far as I can see dhcp or dhcpd
was not running properly, if at all, on my Linksys router
(running the original Linksys software).

When I started running dhcpd on my server instead
(and stopped it on the router),
everything started to work as I expected,
and my laptop got its correct address at last.


--
Timothy Murphy
e-mail: gayleard /at/ eircom.net
tel: +353-86-2336090, +353-1-2842366
s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 06-16-2011, 08:19 PM
Timothy Murphy
 
Default Two elementary questions on LANs

Tim wrote:

>> 2) I also had a problem with the default gateway,
>> but this is more a matter of understanding an elementary networking
>> issue. I guess what I need is a short primer on networking for
>> simpletons. Is there anything along those lines online?
>
> Have you searched the Linux documentation project website?

Thanks very much for your always useful responses.

I did look around a little.
The most helpful document I found was a discussion of
the "packet delivery process"
at <kristie.com/mark/ccna/ICND110S01L06.pdf>,

>> Suppose machine A has default gateway machine B,
>> and suppose machine B has default gateway machine C.
>> Now suppose that on machine A I ping, or ssh to, an address not on the
>> LAN. Shouldn't this go to machine B, and then automatically get forwarded
>> to C?
>
> Theoretically, yes. So long as the netmask and IP address combinations
> show that the address is foreign. And so long as IP forwarding is
> enabled on all the machines the traffic goes *through* (IP forwarding is
> not enabled on the client behind all the gateways).

I think I got this wrong too.
I am running shorewall on my server,
and I forgot to turn iptables off.

>> Incidentally, someone (I guess NM) keeps emptying my /etc/resolv.conf .
>> However, I fill it up each time.
>
> Did you say how you set it?

I see now I can go to Manage Connections in NM,
and specify the name servers.
Now NM seems to leave /etc/resolv.conf alone.
Previously I was just adding the nameservers by hand.

>> Incidentally, I notice that my laptop, running Fedora-15,
>> seems to behave slightly differently to my desktop, running CentOS-5.6 ,
>> Changes to the routing table on the latter, eg changing the default
>> gateway, do not seem to come into force until I re-boot.
>
> How are you trying to bring about the gateway change? Are you bringing
> its interface down and back up again, to force a configuration reload?

I was using "route delete default" and "route add default gw ...".
This seemed to be recognized at once on Fedora,
but not on CentOS.

> To be honest, my opinion about NetworkManager is thus: You'd only use
> it on clients. All servers and gateways would have manually set network
> configurations, and be using the old network service.

Thanks for the suggestion.
I see I am running NM on the server in question.
I'm never quite sure if we are allowed to use the network service.



--
Timothy Murphy
e-mail: gayleard /at/ eircom.net
tel: +353-86-2336090, +353-1-2842366
s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 06-16-2011, 08:53 PM
Ed Greshko
 
Default Two elementary questions on LANs

On 06/17/2011 04:03 AM, Timothy Murphy wrote:
> Tim wrote:
>
>> On Thu, 2011-06-16 at 16:27 +0200, Timothy Murphy wrote:
>>> It's as though there is a lease somewhere
>>> and I have to wait for it to expire.
>> That's when you use commands like "dhclient -r" to try and get your
>> client to release its current lease.
>>
>> In the absence of being told to use some specific IP, a client will
>> generally ask to use the same IP as it used last time.
> I'm sure that is true.
> But where does the machine keep the old IP?
> I couldn't find it anywhere.


That information is kept in the lease information and is why I've been
trying to elicit explicit information with explicit question.

The "old" IP information is actually kept by the CLIENT and the SERVER......

Let us take my system as an example....

My LAN interface is p2p1....

It has an ifcfg-p2p1 containing.... among other things, the following....

DEVICE="p2p1"
ONBOOT=yes
NM_CONTROLLED="yes"
TYPE=Ethernet
BOOTPROTO=dhcp
UUID=b92aa237-1b70-4a2b-9bbb-da15a3f0e599

Then in /var/lib/dhclient/ there is a file called
dhclient-b92aa237-1b70-4a2b-9bbb-da15a3f0e599-p2p1.lease

This file contains the information the dchcp server supplied when the
system "broadcast" a dhcp request. Among other things it contains....

renew 4 2011/06/16 21:07:47;
rebind 5 2011/06/17 08:11:13;
expire 5 2011/06/17 11:11:13;

It also contains the IP address that was assigned.

When the lease time expires the dhcp client will send a renewal request
to the server and ask for the same IP address to be assigned. I'd have
to check to see if it is a direct request or not. But it is 5AM and I
can't see the book I need to reference.

Now, I really want to know what interface you want to concentrate
on..... Is it your wired LAN, eth1...or your wireless wlan0? You've
confused me by talking about both.

>> Removing DHCP
>> data on the client may stop this, causing the client to just as for an
>> IP, not a specific one. And removing DHCP data on the server may cause
>> it to assign a different IP, so long as the server is randomly doling
>> out IPs. But if it has a fixed set of rules, than the server will try
>> to give it the same IP.
> Actually, I have solved my problems now.
> The basic problem was that as far as I can see dhcp or dhcpd
> was not running properly, if at all, on my Linksys router
> (running the original Linksys software).
>
> When I started running dhcpd on my server instead
> (and stopped it on the router),
> everything started to work as I expected,
> and my laptop got its correct address at last.
>
>

Another key bit of information would have been in the file in
/var/lib/dhclient. That would have told you where the client was
getting its lease. option dhcp-server-identifier tells you that.

>From what you've said, I think I would be a bit concerned.....

Do you have 2 dhcp servers on the same subnet? That isn't a good idea.
DHCP is a broadcast protocol. At the very start a client will send out
a broadcast message saying "I need an IP address, can anyone give me
one to use?". If there are 2 DHCP servers on the subnet, they both will
answer. The client will take the information from the first one that
responds. If, at another time, the client asks again in a broadcast and
the other server responds you may get some very weird results.




--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 06-16-2011, 10:48 PM
Ed Greshko
 
Default Two elementary questions on LANs

Some additional information regarding DHCP.....

As I mentioned, the lease information is retained by both the client and
the server.....

Let's assume that this is not the first time the client has acquired an
IP address from the server. Let's also assume that the interface is
currently down and a file exists in /var/lib/dhcpclient for the
interface in question.

Now, you enable the interface and the following happens....

1. The dhcpclient checks the file to see what IP address it was last
assigned.

2. The client then sends out a UDP broadcast with source address of
0.0.0.0 and destination of 255.255.255.255 (a broadcast request) It
will be a message type of DHCP Request and the packet will contain the
previous IP address it is requesting. It will also have a "transaction
ID" in the packet.

3. The server will respond. The source address will be its IP address
and the destination will be 255.255.255.255 Another broadcast. The
response will have the same "transaction ID" as the request and the
client will match these to know the broadcast message is meant for it.

You are done....

If a file in /var/lib/dhcpclient does not exist for the interface the
procedure is a bit different....

1. The client sends out a DHCP Discover.
2. The server sends out a DHCP offer. Offering an IP address to the
client. If the server had issued a lease in the past to this MAC
address it *may* offer the same IP address.
3. The client sends out a DHCP Request as in #2 above.
4. The server sends out a DHCP ACK as in #3 above.

FWIW, a DHCP request can request quite a bit of information that the
server may or may not supply. Some examples would be....

Subnet Mask
Broadcast Address
Domain Name
Domain Name Server
NIS Domain
NTP Servers


--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 06-17-2011, 07:06 AM
Joe Zeff
 
Default Two elementary questions on LANs

On 06/16/2011 09:56 AM, Tim wrote:
> Try some other addresses. Perhaps google.co.uk doesn't respond to
> pings. Or, what happens when you try pinging it while on the gateway
> computer?

Until recently, mit.edu was a good choice. Checking, it no longer
replies. However, using traceroute, I found that this works:

ping OC11-RTR-1-BACKBONE.MIT.EDU
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 06-17-2011, 07:28 AM
Ed Greshko
 
Default Two elementary questions on LANs

On 06/17/2011 03:06 PM, Joe Zeff wrote:
> On 06/16/2011 09:56 AM, Tim wrote:
>> Try some other addresses. Perhaps google.co.uk doesn't respond to
>> pings. Or, what happens when you try pinging it while on the gateway
>> computer?
> Until recently, mit.edu was a good choice. Checking, it no longer
> replies. However, using traceroute, I found that this works:
>
> ping OC11-RTR-1-BACKBONE.MIT.EDU

One thing that people sometimes forget is that it is possible for an
outbound packet to reach its destination but for the return inbound
packet to get "lost" due to bad routes or other things on the return path.

Sometimes, it is necessary to use sites such as
http://network-tools.com/ to initiate a test from external to your
system and using something like tcpdump or wireshark determine if the
packets are arriving were they should be. Yes, this is complicated by
local firewalls and/or NAT, but that can be "fixed" during testing using
port forwarding or other means.

I would also caution against doing something like "ping google.co.uk"
not only do you have to contend with the DNS resolution, you also have
to realize that it may return many IP address (at least 6 in this case)
and one of those may be configured differently than the others and/or
one of them may be down at any one time. If you use an IP address, also
use -n to inhibit reverse lookups.

In addition, at times a better tool than a standard ping is to use a
tool that uses SYN/ACK packets to confirm end to end connectivity.
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 
Old 06-17-2011, 10:17 AM
Timothy Murphy
 
Default Two elementary questions on LANs

Ed Greshko wrote:

>> I'm sure that is true.
>> But where does the machine keep the old IP?
>> I couldn't find it anywhere.
>
> That information is kept in the lease information and is why I've been
> trying to elicit explicit information with explicit question.

Thanks for your continuing help.
As I mentioned, I searched (grep -r 192.168.1.7) on the laptop
for the address that kept re-appearing, in /etc and /var/lib
and it did not appear in either.
Of course it might have been in some other form, eg as an octal number.

> Now, I really want to know what interface you want to concentrate
> on..... Is it your wired LAN, eth1...or your wireless wlan0? You've
> confused me by talking about both.

I have a single LAN consisting of a server
linked by ethernet to a router
and a number of laptops linked to the router by WiFi.
The interface on the CentOS server is called eth1,
and that on the Fedora laptops is called wlan0.
(There are also a few other devices on the LAN,
a Windows XP laptop, a Linksys camera and an iPhone.)

The server is also linked on eth0 to a Billion ADSL modem/router
and so to the internet.

> Do you have 2 dhcp servers on the same subnet?

No.
I was running (or rather, hoping to run) dhcp on the Linksys router.
Now I am running it on the server.

The simplest explanation of my problem (now over)
is that the dhcp server on the Linksys router
was sendout out confusing information.
It didn't seem possible, at first glance,
to get information about what was going on in the router.
I have another, identical, Linksys router (not here)
except that that one is running the dd-wrt system
while this one is running the software that comes with the device.
The dd-wrt version gives copious information,
with log files, lists of connected devices, etc.

My basic error, I think, was to assume that
this router would behave in the same way.



--
Timothy Murphy
e-mail: gayleard /at/ eircom.net
tel: +353-86-2336090, +353-1-2842366
s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
 

Thread Tools




All times are GMT. The time now is 10:46 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org