You are not logged in.
I have a desktop with interfaces with statically assigned network addresses, I can't use rc.conf to configure them anymore so my /etc/rc.local file now looks like:
/sbin/ifconfig ext0 10.0.0.1/24
/sbin/route add default gw 10.0.0.1
/sbin/ifconfig int0 192.168.0.1/24I don't like this; it seems completely in-elegant and, worse, if I need to start up any demons that require networking to work, they aren't going to work. I've considered patching the initscripts, but this is inelegant because then I have to merge changes every time I update them. I guess maybe the best solution is to write my script for /etc/rc.d/, choosing a name unlikely to be taken by any script I'm likely to start in the future. Please tell me there is a better way to do this.
Offline
There is. Please read the announcements and the 4 other forum threads started on the same topic.
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
I read the news, it indicates that I can no longer use rc.conf to configure both of my network interfaces. It suggests using network manager, which is silly, because all I need to do is assign static IPs. So I spent some hours trying to find any documentation or examples on how to set this up with netcfg, but was unsuccessful. Then I read some forum posts, but they had answers like "yeah, you can't do that anymore, read the news". That was not helpful to me either (unless you mean to suggest that I should be using iproute instead of ifconfig in my scripts, which I see no need to do, ifconfig works and I already know what options to pass it). I also tried searching the arch general mailing list, but didn't see anything addressing the topic either this month or last month.
At any rate, I still haven't found a better solution to configuring multiple network interfaces than writing my /etc/rc.d/ script, although I have come across one other possible solution, namely, installing and configuring ifplugd, which I hadn't considered before.
Offline
unless you mean to suggest that I should be using iproute instead of ifconfig in my scripts, which I see no need to do, ifconfig works and I already know what options to pass it
As part of using a rolling release distro, things change. And obviously ifconfig is no longer working which is why you are asking if there is another way. Using iproute just might be that other way
There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !
Offline
There is an "examples" dir in /etc/network.d everything you need should be in there. Writing a whole new init script seems to me like a backwards way of going about things. Netcfg profiles for static IP assignment are very simple, you actually don't even need to learn iproute, I'm not sure I'd know off the top of my head how to directly use it. But I have netcfg profiles for all sorts of things, it's an awesome little tool.
Offline
ifconfig works fine, my "rc.local" script brings the network up, I checked. What has stopped working is my network configuration in rc.conf. And, fortunately for me, I don't actually run any demons the network to be brought up before they are started.
I wouldn't be asking my questions here if there existed an example of how to get netcfg to do what I wanted it to do. Sure, there's two examples of configuring a single static address in the netcfg scripts, but there is no documentation or example of how to configure multiple interfaces in the same profile, although I'm not using the machine as a router (at least not currently) I do intend to use both network interfaces simultaneously.
I agree that writing my own /etc/rc.d/ script is a backwards way to do things but, with the exception maybe of installing something like network manager, it is by far the easiest way for me to bring both network interfaces automatically at boot time.
Offline
ibut there is no documentation or example of how to configure multiple interfaces in the same profile
It's very simple. You don't. You write two profiles, one for each interface.
Offline
Well, I suppose that answers my question then. I suppose I will never know enough about anything that I will not spend time acting like an idiot.
Edit: I'll marked this "solved" after I test that netcfg actually does what I want it do.
Last edited by pseudonomous (2011-06-11 19:49:37)
Offline
Indeed, netcfg easily supports multiple profiles running at a time, though only one per interface. That should get you what you need if you're just trying to get two interfaces with a single address each going. Both with CONNECTION='ethernet' and IP='static', each with their respective ADDR and NETMASK and INTERFACE settings. Set GATEWAY in the external profile, don't use a GATEWAY setting in the internal.
But if you want IPv6, more than a single address per interface, or the ability to set options for bridges (e.g. to allow DHCP to work), handling everything in /etc/rc.local and delaying/not starting network daemons as shown in your first post, or keeping a copy of the old rc.d/network script under a new name does seem the only way to have networking going forward.
But it's a deprecation, not a deletion (yet), so you can keep using the old rc.conf system for a while, hoping a replacement becomes available.
Offline
I hadn't used netcfg until now, so the notices to which everyone continually refers didn't quite connect the dots for me -- until I found https://wiki.archlinux.org/index.php/Ne … omatically
In short, you make profiles for each interface in /etc/network.d/ , add the names of the profiles in the NETWORKS list in rc.conf , and add net-profiles to the DAEMONS list in rc.conf .
Offline