https://wiki.archlinux.org/api.php?action=feedcontributions&user=RudderX&feedformat=atomArchWiki - User contributions [en]2024-03-28T15:15:17ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Network_profiles&diff=25415Network profiles2007-06-09T06:08:10Z<p>RudderX: New page: Category:Communication and network (English) Category:HOWTOs (English) By creating network profiles, you can easily select different network configurations at boot or at run time f...</p>
<hr />
<div>[[Category:Communication and network (English)]]<br />
[[Category:HOWTOs (English)]]<br />
By creating network profiles, you can easily select different network configurations at boot or at run time from the console.<br />
==Setting up the profiles==<br />
As root: Duplicate the sample profile at /etc/network-profiles/, and save it as a describing name:<br />
cd /etc/network-profiles<br />
cp ./template home<br />
Now edit this new profile (e.g. home) in your favorite editor (i.e. emacs) to fit your needs. Below is a very simple profile example to connect to a wireless network.<br />
Using the profile below is equal to using:<br />
iwconfig eth1 essid home_wlan key F4DE214AA8<br />
dhcpcd -s 192.168.1.105 eth1<br />
And here the profile script:<br />
DESCRIPTION="Wireless profile at home"<br />
<br />
# Network Settings<br />
INTERFACE=eth1<br />
HOSTNAME=myhost<br />
<br />
# Interface Settings (use IFOPTS="dhcp" for DHCP)<br />
IFOPTS="dhcp"<br />
<br />
# Wireless Settings (optional)<br />
ESSID=home_wlan<br />
KEY=F4DE214AA8<br />
IWOPTS="essid $ESSID key $KEY"<br />
DHCPCD_ARGS="-s 192.168.1.105"<br />
Create as many different profiles as you need<br />
==Select profile at boot time using GRUB==<br />
Selcting a certain profile at boot time is handy, and is easily accomplished using [[GRUB]].<br />
Edit the /boot/grub/menu.lst, duplicate your standard boot section and add NET=<profile name> to the kernel line e.g:<br />
# (0) Arch Linux<br />
title Arch Linux (Standard) [/boot/vmlinuz26]<br />
root (hd0,0)<br />
kernel /vmlinuz26 root=/dev/sda3 ro vga=794<br />
initrd /kernel26.img <br />
<br />
# (1) Arch Linux<br />
title Arch Linux (Wireless at home) [/boot/vmlinuz26]<br />
root (hd0,0)<br />
kernel /vmlinuz26 root=/dev/sda3 ro vga=794 NET=home<br />
initrd /kernel26.img<br />
<br />
==Change profile at run time==<br />
If you want to change the profile after boot, simply type<br />
netcfg home</div>RudderX