View previous topic :: View next topic |
Author |
Message |
robinmarlow Apprentice
Joined: 10 Mar 2004 Posts: 167
|
Posted: Thu Nov 15, 2012 3:53 pm Post subject: Automatic wired network selection without DHCP (SOLVED) |
|
|
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 |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54033 Location: 56N 3W
|
Posted: Thu Nov 15, 2012 9:53 pm Post subject: |
|
|
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 |
|
|
robinmarlow Apprentice
Joined: 10 Mar 2004 Posts: 167
|
Posted: Thu Nov 15, 2012 10:08 pm Post subject: |
|
|
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 |
|
|
robinmarlow Apprentice
Joined: 10 Mar 2004 Posts: 167
|
Posted: Tue Nov 20, 2012 12:53 pm Post subject: |
|
|
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 |
|
|
|