You are not logged in.

#1 2013-03-22 06:15:57

lumpynose
Member
Registered: 2013-03-22
Posts: 26

combined dhcp and static ip?

I'd like to be able to specify a static ip address and get the remaining stuff (dns, gateway, and whatever) from dhcp. It this possible?

Offline

#2 2013-03-23 12:57:39

wudu
Member
Registered: 2010-03-08
Posts: 83

Re: combined dhcp and static ip?

I know that there is an option for network-manager to get only the addres from DHCP but I think there's nothing for what you want.
I'm not sure what you want to do. Do you have changing DNS servers and gateways?

If you have control over the DHCP server you could do that by static DHCP (your pc gets the same address every time based on the MAC address). If the DHCP server is running on a router you often don't have this as option (directly).
Other possibility is to get everything from DHCP and then change your IP address manually or with a script.

Offline

#3 2013-03-23 19:45:58

lumpynose
Member
Registered: 2013-03-22
Posts: 26

Re: combined dhcp and static ip?

wudu wrote:

I know that there is an option for network-manager to get only the addres from DHCP but I think there's nothing for what you want.
I'm not sure what you want to do. Do you have changing DNS servers and gateways?

If you have control over the DHCP server you could do that by static DHCP (your pc gets the same address every time based on the MAC address). If the DHCP server is running on a router you often don't have this as option (directly).
Other possibility is to get everything from DHCP and then change your IP address manually or with a script.

Changing the ip address afterwards is an idea.  I've been with my ISP for a long time and they have changed the addresses of the DNS servers.

Being able to specify just a static network interface address seems like a useful thing to me in a home environment; I want a static address so I can easily ssh to the machine, and the other stuff, DNS, gateway, etc. I can let DHCP set up.

Offline

#4 2013-03-23 19:49:44

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,676

Re: combined dhcp and static ip?

For a home environment, why do you not just set the router up to always assign the same address to specific, known machines?  That is what I do.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#5 2013-03-23 19:50:12

progandy
Member
Registered: 2012-05-17
Posts: 5,319

Re: combined dhcp and static ip?

you could try to use a --static parameter for dhcpcd or --inform.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#6 2013-03-24 03:06:41

lumpynose
Member
Registered: 2013-03-22
Posts: 26

Re: combined dhcp and static ip?

ewaller wrote:

For a home environment, why do you not just set the router up to always assign the same address to specific, known machines?  That is what I do.

I checked, mine doesn't provide that option.  That would be ideal.  The best mine does is let you specify the low end starting point, which I've set to 8.

Offline

#7 2013-03-24 10:58:55

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: combined dhcp and static ip?

lumpynose wrote:
wudu wrote:

I know that there is an option for network-manager to get only the addres from DHCP but I think there's nothing for what you want.
I'm not sure what you want to do. Do you have changing DNS servers and gateways?

If you have control over the DHCP server you could do that by static DHCP (your pc gets the same address every time based on the MAC address). If the DHCP server is running on a router you often don't have this as option (directly).
Other possibility is to get everything from DHCP and then change your IP address manually or with a script.

Changing the ip address afterwards is an idea.  I've been with my ISP for a long time and they have changed the addresses of the DNS servers.

Being able to specify just a static network interface address seems like a useful thing to me in a home environment; I want a static address so I can easily ssh to the machine, and the other stuff, DNS, gateway, etc. I can let DHCP set up.

Are you saying that you want to set a static Public IP address on the interface that connects to your home ISP? Like, your ISP changes your public IP address which makes it hard to ssh back home.

If this is the problem you are trying to solve, you would be better off just buying like a .info domain for $2 and setting up Dynamic DNS. I find Hurricane Electric to be a good DNS host. They will let you add Dynamic A records. Then you just set a cron job to update the dns records like every 30min's to be sure it is always correct.

With this promo code from the Linux Action Show you will save 35% off your order of the domain.
http://www.godaddy.com/?isc=go35off3

Free DNS host (these guys are a global Internet backbone provider)
https://dns.he.net

Last edited by hunterthomson (2013-03-24 11:00:37)


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

#8 2013-03-26 00:34:57

lumpynose
Member
Registered: 2013-03-22
Posts: 26

Re: combined dhcp and static ip?

Are you saying that you want to set a static Public IP address on the interface that connects to your home ISP? Like, your ISP changes your public IP address which makes it hard to ssh back home.

No, not a public ip address.  I just want to avoid having to open a browser window on my pc to look at my Linksys router's dhcp clients list in order to see which address to use to ssh to the linux box.

I'm using a static ip address now, but I see no reason for my having to specify the dns, gateway, etc. stuff when the router provides that via dhcp.

Last edited by lumpynose (2013-03-26 00:42:28)

Offline

#9 2013-03-26 00:46:58

progandy
Member
Registered: 2012-05-17
Posts: 5,319

Re: combined dhcp and static ip?

progandy wrote:

you could try to use a --static parameter for dhcpcd or --inform.

Did you try this? I don't have a dhcp server here so I can't test.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#10 2013-03-26 17:40:52

lumpynose
Member
Registered: 2013-03-22
Posts: 26

Re: combined dhcp and static ip?

Not yet.  I spent all day yesterday trying to get it working with wireless.

Offline

#11 2013-03-27 00:48:51

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: combined dhcp and static ip?

lumpynose wrote:

Are you saying that you want to set a static Public IP address on the interface that connects to your home ISP? Like, your ISP changes your public IP address which makes it hard to ssh back home.

No, not a public ip address.  I just want to avoid having to open a browser window on my pc to look at my Linksys router's dhcp clients list in order to see which address to use to ssh to the linux box.

I'm using a static ip address now, but I see no reason for my having to specify the dns, gateway, etc. stuff when the router provides that via dhcp.

Okay.

If the dhcp request dose not end up working out. You may also want to consider that your ISP's DNS probably sucks anyway. I don't see any reason to fight against the current. Use Google's public anycast DNS service 8.8.8.8 and 8.8.4.4 Also, DHCP is slower then static configuration, so there is yet another benefit to not using DHCP.

If you really have your hart set on using DHCP for DNS then you will have to run your own DHCP server. Then you will have no problem configuring it to always give the same IP to the same MAC addresses. You can still use your wireless router. You just disable the DHCP server on it. Then if you don't have a home server, you can buy a Raspberry pi for like $35 and also use it for other things.

Last edited by hunterthomson (2013-03-27 00:55:24)


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

Board footer

Powered by FluxBB