LinuxQuestions.org
Visit Jeremy's Blog.
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 08-01-2008, 04:20 AM   #1
sanjay.krk
LQ Newbie
 
Registered: Jul 2008
Location: New Delhi
Posts: 26

Rep: Reputation: 15
Question Completely Different range of IPs obtained from Dhcp server


Currently I am facing a strange problem.
- If I connect my windows laptop to internet(ethernet), it happily gets an ip, gateway, dns etc through dhcp and works fine. These are the values fetched:
windows configuration
----------------------
IP Address: 77.222.237.154
Subnet Mask: 255.255.254.0
Default Gateway: 77.222.236.1
DNS Servers: 83.143.40.14, 83.143.40.53


- When I try to connect my linux deskop to the internet, it gets a complete different set of ip, gateway etc. and I am also not able to access internet. I am completely lost for any logical reason.
Can somebody please explain?

I am listing some info that I collected from linux machine

The values obtained are:
ifconfig eth0
----------------------------------------
eth0 Link encap:Ethernet HWaddr 00:16:36:57:6C:A2
inet addr:10.10.0.247 Bcast:10.10.1.255 Mask:255.255.254.0
inet6 addr: fe80::216:36ff:fe57:6ca2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:143048 errors:0 dropped:0 overruns:0 frame:0
TX packets:420 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:15166544 (14.4 MiB) TX bytes:46409 (45.3 KiB)
Interrupt:17 Base address:0xe000
The set of dns addresses are same (as those obtained for windows).

Even from this 10.* range of address, I am able to ping Gateway obtained for windows configuration (77.222.236.1).
--------------------
[root@farfaraway debug]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.10.0.0 * 255.255.254.0 U 0 0 0 eth0
link-local * 255.255.0.0 U 0 0 0 wlan0
192.168.0.0 * 255.255.0.0 U 0 0 0 wlan0
default 10.10.0.1 0.0.0.0 UG 0 0 0 eth0

-----------------------------------
[root@farfaraway debug]# traceroute 77.222.236.1
traceroute to 77.222.236.1 (77.222.236.1), 30 hops max, 40 byte packets
1 (77.222.236.1) 0.866 ms 0.936 ms 1.052 ms
-----------------------------------
tethereal -i eth0
...
206.350249 QuantaCo_f9:23:5f -> Broadcast ARP Who has 77.222.237.60? Tell 77.222.236.1
206.416877 QuantaCo_f9:23:5f -> Broadcast ARP Who has 77.222.236.141? Tell 77.222.236.1
206.430226 QuantaCo_f9:23:5f -> Broadcast ARP Who has 77.222.237.67? Tell 77.222.236.1
206.464941 CiscoLin_e8:37:21 -> Broadcast ARP Who has 10.10.128.1? Tell 10.10.128.44
206.513564 QuantaCo_f9:23:5f -> Broadcast ARP Who has 77.222.236.227? Tell 77.222.236.1
206.607127 QuantaCo_f9:23:5f -> Broadcast ARP Who has 77.222.236.179? Tell 77.222.236.1
....

From the tethereal output, it is pretty much visible, that machine can see packets on 10.10.* and 77.222.* n/w.


I really want to get the internet working on my machine, but clueless as of know. Can somebody please provide some pointers?

Thanks.

Last edited by sanjay.krk; 08-01-2008 at 04:22 AM. Reason: some incorrect informatino (different subnet mask) removed).
 
Old 08-01-2008, 07:24 AM   #2
sanjay.krk
LQ Newbie
 
Registered: Jul 2008
Location: New Delhi
Posts: 26

Original Poster
Rep: Reputation: 15
Let me know, in case my description is not clear and more information may be required.

BTW, I tried looking for old cached ip information in /etc (just to check if this 10.10.* is picked up from there and not from dhcp), but it's not there.
 
Old 08-01-2008, 07:31 AM   #3
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
What is your dhcp server? Is it your router or something else?
 
Old 08-01-2008, 08:07 AM   #4
sanjay.krk
LQ Newbie
 
Registered: Jul 2008
Location: New Delhi
Posts: 26

Original Poster
Rep: Reputation: 15
Frankly speaking, I don't know. I have just rented an apartment and they have this ethernet socket available in the wall .

Basically, I don't have any control or information about the dhcp server side. Its a black box for me.
 
Old 08-02-2008, 04:38 AM   #5
sanjay.krk
LQ Newbie
 
Registered: Jul 2008
Location: New Delhi
Posts: 26

Original Poster
Rep: Reputation: 15
Still stuck and not able to solve this problem.
But I got some additional information. May be some networking guru can see some pattern .
--- On Windows ----
C:\Documents and Settings\Administrator>arp -a 77.222.236.1
Interface: 77.222.237.154 --- 0x2
Internet Address Physical Address Type
77.222.236.1 00-16-36-f9-23-5f static

---- On Linux ----
[root@farfaraway ~]#arp 10.10.0.1
Address HWtype HWaddress Flags Mask Iface
10.10.0.1 ether 00:16:36:F9:23:5F C eth0

--------

Basically, the 'mac address' of gateway I obtain on both the machines is same (though ips are different).

Still looking for some expert advice .
 
Old 08-02-2008, 02:28 PM   #6
main()
LQ Newbie
 
Registered: Mar 2008
Posts: 2

Rep: Reputation: 0
I have had this problem happen to me.. it is not your linux machine but rather the modem. For some reason my modem will not give me access to the internet if I just switch machines. What you need to do is plug your desktop and power off the modem for a few seconds, turn it back on and it will resend your mac over to the dhcp server.

the best solution is to get a router so you don't have to do this procedure constantly every time that you switch machines.

Let me know if it works!
 
Old 08-02-2008, 03:19 PM   #7
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 59
When you first connected to the Ethernet port with your PC, did you have to use a browser to configure your network ?

I'm thinking their network may be running a Captive Portal, where you have to sign-on via browser, and once signed-on, you get a new/usable IP address.
 
Old 08-02-2008, 07:19 PM   #8
sanjay.krk
LQ Newbie
 
Registered: Jul 2008
Location: New Delhi
Posts: 26

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Mr. C. View Post
When you first connected to the Ethernet port with your PC, did you have to use a browser to configure your network ?

I'm thinking their network may be running a Captive Portal, where you have to sign-on via browser, and once signed-on, you get a new/usable IP address.
No, no. It's not like that. There is no sign-up required. You can simply get connected by plugging in the cable and wait for dhcp to setup necessary info.
 
Old 08-02-2008, 08:25 PM   #9
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 59
Ok, just a thought.

Its no surprise the MAC addresses of the gateway device are the same - the wire goes to the same place regardless of which machine you plug into the jack.

Some intelligent switches (with some layer 3 capabilities) and routers can be configured to allow only a single MAC address during the span of a DHCP lease or other period. Your PC gets a public (usable) IP address, while you get an RFC 1918 (private) IP address otherwise. It seems like you're getting put on a VLAN under these circumstances.

Get the MAC address of your PC, and spoof your Linux system's Ethernet MAC address to the same as the PC, and try to obtain a lease after that.

This may be a simple programming problem with their switch/router, or could be a security configuration they've employed.
 
Old 08-02-2008, 09:14 PM   #10
sanjay.krk
LQ Newbie
 
Registered: Jul 2008
Location: New Delhi
Posts: 26

Original Poster
Rep: Reputation: 15
Your thought made my day (actually night, its 3am .
Spoofing the MAC worked.

---------
For others, I used this simple linux command for spoofing
$ifconfig eth0 hw ether <False Mac address>
--------------

Now I really need to check how they assign this lease (May be its' related to when somebody occupies this apartment
 
Old 08-02-2008, 10:16 PM   #11
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 59
Excellent. I thought it would. I think it is clear what they are doing.

Place a NATing router between the port and your systems. Then, it presents itself as one MAC address, giving you the ability to use multiple systems.
 
Old 08-02-2008, 10:27 PM   #12
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 115Reputation: 115
Quote:
Originally Posted by Mr. C. View Post
Place a NATing router between the port and your systems. Then, it presents itself as one MAC address, giving you the ability to use multiple systems.
Everyone should do this anyway.

Those little NAT routers are cheap, and they provide an excellent layer of security between your system and the internet.

Why trust that the apartment complex router is secure? It is unlikely that it is.
 
Old 08-02-2008, 10:30 PM   #13
sanjay.krk
LQ Newbie
 
Registered: Jul 2008
Location: New Delhi
Posts: 26

Original Poster
Rep: Reputation: 15
Thumbs up

Quote:
Originally Posted by Mr. C. View Post
Excellent. I thought it would. I think it is clear what they are doing.
Indeed.

Quote:
Originally Posted by Mr. C. View Post
Place a NATing router between the port and your systems. Then, it presents itself as one MAC address, giving you the ability to use multiple systems.
Ok, thats useful information, may be I will try it some day.
As of know, I just want to work on setting my linux machine as the host for Internet connection sharing (ICS). The only other machine in the n/w (sharing this internet connection) will be running windows.

Last edited by sanjay.krk; 08-02-2008 at 10:31 PM. Reason: Quotes placed correctly
 
  


Reply

Tags
dhcp


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
How can i exclude an ip address from given range in dhcp server? saurabh_pandya4 Linux - Networking 4 03-05-2009 04:39 AM
script to update /etc/hosts on dhcp obtained ip change. juanctes Linux - General 1 02-02-2008 10:17 AM
DHCP server could NOT deploy IPs to client Fuzia Linux - Networking 1 01-28-2007 07:25 AM
How To know if a host configured with DHCP has obtained IP address from DHCP server? Prassanta Suse/Novell 1 06-29-2006 10:48 AM
how to define a specific range of IPs and/or multiple IPs in an iptables rule?... TheHellsMaster Linux - Security 9 09-20-2004 11:06 AM


All times are GMT -5. The time now is 02:37 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration