Академический Документы
Профессиональный Документы
Культура Документы
Configuring Network
From ArchWiki
Contents
1 Check first 2 Set the host name 3 Device Driver 3.1 Check Driver Status 3.2 Load the device module 4 Network Interfaces 4.1 Persistent Device Names 4.2 Get Current Device Names 4.3 Enable/disable interface 5 Configure the IP address 5.1 Dynamic IP address 5.1.1 Manually run DHCP 5.1.2 Run DHCP at booting 5.2 Static IP address 5.2.1 Manual assignment 5.2.2 Calculating Addresses 6 Load configuration 7 Additional settings 7.1 ifplugd for laptops 7.2 Bonding or LAG 7.3 IP address aliasing 7.3.1 Example 7.4 Change MAC/hardware address 8 Troubleshooting 8.1 Swapping computers on the cable modem 8.2 The TCP window scaling issue 8.2.1 How to diagnose the problem 8.2.2 How to fix it (The bad way) 8.2.3 How to fix it (The good way) 8.2.4 How to fix it (The best way) 8.2.5 More about it 8.3 Realtek no link / WOL issue 8.3.1 Method 1 - Rollback/change Windows driver 8.3.2 Method 2 - Enable WOL in Windows driver 8.3.3 Method 3 - Newer Realtek Linux driver 8.3.4 Method 4 - Enable LAN Boot ROM in BIOS/CMOS 8.4 DLink G604T/DLink G502T DNS issue 8.4.1 How to diagnose the problem 8.4.2 How to fix it 8.4.3 More about it
https://w iki.archlinux.org/index.php?title=C onfiguring_N etw ork&printable=y es
Summary A simple guide for setting up and troubleshooting network. Overview Arch Linux provides two network management options: network and netcfg. The network daemon is a simple and straightforward solution for wired desktops and servers. Wireless networking requires additional configuration. The netcfg script provides roaming support for mobile users and facilitates management of network profiles; NetworkManager and Wicd are popular alternatives. Related Jumbo Frames Firewalls Samba Wireless Setup
1/15
11/08/12
8.5 Check DHCP problem by releasing IP first 8.6 Realtek 8111E loses lots of packets/dmesg is flooded with link messages
Check first
Many times, the basic installation procedure has created a working network configuration. To check if this is so, use the following command:
pn - 3wwgol.o ig c w.ogecm PN wwlgol.o (4152416 5(4 btso dt. IG w..ogecm 7.2.2.4) 68) ye f aa 6 btsfo 7.2.2.4:im_e= tl5 tm=3 m 4 ye rm 4152416 cprq1 t=0 ie47 s 6 btsfo 7.2.2.4:im_e= tl5 tm=8 m 4 ye rm 4152416 cprq2 t=0 ie35 s 6 btsfo 7.2.2.4:im_e= tl5 tm=9 m 4 ye rm 4152416 cprq3 t=0 ie28 s --wwlgol.o pn saitc -w..ogecm ig ttsis 3pcestasitd 3rcie,0 pce ls,tm 19m akt rnmte, eevd % akt os ie 99s rtmnagmxme =2817336247225.1 m t i/v/a/dv 9.0/7.4/3.0/745 s
Tip: The - 3 options instruct p n to do so three times. See m n p n for more information. c ig a ig If it works, then you may only wish to personalize your settings from the options below. If the previous command complains about unknown hosts, it means that your machine was unable to resolve this domain name. It might be related to your service provider or your router/gateway. You can try pinging a static IP address to prove that your machine has access to the Internet.
pn - 38888 ig c ... PN 8888(...)5(4 btso dt. IG ... 8888 68) ye f aa 6 btsfo 8888 im_e= tl5 tm=29m 4 ye rm ...: cprq1 t=3 ie5. s 6 btsfo 8888 im_e= tl5 tm=25m 4 ye rm ...: cprq2 t=3 ie7. s 6 btsfo 8888 im_e= tl5 tm=06m 4 ye rm ...: cprq3 t=3 ie7. s --8888pn saitc -... ig ttsis 3pcestasitd 3rcie,0 pce ls,tm 20m akt rnmte, eevd % akt os ie 02s rtmnagmxme =5.7/5357.4/.0 m t i/v/a/dv 2956.7/253883 s
Tip: 8.8.8.8 is a static address that is easy to remember. It is the address of Google's primary DNS server, therefore it can be considered reliable, and is generally not blocked by content filtering systems and proxies. If you are able to ping this address, you may try adding this nameserver to your resolv.conf file.
11/08/12
Simply put your host name in to / t / o t a e ( a c l n x is the host name in this example): echsnm rhiu
aclnx rhiu
After setting a host name, it is also important to include the same host name in / t / o t . This will help echss processes that refer to the computer by its host name to find its IP address, as well as programs that rely on the g t o t a e ) system call to determine the system's host name. ehsnm( Edit / t / o t and add the same HOSTNAME you entered in / t / o t a e: echss echsnm
17001 2... aclnxdmi.r rhiu.oanog lclotlcloan oahs.oadmi lclot oahs aclnx rhiu
Note: The fully qualified domain name (FQDN) should be the first item following the IP address. All of the names on the right side are just aliases for the left-most host/domain name. You can check if this has been properly configured by running h s n m - f d . otae -qn To set the host name temporarily (until the next reboot) use the h s n m command from package otae i e u i s ( t p : / w . r h i u . r / a k g s ? a e i e u i s as root: nttl hts/wwaclnxogpcae/nm=nttl)
hsnm aclnx otae rhiu
Device Driver
Check Driver Status
Udev should detect your network interface card (NIC) module and load it automatically at start up. Check the "Ethernet controller" entry in the output of l p i - . It should tell you which kernel module contains the sc v driver of your network device. For example:
lpisc v 0:00Ehre cnrle:Atni Tcnlg Cr.L GgbtEhre Aatr(e b) 20. tent otolr tasc ehooy op 1 iai tent dpe rv 0 .. . Kre die i ue al enl rvr n s: t1 Kre mdls al enl oue: t1
Next, check that the driver was loaded via dmesg | grep <module name>. For example:
deg|rpal ms ge t1 .. . al 00:20.:eh ln i u 10Mp fl dpe t1 000:00 t0 ik s p 0 bs ul ulx
If driver loads success, skip this section. Otherwise, you will need to know which module is needed for your particular model.
11/08/12
Google for the right module/driver for the chip. Once you know which module to use, you can load it with:
#mdrb <oueae opoe mdlnm>
If udev is not detecting and loading the proper module automatically during bootup, you can add it into the M D L S array in / t / c c n so you do not need to m d r b it everytime you boot. For example, if OUE ecr.of opoe t 3 is the network module: g
MDLS(. t3sdcic .. OUE=.. g n-mpi .)
Other common modules are 8139too for cards with the Realtek chipset or s s 0 for SiS cards. i90
Network Interfaces
Persistent Device Names
For motherboards that have integrated NICs, it is important to know which one is considered the primary NIC (e.g., eth0) and which is considered the secondary NIC (e.g., eth1). Many configuration issues are caused by users incorrectly configuring eth0 in their / t / c c n , when in fact, they have their Ethernet cable plugged ecr.of into eth1. Udev is responsible for which device gets which name. With Udev and modular network drivers, the network interface numbering is not persistent across reboots by default, because the drivers are loaded in parallel and, thus, in random order. Configuring your network connection is hard if you do not know if your card will be called e h or e h . You can fix this using i r n m , see Rename network interfaces. It is also possible t0 t1 feae to manually create udev rules that assign interface names based on the interface's MAC address. See Persistent Device Names.
Enable/disable interface
You can activate or deactivate net interface:
i ln st<nefc>u/on p ik e itrae pdw
4/15
11/08/12
Dynamic IP address
Manually run DHCP
dcc eh hpd t0 dcc:vrin511satn hpd eso .. trig dcc:eh:bodatn fralae hpd t0 racsig o es .. . dcc:eh:lae 121817 fr840scns hpd t0 esd 9.6..0 o 60 eod
And now i a d s o d v < n e f c > should show your inet address. p dr hw e itrae For some people, the d c i n package (available in [extra]) works where d c c fails. hlet hpd Run DHCP at booting For this option, you need the d c c ( t p : / w . r h i u . r / a k g s ? a e d c c ) hpd hts/wwaclnxogpcae/nm=hpd package (already available on most installations). To make use of it, edit / t / c c n like this: ecr.of
itrae"t0 nefc=eh" ades drs= ntak ems= gtwy aea=
Only the interface has to be defined, as leaving the other options blank will set network to DHCP. If you use DHCP and you do not want your DNS servers automatically assigned every time you start your network, be sure to add the following to the last section of / t / h p d c n : ecdcc.of
nho rsl.of ook eovcn
Then add your own DNS nameserver to / t / e o v c n . ecrsl.of You may use the o e r s l ( t p : / w . r h i u . r / a k g s ? a e o e r s l ) pneov hts/wwaclnxogpcae/nm=pneov package if several different processes want to control / t / e o v c n (e.g., d c c ecrsl.of hpd ( t p : / w . r h i u . r / a k g s ? a e d c c ) and a VPN client). No additional hts/wwaclnxogpcae/nm=hpd
https://w iki.archlinux.org/index.php?title=C onfiguring_N etw ork&printable=y es 5/15
11/08/12
configuration for d c c ( t p : / w . r h i u . r / a k g s ? a e d c c ) is needed to use hpd hts/wwaclnxogpcae/nm=hpd oersl (tp:/w.rhiu.r/akgs?aeoersl). pneov hts/wwaclnxogpcae/nm=pneov Note: It is possible to have a static IP address using d c c hpd
(tp:/w.rhiu.r/akgs?aedcc). hts/wwaclnxogpcae/nm=hpd
Simply edit your / t / o f d d c c file to look something like this (where x.x.x.x is your desired IP address): eccn./hpd DHCPCD_ARGS="-q -s x.x.x.x"
Static IP address
There are various reasons why you may wish to assign static IP addresses on your network. For instance, one may gain a certain degree of predictability. Or you may not want the dhcp daemon running all the time. Note: If you share your Internet connection from a Windows box without a router, be sure to use static IP addresses on both computers to avoid LAN issues. You need: Static IP address, Subnet mask, Broadcast address, Gateway's IP address, Name servers' IP addresses, Domain name (unless a local LAN, in which case you can make it up). If you are running a private network, it is safe to use IP addresses in 192.168.*.* for your IP addresses, with a netmask of 255.255.255.0 and a broadcast address of 192.168.*.255. Unless your network has a router, the gateway IP address does not matter. Edit / t / c c n like this, substituting your own values for the IP ecr.of address, netmask, broadcast, and gateway:
itraeeh nefc=t0 ades121802 drs=9.6.. ntak2525250 ems=5.5.5. bodat1218125 racs=9.6..5 gtwy12182. aea=9.6.21
Edit your / t / e o v c n like this, substituting your name servers' IP addresses and your local domain ecrsl.of name:
nmsre 6.3135 aeevr 12.7. nmsre 6.5898 aeevr 19.4. sac eapecm erh xml.o
Note: Currently, you may include a maximum of 3 n m s r e lines. aeevr Manual assignment You can assign a static IP address in the console:
https://w iki.archlinux.org/index.php?title=C onfiguring_N etw ork&printable=y es 6/15
11/08/12
For example:
#i ad ad1218122 dveh p dr d 9.6../4 e t0
If you the get the error "No such process",it means you need to do # ifconfig eth0 up Calculating Addresses You can use ipcalc provided by the ipcalc package to calculate IP broadcast, network, netmask, and host ranges for more advanced configurations. For example, I use ethernet over firewire to connect a windows machine to arch. For security and network organization, I placed them on their own network and configured the netmask and broadcast so that they are the only 2 machines on it. To figure out the netmask and broadcast addresses for this, I used ipcalc, providing it with the IP of the arch firewire nic 10.66.66.1, and specifying ipcalc should create a network of only 2 hosts.
$icl -b1.66. - 1 pac n 06.61 s Ades drs: 1.66. 06.61
Ntak ems: 25252522=3 5.5.5.5 0 Ntok ewr: 1.66./0 06.603 HsMn oti: 1.66. 06.61 HsMx ota: 1.66. 06.62 Bodat 1.66. racs: 06.63 HssNt 2 ot/e: CasA PiaeItre ls , rvt nent
Load configuration
To test your settings either reboot the computer, or as root:
r. rsatntok cd etr ewr
Try pinging your gateway, DNS server, ISP provider and other Internet sites, in that order, to detect any connection problems along the way, as in this example:
https://w iki.archlinux.org/index.php?title=C onfiguring_N etw ork&printable=y es 7/15
11/08/12
pn - 3wwgol.o ig c w.ogecm
Additional settings
ifplugd for laptops
i p u d ( t p : / w . r h i u . r / a k g s ? a e i p u d in Official Repositories is a flg hts/wwaclnxogpcae/nm=flg)
daemon which will automatically configure your Ethernet device when a cable is plugged in and automatically unconfigure it if the cable is pulled. This is useful on laptops with onboard network adapters, since it will only configure the interface when a cable is really connected. Another use is when you just need to restart the network but do not want to restart the computer or do it from the shell. By default it is configured to work for the e h device. This and other settings like delays can be configured in t0 / t / f l g / f l g . o f. ecipudipudcn Start the ifplugd daemon and add i p u d to your DAEMONS array so it starts automatically on boot. flg
Bonding or LAG
You will need n t f ( t p : / w . r h i u . r / a k g s ? a e n t f ) from the Official ecg hts/wwaclnxogpcae/nm=ecg Repositories, as well as the n t f - o d n ( t p : / u . r h i u . r / a k g s p p ecgbnig hts/araclnxogpcae.h? K n t f - o d n & e = ) package from the AUR. =ecgbnigSBx Edit/create the following files:
/t/ewr./odd ecntokdbne CNETO=bnig ONCIN"odn" ITRAE"od" NEFC=bn0 SAE=eh eh" LVS"t0 t1 I=dc" P"hp DC_IEU=0 HPTMOT1
/t/ccn ecr.of MDLS(. bnig.. OUE=.. odn .) .. . itraebn0#omn ohrlns(drs,ems,aea,.) nefc=od cmet te ie adesntakgtwy.. .. . NTOK=..bne .. EWRS(. odd .) .. . DEOS(. ntpoie .. #elc ntok AMN=.. e-rfls .) rpae ewr
Note: To change the bonding mode (default is round robin) to, e.g, dynamic link aggregation: Create / t / o p o e d b n i g c n : ecmdrb./odn.of
/t/opoedbnigcn ecmdrb./odn.of otosbnigmd= pin odn oe4 otosbnigmio=0 pin odn imn10
https://w iki.archlinux.org/index.php?title=C onfiguring_N etw ork&printable=y es 8/15
11/08/12
For more information about the different bonding policies (and other driver settings) see the Linux Ethernet Bonding Driver HOWTO (http://sourceforge.net/projects/bonding/files/Documentation/) . To activate the new bonded ports modprobe b n i g, stop n t o k and start the n t p o i e odn ewr e-rfls service:
#mdrb bnig opoe odn #r. so ntok cd tp ewr #r. satntpoie cd tr e-rfls
IP address aliasing
If you want to use multiple IP addresses on an interface, you will have to use netcfg and its P S _ P and OTU P E D W commands in your network profile to set up the additional IP addresses manually. See here R_ON (https://bbs.archlinux.org/viewtopic.php?pid=1036395#p1036395) for details. Example You will need n t f ( t p : / w . r h i u . r / a k g s ? a e n t f ) from the Official ecg hts/wwaclnxogpcae/nm=ecg Repositories. Prepare configuration
/t/ewr./yewr ecntokdmntok
CNETO=ehre' ONCIN'tent DSRPIN'iedfeetadesso tesm NC' ECITO=Fv ifrn drse n h ae I. ITRAE't0 NEFC=eh' I=sai' P'ttc AD=121811' DR'9.6..0 GTWY'9.6..' AEA=121811 DS(121811) N='9.6..' DMI=' OAN' PS_P'=;frii 1 1 1 1;d i ad ad12181$/4bd1218125dveh lble OTU=x0 o n 1 2 3 4 o p dr d 9.6..i2 r 9.6..5 e t0 ae PEDW=frii 1 1 1 1;d i ad dl12181$/4dveh;dn' R_ON'o n 1 2 3 4 o p dr e 9.6..i2 e t0 oe
11/08/12
Changing your MAC address is not possible anymore via / t / c c n . See MAC Address Spoofing for ecr.of details.
Troubleshooting
Swapping computers on the cable modem
Most domestic cable ISPs (videotron for example) have the cable modem configured to recognize only one client PC, by the MAC address of its network interface. Once the cable modem has learned the MAC address of the first PC or equipment that talks to it, it will not respond to another MAC address in any way. Thus if you swap one PC for another (or for a router), the new PC (or router) will not work with the cable modem, because the new PC (or router) has a MAC address different from the old one. To reset the cable modem so that it will recognise the new PC, you must power the cable modem off and on again. Once the cable modem has rebooted and gone fully online again (indicator lights settled down), reboot the newly connected PC so that it makes a DHCP request, or manually make it request a new DHCP lease. If this method does not work, you will need to clone the MAC address of the original machine. See also Change MAC/hardware address.
11/08/12
You can try to use Wireshark. You might see successful UDP and ICMP communications but unsuccessful TCP communications (only to foreign hosts). How to fix it (The bad way) To fix it the bad way, you can change the tcp_rmem value, on which Scale Factor calculation is based. Although it should work for most hosts, it is not guaranteed, especially for very distant ones.
eh "06830146">/rcssntiv/c_mm co 49 78 770 po/y/e/p4tpre
How to fix it (The good way) Simply disable Window Scaling. Since Window Scaling is a nice TCP feature, it may be uncomfortable to disable it, especially if you cannot fix the broken router. There are several ways to disable Window Scaling, and it seems that the most bulletproof way (which will work with most kernels) is to add the following line to / t / y c l c n (see also sysctl) ecsst.of
ntiv.c_idwsaig=0 e.p4tpwno_cln
How to fix it (The best way) This issue is caused by broken routers/firewalls, so let's change them. Some users have reported that the broken router was their very own DSL router. More about it This section is based on the LWN article TCP window scaling and broken routers (http://lwn.net/Articles/92727/) and a Kernel Trap article: Window Scaling on the Internet (http://kerneltrap.org/node/6723) . There are also several relevant threads on the LKML.
11/08/12
Method 2 - Enable WOL in Windows driver Probably the best and the fastest fix is to change this setting in the Windows driver. This way it should be fixed system-wide and not only under Arch (eg. live CDs, other operative systems). In Windows, under Device Manager, find your Realtek network adapter and double-click it. Under the Advanced tab, change "Wake-onLAN after shutdown" to Enable.
I WnosX (xml) n idw P eape Rgtcikm cmue ih lc y optr ->Hrwr tb adae a ->Dvc Mngr eie aae ->NtokAatr ewr dpes ->"obecik Ratk.. dul lc" ele . ->Avne tb dacd a ->Wk-nLnAtrSudw aeO-a fe hton ->Eal nbe
Note: Newer Realtek Windows drivers (tested with Realtek 8111/8169 LAN Driver v5.708.1030.2008, dated 2009/01/22, available from GIGABYTE) may refer to this option slightly differently, like Shutdown Wake-On-LAN --> Enable. It seems that switching it to D s b e has no effect (you will notice the Link ial light still turns off upon Windows shutdown). One rather dirty workaround is to boot to Windows and just reset the system (perform an ungraceful restart/shutdown) thus not giving the Windows driver a chance to disable LAN. The Link light will remain on and the LAN adapter will remain accessible after POST - that is until you boot back to Windows and shut it down properly again. Method 3 - Newer Realtek Linux driver Any newer driver for these Realtek cards can be found for Linux on the realtek site. (untested but believed to also solve the problem). Method 4 - Enable LAN Boot ROM in BIOS/CMOS It appears that setting Integrated Peripherals --> Onboard LAN Boot ROM --> Enabled in BIOS/CMOS reactivates the Realtek LAN chip on system boot-up, despite the Windows driver disabling it on OS shutdown.
This was tested successfully multiple times with GIGABYTE system board GA-G31M-ES2L with BIOS version F8 released on 2009/02/05. YMMV.
11/08/12
Firstly, enable wget for pacman (since it gives us info about pacman when it is downloading packages) Open / t / a m n c n with your favourite editor and uncomment the following line (remove the # if it is there) ecpca.of
XeCmad/s/i/gt-psiefp- - % % fromn=urbnwe -asv-t c O o u
While you are editing / t / a m n c n , check the default mirror that pacman uses to download packages. ecpca.of Now open up the default mirror in an Internet browser to see if the mirror actually works. If it does work, then do p c a - y (otherwise pick another working mirror and set it to the pacman default). If you get amn Sy something similar to the following (notice the 1.0.0.0),
fp/mro.aii.e.ulnxaclnxetao/66etad.a.z t:/irrpcfcnta/iu/rhiu/xr/si8/xr.btrg = `vrlbpca/omnt.btrg.at > /a/i/amncmuiyd.a.zpr' Rsligmro.aii.e.u. 1000 eovn irrpcfcnta.. ...
then you most likely have this problem. The 1.0.0.0 means it is unable to resolve DNS, so we must add it to /t/eovcn . ecrsl.of How to fix it Basically what we need to do is to manually add the DNS servers to our / t / e o v c n file. The ecrsl.of problem is that DHCP automatically deletes and replaces this file on boot, so we need to edit / t / o f d d c c and change the flags to stop DHCP from doing this. eccn./hpd When you open / t / o f d d c c , you should see something close to the following: eccn./hpd
DCC_RS"t3 - $OTAE HPDAG=0 h HSNM"
Note: If you are using d c c ( t p : / w . r h i u . r / a k g s ? a e d c c ) >= 4.0.2, hpd hts/wwaclnxogpcae/nm=hpd the - flag has been deprecated. Please see the #For DHCP assigned IP address section for information on R how to use a custom / t / e o v c n file. ecrsl.of Save and close the file; now open / t / e o v c n . You should see a single nameserver (most likely ecrsl.of 10.1.1.1). This is the gateway to your router, which we need to connect to in order to get the DNS servers of your ISP. Paste the IP address into your browser and log in to your router. Go to the DNS section, and you should see an IP address in the Primary DNS Server field; copy it and paste it as a nameserver ABOVE the current gateway one. E.g., / t / e o v c n should look something along the lines of ecrsl.of
nmsre 1... aeevr 0111
13/15
11/08/12
Now restart the network daemon by doing r . r s a t n t o k and do p c a - y . If it syncs cd etr ewr amn Sy correctly with the server, then the problem is solved. More about it This is the whirlpool forum (Australian ISP community) which talks about and gives the same solution to the problem
ht:/ouswilolnta/ou-ele-rhv.f/665hm tp/frm.hrpo.e.ufrmrpisaciecm412.tl
0:00Ehre cnrle:RatkSmcnutrC. Ld RL1186BPIEpesGgbtEhr 30. tent otolr ele eiodco o, t. T81/18 C xrs iai ten
you are using a bad r8169 driver. To fix this, install the r 1 8 86
( t p : / u . r h i u . r / a k g s p p K r 1 8 S B x package from the AUR, hts/araclnxogpcae.h?=86&e=)
https://w iki.archlinux.org/index.php?title=C onfiguring_N etw ork&printable=y es
blacklist the
14/15
11/08/12
r8169 kernel module, and reboot in order to fix the issue. Supposedly there is a fix for this in Linux 3.0. Source: http://forums.gentoo.org/viewtopic-t-881217-start-0.html Retrieved from "https://wiki.archlinux.org/index.php?title=Configuring_Network&oldid=216308" Categories: Networking Getting and installing Arch This page was last modified on 3 August 2012, at 12:02. Content is available under GNU Free Documentation License 1.3 or later.
15/15