View previous topic :: View next topic |
Author |
Message |
stdPikachu Apprentice
Joined: 10 Mar 2004 Posts: 254 Location: UK
|
Posted: Mon Aug 06, 2007 2:01 pm Post subject: Problem with network configuration |
|
|
Howdy, I'm having some problems getting my laptop to adapt to different networks nicely. It's a laptop I use for work, and it now has a tendency to flit between several different networks, including but not limited to:
DHCP through WPA2 wireless
DHCP through ethernet
Static IP through ethernet
IPv6 through ethernet
I can get all these working manually, but it's a PITA. At the moment I'm just hacking around this by manually editing my net.eth0 file and commenting out certain blocks and enabling others. This has the disadvantage that it's annoyingly time consuming, and whenever I switch from DHCP to static I have to re-create resolv.conf to get the correct DNS info.
Is there anyway I can:
a) Get Gentoo to auto-detect what sort of network I'm using (e.g. call a hackish bash script to generate net.eth0 before networking starts?)
or
b) Give me a list of network profiles to chose from at boot/resume?
c) Enable or disable certain services based on the network I'm on (e.g. I wouldn't want to run distcc, dhcpd ntp and whatnot on a potentially unfriendly network but I would want, say, distcc and ssh to be started when I'm on my home network)
The Gentoo Networking howto seems to work on the assumption that configuration for an individual interface will be more or less static and doesn't really seem to provide any info on rapidly changing between networks. I've tried the page on the Gentoo Wiki about arping mode, but this assumes that all networks I'm on have different gateways which (unfortunately) isn't the case... (as an example, my home network and, two ethernetworks and one wireless network I use all use 192.168.1.1 as the gateway). Unless of course there's a way to configure arping mode to filter on IP and MAC address...?
Any help to solving this, probably insurmountable, problem will not be unappreciated! Thank you! |
|
Back to top |
|
|
didymos Advocate
Joined: 10 Oct 2005 Posts: 4798 Location: California
|
Posted: Mon Aug 06, 2007 2:21 pm Post subject: |
|
|
You shouldn't really go hacking at the net.eth0 script. It's a symlink to net.lo, and the next time baselayout is emerged, it will need to be overwritten. You can use custom bash functions with Gentoo's net configuration system by putting them in /etc/conf.d/net. See /etc/conf.d/net.example for that and various other config options. _________________ Thomas S. Howard |
|
Back to top |
|
|
stdPikachu Apprentice
Joined: 10 Mar 2004 Posts: 254 Location: UK
|
Posted: Mon Aug 06, 2007 2:40 pm Post subject: |
|
|
After some more googling about;
Are there plans for Gentoo to implement anything akin to Fedora's RHGB (bootsplashing thingy) that'll allow me to pick from a range of network profiles at boot?
I did have a look in the net.example file but didn't notice anything terribly obvious about calling in bash scripts manually, but I'll give it another look. |
|
Back to top |
|
|
didymos Advocate
Joined: 10 Oct 2005 Posts: 4798 Location: California
|
Posted: Mon Aug 06, 2007 3:02 pm Post subject: |
|
|
It's toward the end of the file. You can have preup, predown, postup, postdown, etc. functions in /etc/conf.d/net. You can make them arbitrarily complex, like having a case statement that does different things for different interfaces, or stuff that acts on all interfaces. I haven't tried it, but I'm sure you can source other scripts so you don't have to have a giant /etc/conf.d/net file. _________________ Thomas S. Howard |
|
Back to top |
|
|
|
|
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
|
|