# Automatically configuring network on a "liveusb" install

## malern

I'm trying to create a installation of Gentoo that I can boot from a usb stick. I want it to be able to automatically configure the network no matter what machine it's plugged into.

My first problem is that udev remembers the different NICs it sees in different machines, and I end up with a lot of entries in my 70-persistent-net.rules file. Is there a way to prevent udev from doing this? Ideally I just want the first NIC it finds to be eth0, the second to be eth1 etc. A post at the end of this bug report says there is a switch to prevent it, but I can't find any documentation on what it might be.

My second problem is how to run dhcp on every interface that is found. I'm thinking I could just add /etc/init.d/net.eth[0-4] to the default runlevel (as it's unlikely I'll be using any machines with more than 5 NICs), but is there a better way?

Any other tips from people that have done something similar before would be appreciated.

----------

## Rexilion

From udev's ebuild:

	# requested in Bug #225033:

	elog

	elog "persistent-net does assigning fixed names to network devices."

	elog "If you have problems with the persistent-net rules,"

	elog "just delete the rules file"

	elog "\trm ${ROOT}etc/udev/rules.d/70-persistent-net.rules"

	elog "and then reboot."

	elog

	elog "This may however number your devices in a different way than they are now."

That help?

----------

## malern

That looks like it'll solve my first problem, thanks! I guess I'll have to remember to remove that file each time I update udev, but I can live with that.

----------

## Rexilion

You don't need to remember, just add:

PORTAGE_ELOG_SYSTEM="save:*"

To your make.conf

This will save all these kind of messages inside:

/var/log/portage/elog

Then you can use a program like (for example):

app-portage/elogviewer-0.5.2-r2

or just do

cd /var/log/portage/elog

for i in `ls`; do echo ">>>>>"$i"<<<<<"; cat $i ; done | more

to view these files.

You just need to learn yourself to view these files whenever your install Gentoo.

A better way is to do this once, and then just closely watch what portage says if you start updating/installing afterwards.

----------

## malern

Ah, thanks for the tip. The problem is that I'll forget that I wanted to disable the persistent net rules in the first place, my memory is very bad  :Smile:  But it's easily fixed when I do remember, so I'm not worried.

----------

