Difference between revisions of "Network profiles"

From ArchWiki
Jump to navigation Jump to search
(Redirecting to Network Profiles)
(fix double redirect)
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
#REDIRECT [[Network Profiles]]
#REDIRECT [[Wireless network configuration]]
[[Category:Communication and network (English)]]
[[Category:HOWTOs (English)]]
{{i18n_entry|English|Network profiles}}
{{i18n_entry|Русский|Сетевые профили}}
By creating network profiles, you can easily select different network configurations at boot or at run time from the console.
== Setting up the profiles ==
As root: Duplicate the sample profile at /etc/network-profiles/, and save it as a describing name:
cd /etc/network-profiles
cp ./template home
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.
Using the profile below is equal to using:
iwconfig eth1 essid home_wlan key F4DE214AA8
dhcpcd -s eth1
And here the profile script:
DESCRIPTION="Wireless profile at home"
# Network Settings
# Interface Settings (use IFOPTS="dhcp" for DHCP)
# Wireless Settings (optional)
IWOPTS="essid $ESSID key $KEY"
Create as many different profiles as you need.
Last, be sure to comment out any entry in your rc.conf related to network interfaces other than "lo": the lines with eth0="", gateway="" and ROUTES=() should be commented, while:
== Select profile at boot time using GRUB ==
Selecting a certain profile at boot time is handy, and is easily accomplished using [[GRUB]].
Edit the /boot/grub/menu.lst, duplicate your standard boot section and add NET=<profile name> to the kernel line e.g:
# (0) Arch Linux
title  Arch Linux (Standard) [/boot/vmlinuz26]
root  (hd0,0)
kernel /vmlinuz26 root=/dev/sda3 ro vga=794
initrd /kernel26.img
# (1) Arch Linux
title  Arch Linux (Wireless at home) [/boot/vmlinuz26]
root  (hd0,0)
kernel /vmlinuz26 root=/dev/sda3 ro vga=794 NET=home
initrd /kernel26.img
== Select profile at boot time using dialog ==
You can select network profile using the dialog package. Simply edit /etc/rc.conf file and comment out the line:
Remind that there is a 5 secs timeout for the dialog menu, after which the first profile in alphabetical order is enabled.
== Change profile at run time ==
If you want to change the profile after boot, simply type
netcfg home

Latest revision as of 11:33, 13 February 2014