Difference between revisions of "Network profiles"

From ArchWiki
Jump to: navigation, search
(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...)
 
(i18n links added, spelling, selecting profile using dialog added)
Line 1: Line 1:
 
[[Category:Communication and network (English)]]
 
[[Category:Communication and network (English)]]
 
[[Category:HOWTOs (English)]]
 
[[Category:HOWTOs (English)]]
 +
 +
{{i18n_links_start}}
 +
{{i18n_entry|English|Network profiles}}
 +
{{i18n_entry|Русский|Сетевые профили}}
 +
{{i18n_links_end}}
 +
 
By creating network profiles, you can easily select different network configurations at boot or at run time from the console.
 
By creating network profiles, you can easily select different network configurations at boot or at run time from the console.
==Setting up the profiles==
+
== Setting up the profiles ==
 
As root: Duplicate the sample profile at /etc/network-profiles/, and save it as a describing name:
 
As root: Duplicate the sample profile at /etc/network-profiles/, and save it as a describing name:
 
  cd /etc/network-profiles
 
  cd /etc/network-profiles
Line 26: Line 32:
 
  DHCPCD_ARGS="-s 192.168.1.105"
 
  DHCPCD_ARGS="-s 192.168.1.105"
 
Create as many different profiles as you need
 
Create as many different profiles as you need
==Select profile at boot time using GRUB==
+
== Select profile at boot time using GRUB ==
Selcting a certain profile at boot time is handy, and is easily accomplished 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:
 
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
 
  # (0) Arch Linux
Line 41: Line 47:
 
  initrd /kernel26.img
 
  initrd /kernel26.img
  
==Change profile at run time==
+
== 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:
 +
NET_PROFILES=(menu)
 +
 
 +
== Change profile at run time ==
 
If you want to change the profile after boot, simply type
 
If you want to change the profile after boot, simply type
 
  netcfg home
 
  netcfg home

Revision as of 18:38, 5 August 2007

Template:I18n links start Template:I18n entry Template:I18n entry Template:I18n links end

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 192.168.1.105 eth1

And here the profile script:

DESCRIPTION="Wireless profile at home"

# Network Settings
INTERFACE=eth1
HOSTNAME=myhost

# Interface Settings (use IFOPTS="dhcp" for DHCP)
IFOPTS="dhcp"

# Wireless Settings (optional)
ESSID=home_wlan
KEY=F4DE214AA8
IWOPTS="essid $ESSID key $KEY"
DHCPCD_ARGS="-s 192.168.1.105"

Create as many different profiles as you need

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:

NET_PROFILES=(menu)

Change profile at run time

If you want to change the profile after boot, simply type

netcfg home