Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Is it possible to have both dhcp AND static ip on same NIC?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
vespaman
Guru
Guru


Joined: 28 Aug 2002
Posts: 382
Location: Stockholm, Sweden

PostPosted: Tue Sep 01, 2009 1:36 pm    Post subject: Is it possible to have both dhcp AND static ip on same NIC? Reply with quote

On my stationary computer, I have set-up eth0 like this;
config_eth0=(
"192.168.1.48"
"10.1.10.101/24"
"10.1.10.102/24"
"10.1.10.103/24"
"10.1.10.104/24"
"10.1.10.105/24"
"10.1.10.106/24"
"10.1.10.107/24"
"10.1.10.108/24"
"10.1.10.109/24"
"10.1.10.110/24"
)


I use all the "extra addresses" for software development.

Now, I'd like the same on my laptop, but with the first address being retrieved by dhcp. I tried
config_eth0=(
"dhcp"
"10.1.10.101/24"
"10.1.10.102/24"
"10.1.10.103/24"
"10.1.10.104/24"
"10.1.10.105/24"
"10.1.10.106/24"
"10.1.10.107/24"
"10.1.10.108/24"
"10.1.10.109/24"
"10.1.10.110/24"
)


.. but this does not work, as the extra addresses are removed upon starting eth0.

Can this be done?
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Tue Sep 01, 2009 1:38 pm    Post subject: Reply with quote

Depends on the dhcp client used.
dhcpcd-4.x and better should not remove statically assigned addresses.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
vespaman
Guru
Guru


Joined: 28 Aug 2002
Posts: 382
Location: Stockholm, Sweden

PostPosted: Tue Sep 01, 2009 1:50 pm    Post subject: Reply with quote

Well, I can't really tell by invoking dhcpcd (can't find any version info), but at least it is net-misc/dhcpcd 5.0.6 that is installed.
The box is a fresh ~arch installation.

It may be the net.eth startup script that removes these additional static ip's, no?
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Tue Sep 01, 2009 2:09 pm    Post subject: Reply with quote

It shouldn't after you've run dhcp
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
vespaman
Guru
Guru


Joined: 28 Aug 2002
Posts: 382
Location: Stockholm, Sweden

PostPosted: Tue Sep 01, 2009 4:24 pm    Post subject: Reply with quote

And now (at home) it does not.

Could there be something about the set-up of the dhcp servers or routes? Or perhaps because, at work, we have a windows server doing the dhcp management. At home I have linux.

Will test more tomorrow, thanks!

- Micael
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum