LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 01-12-2012, 12:42 PM   #1
dyani
LQ Newbie
 
Registered: Jun 2011
Posts: 16

Rep: Reputation: Disabled
how did my ip address become "fixed"?


I am running ubuntu 10.04 on a stand alone computer.
I was using the default configuration with the dynamic ip address and somehow it changed to a static one.

I have tried editing /var/lib/dhcp3/dhcpd.leases, /etc/resolv.conf, /etc/network/interfaces, var/lib/dhcp3/dhclient
files and more suggestions that I found in other forums posted by people with similar issues. Whatever changes persisted through a restart left me without a connection until I changed it back.

It seems like my ip address has become permanently locked to this static one
 
Old 01-12-2012, 01:41 PM   #2
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
Please, delete files /var/lib/dhcp3/*.leases and post contents of file /etc/network/interfaces.
 
Old 01-12-2012, 06:56 PM   #3
dyani
LQ Newbie
 
Registered: Jun 2011
Posts: 16

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by eSelix View Post
Please, delete files /var/lib/dhcp3/*.leases and post contents of file /etc/network/interfaces.
I have changed /etc/network/interfaces and /var/lib/dhcp3/* files as well as every other thing I found posted in respected forums for changing ip addresses nothing has worked

I was tired of the situation and deleted that partition and made a new one with a fresh install and it has the same issue so I wonder if a static ip address is the default configuration on Ubuntu 10.04
 
Old 01-12-2012, 07:39 PM   #4
realbluntz
Member
 
Registered: Jun 2010
Location: the D
Distribution: arch x86_64
Posts: 57

Rep: Reputation: 3
...is that standalone computer connected directly to the 'modem'?
 
Old 01-12-2012, 08:52 PM   #5
dyani
LQ Newbie
 
Registered: Jun 2011
Posts: 16

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by realbluntz View Post
...is that standalone computer connected directly to the 'modem'?
yes it is standalone if it was part of a network and I had downloaded network software this situation might be understandable
 
Old 01-13-2012, 02:26 AM   #6
MartinStrec
Member
 
Registered: Jan 2012
Location: Czech
Distribution: Fedora, RHEL, Ubuntu, Mint
Posts: 110

Rep: Reputation: 14
Hi, be aware about the difference between static IP and between having the same IP!

The default IP is never static, because anybody cannot know your network configuration!

However, you need to understand the process of DHCP Leasing.

1. Your PC send request of IP (it is identified by your hardware address of your network card - MAC).

2. DHCP server send response with an IP or more IPs that can be used for your MAC.

3. Your PC send confirmation, what address it wants the use (usually there is offer of one IP and you use one IP).

Well, many modems, routers and other devices running DHCP server make following:
They remeber the MAC and IP leases for that MAC. It is called "DHCP Leases" from "DHCP Pool". If you have a better modem, router, etc, you can set the timeout for DHPC Lease. After that time the address is invalid and the PC has to request new one. However when you request the IP till it is valid, you ever obtain the same IP for the same MAC.

Reset your modem/router or go to DHCP Leases and delete the record of your MAC/IP.
 
Old 01-13-2012, 11:53 AM   #7
dyani
LQ Newbie
 
Registered: Jun 2011
Posts: 16

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by MartinStrec View Post
Hi, be aware about the difference between static IP and between having the same IP!

The default IP is never static, because anybody cannot know your network configuration!

However, you need to understand the process of DHCP Leasing.

1. Your PC send request of IP (it is identified by your hardware address of your network card - MAC).

2. DHCP server send response with an IP or more IPs that can be used for your MAC.

3. Your PC send confirmation, what address it wants the use (usually there is offer of one IP and you use one IP).

Well, many modems, routers and other devices running DHCP server make following:
They remeber the MAC and IP leases for that MAC. It is called "DHCP Leases" from "DHCP Pool". If you have a better modem, router, etc, you can set the timeout for DHPC Lease. After that time the address is invalid and the PC has to request new one. However when you request the IP till it is valid, you ever obtain the same IP for the same MAC.

Reset your modem/router or go to DHCP Leases and delete the record of your MAC/IP.
The ip address on the DHCP lease reads as a fixed address, when I have changed that and restarted the computer, I get no connection
 
Old 01-13-2012, 05:38 PM   #8
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,281

Rep: Reputation: 320Reputation: 320Reputation: 320Reputation: 320
The lease files on client machine are not intened to make changes in them. It depends on DHCP server which IP address you get. The DHCP server has own leases and may not give you new address until lease timeout. If you have access to your router, make what MartinStrec mentioned (change IP tied with your MAC and restart router), if not, you can't change that.

Last edited by eSelix; 01-13-2012 at 05:39 PM.
 
Old 01-13-2012, 10:18 PM   #9
dyani
LQ Newbie
 
Registered: Jun 2011
Posts: 16

Original Poster
Rep: Reputation: Disabled
Unhappy

Quote:
Originally Posted by eSelix View Post
The lease files on client machine are not intened to make changes in them. It depends on DHCP server which IP address you get. The DHCP server has own leases and may not give you new address until lease timeout. If you have access to your router, make what MartinStrec mentioned (change IP tied with your MAC and restart router), if not, you can't change that.
I do not have a router. I changed the mac address, or rather spoofed one and had no connection until a restart when the old mac number reset.NOTHING is working.
This address has persisted through a fresh install on a new partition as well.

Last edited by dyani; 01-13-2012 at 10:22 PM. Reason: clarity
 
Old 01-14-2012, 12:31 AM   #10
realbluntz
Member
 
Registered: Jun 2010
Location: the D
Distribution: arch x86_64
Posts: 57

Rep: Reputation: 3
what is your ip address?
 
Old 01-14-2012, 04:44 AM   #11
MartinStrec
Member
 
Registered: Jan 2012
Location: Czech
Distribution: Fedora, RHEL, Ubuntu, Mint
Posts: 110

Rep: Reputation: 14
How are you connected to the internet or LAN when you do not have a router? Is it a computer in a network or just a virtual machine anywhere?

Please, send info, what says:

Quote:
grep DHCP /var/log/messages
ifconfig
ip route list
 
Old 01-14-2012, 06:01 AM   #12
dyani
LQ Newbie
 
Registered: Jun 2011
Posts: 16

Original Poster
Rep: Reputation: Disabled
Unhappy

Quote:
Originally Posted by MartinStrec View Post
How are you connected to the internet or LAN when you do not have a router? Is it a computer in a network or just a virtual machine anywhere?

Please, send info, what says:
this is a standalone computer with no router now

grep DHCP /var/log/messages shows only this: Internet Systems Consortium DHCP Server V3.1.3

ifconfig:eth0 Link encap:Ethernet HWaddr
inet addr:74.195.17.169 Bcast:74.195.19.255 Mask:255.255.252.0
inet6 addr: fe80::211:5bff:fe2f:760f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:103907 errors:0 dropped:0 overruns:0 frame:0
TX packets:12544 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:31988978 (31.9 MB) TX bytes:1036770 (1.0 MB)
Interrupt:23

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:64 errors:0 dropped:0 overruns:0 frame:0
TX packets:64 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:5248 (5.2 KB) TX bytes:5248 (5.2 KB)

(Only the mac address is not shown)

ip route list gives this:default via 74.195.16.1 dev eth0 proto static
74.195.16.0/22 dev eth0 proto kernel scope link src 74.195.17.169 metric 1
169.254.0.0/16 dev eth0 scope link metric 1000

and that shows this is a static ip address, as does the dhcp3 lease file

Last edited by dyani; 01-14-2012 at 12:59 PM. Reason: clari ty
 
Old 01-14-2012, 08:40 AM   #13
MartinStrec
Member
 
Registered: Jan 2012
Location: Czech
Distribution: Fedora, RHEL, Ubuntu, Mint
Posts: 110

Rep: Reputation: 14
OK, it seems really to be a static IP. If you are using network-manager, see its configuration. If you want to make a server, I recommend stop the NetworkManager and manually set all network settings.

You wrote about reinstall. When you just reinstall and you do not choose format HDD, some files needn't be changes. Specially the configuration files are the same as before. If you use NetworkManager, the configuration files are in your home directory ( https://help.ubuntu.com/community/NetworkManager ),
other way look to /etc/network/interfaces ( http://www.cyberciti.biz/faq/setting...terfaces-file/ )

As I wrote, I recommend you do the following:
1. stop the NM ( /etc/init.d/network-manager stop )
2. set you eth0 configuration in /etc/network/interfaces
iface eth0 inet static
address 192.168.1.30
netmask 255.255.255.0
gateway 192.168.1.1
3. restart network
/etc/init.d/network-interace restart
/etc/init.d/networking restart

4. Check if all has been well done by ifconfig, ip route list
if you see your IP a and default route, everything is working :-)
 
1 members found this post helpful.
Old 01-14-2012, 11:39 AM   #14
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by dyani View Post
I do not have a router. I changed the mac address, or rather spoofed one and had no connection until a restart when the old mac number reset.NOTHING is working.
This address has persisted through a fresh install on a new partition as well.
Is that a cable modem? It is common that a cable modem needs to be reset in order to recognize a new MAC address for the device directly connected to it.
 
Old 01-14-2012, 01:32 PM   #15
dyani
LQ Newbie
 
Registered: Jun 2011
Posts: 16

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by MartinStrec View Post
OK, it seems really to be a static IP. If you are using network-manager, see its configuration. If you want to make a server, I recommend stop the NetworkManager and manually set all network settings.

You wrote about reinstall. When you just reinstall and you do not choose format HDD, some files needn't be changes. Specially the configuration files are the same as before. If you use NetworkManager, the configuration files are in your home directory ( https://help.ubuntu.com/community/NetworkManager ),
other way look to /etc/network/interfaces ( http://www.cyberciti.biz/faq/setting...terfaces-file/ )

As I wrote, I recommend you do the following:
1. stop the NM ( /etc/init.d/network-manager stop )
2. set you eth0 configuration in /etc/network/interfaces
iface eth0 inet static
address 192.168.1.30
netmask 255.255.255.0
gateway 192.168.1.1
3. restart network
/etc/init.d/network-interace restart
/etc/init.d/networking restart

4. Check if all has been well done by ifconfig, ip route list
if you see your IP a and default route, everything is working :-)

the step 2 edit above still labels the address as static, I tried that before as well as labeling it dynamic, and many other things as well NOTHING has worked. I think there must be some other configuration file that I have not read about yet that is keeping this static. Also I am wondering if network manager is a default app, since I did not install it.

Last edited by dyani; 01-14-2012 at 03:47 PM.
 
  


Reply



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 to permanent spoof "fake" mac address for eth0 & eth1? in NEW linux distro"s... vastvet Linux - Newbie 22 02-02-2013 12:40 AM
Reuse socket fails "Address already in use" or "Connection refused" dec10 Programming 3 05-15-2010 12:14 PM
Occasionally-- "connected with self-assigned address," "deactivating device eth0" MaxIBoy Debian 4 10-04-2009 10:50 AM
difference between "Web server local URL" and "IPv4 address"? kpachopoulos Linux - General 2 09-17-2004 01:30 PM
"host" ok, but "ping" can't find ip address hardigunawan Linux - Networking 2 05-16-2002 05:41 PM

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

All times are GMT -5. The time now is 05:38 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