Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Automatic wired network selection without DHCP (SOLVED)
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
robinmarlow
Apprentice
Apprentice


Joined: 10 Mar 2004
Posts: 164

PostPosted: Thu Nov 15, 2012 3:53 pm    Post subject: Automatic wired network selection without DHCP (SOLVED) Reply with quote

Hello,

I would like my laptop to automatically switch to the correct network address when plugged in at home & uni.
Uni I have a fixed network address but no DHCP server to give me it.
My home network I currently have a 192.168.XX fixed address but there is DHCP running on the router.

There did seem to be various programs that did this (whereami, intuitively but they all seem neglected).
I am currently using networkmanager and it seems to have no facility for choosing between wired connections although it does it nicely for wireless.

Has anyone suggestions on how i might do this. Or should I just carry on choosing them manually.

Robin


Last edited by robinmarlow on Tue Nov 20, 2012 12:54 pm; edited 1 time in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 32297
Location: 56N 3W

PostPosted: Thu Nov 15, 2012 9:53 pm    Post subject: Reply with quote

robinmarlow,

Read the /usr/share/doc/... example file for net.

You can use DHCP at give you an IP address at home. It can be set in the DHCP server as a fixed IP against your MAC address if you wish.
Also, when DHCP fails, you can fallback to your manually assigned IP for Uni.

The example page I almost linked to tells how to use fallback.
You also need to sort out your /etc/resolv.conf as that will vary from site to site.

I think you can use the postup function in the /etc/conf.d/net file to write the /etc/resolve.conf file depending on your IP.
The postup function is explained in the reference too.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
robinmarlow
Apprentice
Apprentice


Joined: 10 Mar 2004
Posts: 164

PostPosted: Thu Nov 15, 2012 10:08 pm    Post subject: Reply with quote

Thanks Neddy,

The network scripts do seem a lot easier to use than last time I remember looking at them.

I had started experimenting with using dhcpcd to give static addresses based on arppings - but it just doesn't play nicely with networkmanager.
I'll see if I can get the init scripts set up right instead.

Robin
Back to top
View user's profile Send private message
robinmarlow
Apprentice
Apprentice


Joined: 10 Mar 2004
Posts: 164

PostPosted: Tue Nov 20, 2012 12:53 pm    Post subject: Reply with quote

Hurrah! Thanks,

buried in /usr/share/doc/openrc-0.11.5/net.example was how to use arping

also described here http://en.gentoo-wiki.com/wiki/Network_profiles_with_arping

This does exactly what I want. Thanks Neddy,

Just need to get ifplugd to behave now!
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