On Wednesday 02 May 2007, Russel Caldwell wrote:
> I'm trying to connect my Gentoo machine to the internet after installing
> the base system, but when I do `net.eth0 start` I get the error message
> "network interface eth0 does not exist." I've googled trying to find a
> solution but haven't come up with one yet. Any suggestions as to how to
> proceed?
Might I suggest in all of this that you begin to learn the new tools?
emerge iproute2 and use the 'ip' command. ifconfig is deprecated and has not
supported all of the features of the Linux networking stack since the 2.4
kernels. It's embarrassing IMO that most distros still ship with ifconfig as
the default.
To find your available network devices (the ones the kernel has found and
loaded modules for already), do:
cat /proc/net/dev
- or -
ip link list
If it's naming it to something you don't like, you can use udev to change the
name on the next reboot. To do so, create a file named:
/etc/udev/rules.d/10-local.rules
make note of the address listed by the 'ip link list' command on the second
line of output, just after the 'link/ether', it will look
like "ab:23:66:ab:17:b4" (six pairs of hex digits separated by colons).
In the new file, add a line:
SUBSYSTEM=="net", SYSFS{address}=="ab:23:66:ab:17:b4", NAME="eth0"
This should take effect on the next boot.
In the meantime, you can rename the current interface like so:
nameif eth0 "ab:23:66:ab:17:b4"
(assuming there isn't an eth0 already, if so, you must name that to something
else first, and you may need to add a udev rule for that as well)
Now you can continue to configure your system using net.eth0.
As for the 'ip' command, a brief primer:
ip help # typical
ip link help # not obvious
ip link set help # etc...
ip addr add <addr>/<mask> brd + dev eth0
ip link set up dev eth0
ip route add default via <addr>
ip addr del <addr>/<mask> dev eth0
ip link set down dev eth0
ip route del default via <addr>
Note that you can configure the link state and the assigned addresses
independently. This allows you to fully configure your addresses, routes, and
iptables rules _before_ setting your link state to 'up' and allowing any
traffic to flow. Also note, that you can add as many addresses to the
interface as you want, and you don't have to create 'aliases' to do so--that
is a limitation of the old ifconfig tool. Additionally, you can assign the
same address to more than one interface, which can be a correct configuration
for a router.
Nick
/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/