Networking Guide Red Hat Enterprise Linux 7

Transcription

Red Hat Enterprise Linux 7Networking GuideConfiguration and Administration of networking for Red Hat EnterpriseLinux 7Stephen WadeleyChristian Huffman

Red Hat Enterprise Linux 7 Networking GuideConfiguration and Administration of networking for Red Hat EnterpriseLinux 7Stephen WadeleyRed Hat Custo mer Co ntent Servicesswadeley@redhat.co mChristian HuffmanRed Hat Custo mer Co ntent Serviceschuffman@redhat.co m

Legal NoticeCo pyright 20 10 –20 15 Red Hat, Inc.This do cument is licensed by Red Hat under the Creative Co mmo ns Attributio n-ShareAlike 3.0Unpo rted License. If yo u distribute this do cument, o r a mo dified versio n o f it, yo u must pro videattributio n to Red Hat, Inc. and pro vide a link to the o riginal. If the do cument is mo dified, all RedHat trademarks must be remo ved.Red Hat, as the licenso r o f this do cument, waives the right to enfo rce, and agrees no t to assert,Sectio n 4 d o f CC-BY-SA to the fullest extent permitted by applicable law.Red Hat, Red Hat Enterprise Linux, the Shado wman lo go , JBo ss, MetaMatrix, Fedo ra, the InfinityLo go , and RHCE are trademarks o f Red Hat, Inc., registered in the United States and o therco untries.Linux is the registered trademark o f Linus To rvalds in the United States and o ther co untries.Java is a registered trademark o f Oracle and/o r its affiliates.XFS is a trademark o f Silico n Graphics Internatio nal Co rp. o r its subsidiaries in the UnitedStates and/o r o ther co untries.MySQL is a registered trademark o f MySQL AB in the United States, the Euro pean Unio n ando ther co untries.No de.js is an o fficial trademark o f Jo yent. Red Hat So ftware Co llectio ns is no t fo rmallyrelated to o r endo rsed by the o fficial Jo yent No de.js o pen so urce o r co mmercial pro ject.The OpenStack Wo rd Mark and OpenStack Lo go are either registered trademarks/servicemarks o r trademarks/service marks o f the OpenStack Fo undatio n, in the United States and o therco untries and are used with the OpenStack Fo undatio n's permissio n. We are no t affiliated with,endo rsed o r spo nso red by the OpenStack Fo undatio n, o r the OpenStack co mmunity.All o ther trademarks are the pro perty o f their respective o wners.AbstractThe Red Hat Enterprise Linux 7 Netwo rking Guide do cuments relevant info rmatio n regarding theco nfiguratio n and administratio n o f netwo rk interfaces, netwo rks and netwo rk services in RedHat Enterprise Linux 7. It is o riented to wards system administrato rs with a basic understandingo f Linux and netwo rking. This bo o k is based o n the Red Hat Enterprise Linux 6 Deplo ymentGuide. The chapters related to netwo rking were taken fro m the Deplo yment Guide to fo rm thefo undatio n fo r this bo o k. To expand yo ur expertise, yo u might also be interested in the Red HatSystem Administratio n I (RH124 ) training co urse.

T able of Cont ent sT able of Contents. .art P. . .I. IP. . Net. . . working. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4. . . . . . . . . . .hapt C. . . .er. .1. . Int. . .roduct. . . . . .ion. . .t.o. Red. . . . Hat. . . . Ent. . . erprise. . . . . . .Linux. . . . . Net. . . working. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5. . . . . . . . . . 1.1. Ho w this Bo o k is Struc tured 1.2. IP Netwo rks vers us no n-IP Netwo rks 1.3. Intro d uc tio n to Netwo rkManag er 1.4. Ins talling Netwo rkManag er 1.5. Netwo rk Co nfig uratio n Us ing a Text Us er Interfac e (nmtui) 1.6 . Netwo rk Co nfig uratio n Us ing Netwo rkManag er' s CLI (nmc li) 1.7. Netwo rk Co nfig uratio n Us ing the Co mmand -Line Interfac e (CLI) 1.8 . Netwo rkManag er and the Netwo rk Sc rip ts 1.9 . Netwo rk Co nfig uratio n Us ing s ys c o nfig Files 1.10 . Ad d itio nal Res o urc es555678891011. .hapt C. . . .er. .2. . Configure. . . . . . . . . IP. . Net. . . .working. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1. 3. . . . . . . . . . 2 .1. Static and Dynamic Interfac e Setting s13 2 .2. Us ing the Text Us er Interfac e, nmtui14 2 .3. Us ing the Netwo rkManag er Co mmand Line To o l, nmc li14 2 .4. Us ing the Co mmand Line Interfac e (CLI)25 2 .5. Us ing Netwo rkManag er with the G NO ME G rap hic al Us er Interfac e30 2 .6 . Ad d itio nal Res o urc es53. .hapt C. . . .er. .3. .Configure. . . . . . . . . Host. . . . .Names. 3 .1. Und ers tand ing Ho s t Names 3 .2. Co nfig uring Ho s t Names Us ing 3 .3. Co nfig uring Ho s t Names Us ing 3 .4. Co nfig uring Ho s t Names Us ing 3 .5. Ad d itio nal Res o urc es. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54.54Text Us er Interfac e, nmtui54ho s tnamec tl55nmc li5657. .hapt C. . . .er. .4. . Configure. . . . . . . . . Net. . . work. . . . .Bonding. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58. 4 .1. Und ers tand ing the Default Behavio r o f Mas ter and Slave Interfac es58 4 .2. Co nfig ure Bo nd ing Us ing the Text Us er Interfac e, nmtui58 4 .3. Us ing the Netwo rkManag er Co mmand Line To o l, nmc li63 4 .4. Us ing the Co mmand Line Interfac e (CLI)64 4 .5. Us ing Channel Bo nd ing67 4 .6 . Creating a Bo nd Co nnec tio n Us ing a G UI74 4 .7. Ad d itio nal Res o urc es80. .hapt C. . . .er. .5. .Configure. . . . . . . . . Net. . . work. . . . .T. eaming. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .8. 1. . . . . . . . . . 5 .1. Und ers tand ing Netwo rk Teaming81 5 .2. Und ers tand ing the Default Behavio r o f Mas ter and Slave Interfac es81 5 .3. Co mp aris o n o f Netwo rk Teaming to Bo nd ing82 5 .4. Und ers tand ing the Netwo rk Teaming Daemo n and the " Runners "83 5 .5. Ins tall the Netwo rk Teaming Daemo n83 5 .6 . Co nverting a Bo nd to a Team83 5 .7. Selec ting Interfac es to Us e as Po rts fo r a Netwo rk Team85 5 .8 . Selec ting Netwo rk Team Co nfig uratio n Metho d s85 5 .9 . Co nfig ure a Netwo rk Team Us ing the Text Us er Interfac e, nmtui85 5 .10 . Co nfig ure a Netwo rk Team Us ing the Co mmand Line90 5 .11. Co ntro lling teamd with teamd c tl98 5 .12. Co nfig ure teamd Runners99 5 .13. Creating a Netwo rk Team Us ing a G UI10 6 5 .14. Ad d itio nal Res o urc es1111

Net working G uide. .hapt C. . . .er. .6. . Configure. . . . . . . . . Net. . . work. . . . .Bridging. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1.1. 2. . . . . . . . . . 6 .1. Co nfig ure Brid g ing Us ing the Text Us er Interfac e, nmtui112 6 .2. Us ing the Netwo rkManag er Co mmand Line To o l, nmc li 6 .3. Us ing the Co mmand Line Interfac e (CLI)115117 6 .4. Co nfig ure Netwo rk Brid g ing Us ing a G UI 6 .5. Ad d itio nal Res o urc es120125. .hapt C. . . .er. .7. . Configure. . . . . . . . . 8. 0. .2.1. Q. . VLAN. . . . . .t agging. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1.2. 7. . . . . . . . . . 7 .1. Selec ting VLAN Interfac e Co nfig uratio n Metho d s127 7 .2. Co nfig ure 8 0 2.1Q VLAN tag g ing Us ing the Text Us er Interfac e, nmtui127 7 .3. Co nfig ure 8 0 2.1Q VLAN Tag g ing Us ing the Co mmand Line To o l, nmc li129 7 .4. Co nfig ure 8 0 2.1Q VLAN Tag g ing Us ing the Co mmand Line132 7 .5. Co nfig ure 8 0 2.1Q VLAN Tag g ing Us ing a G UI134 7 .6 . Ad d itio nal Res o urc es136. .hapt C. . . .er. .8. . Consist. . . . . . .ent. . . Net. . . .work. . . . Device. . . . . . Naming. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1. 37. 8 .1. Naming Sc hemes Hierarc hy137 8 .2. Und ers tand ing the Devic e Renaming Pro c ed ure137 8 .3. Und ers tand ing the Pred ic tab le Netwo rk Interfac e Devic e Names138 8 .4. Naming Sc heme fo r Netwo rk Devic es Availab le fo r Linux o n Sys tem z138 8 .5. Naming Sc heme fo r VLAN Interfac es 8 .6 . Co ns is tent Netwo rk Devic e Naming Us ing b io s d evname139139 8 .7. No tes fo r Ad minis trato rs 8 .8 . Co ntro lling the Selec tio n o f Netwo rk Devic e Names140141 8 .9 . Dis ab ling Co ns is tent Netwo rk Devic e Naming 8 .10 . Tro ub les ho o ting Netwo rk Devic e Naming141142 8 .11. Ad d itio nal Res o urc es143. .art P. . .II. .InfiniBand. . . . . . . . . and. . . . RDMA. . . . . .Net. . . working. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1.4. 4. . . . . . . . . . .hapt C. . . .er. .9. . Configure. . . . . . . . . InfiniBand. . . . . . . . . .and. . . .RDMA. . . . . .Net. . .works. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1. 4. 5. . . . . . . . . . 9 .1. Und ers tand ing InfiniBand and RDMA tec hno lo g ies 9 .2. InfiniBand and RDMA related s o ftware p ac kag es145146 9 .3. Co nfig uring the Bas e RDMA Sub s ys tem 9 .4. Co nfig uring the Sub net Manag er147149 9 .5. Tes ting Early InfiniBand RDMA o p eratio n 9 .6 . Co nfig uring IPo IB151154 9 .7. Co nfig ure InfiniBand Us ing the Text Us er Interfac e, nmtui 9 .8 . Co nfig ure IPo IB us ing the c o mmand -line to o l, nmc li156158 9 .9 . Co nfig ure IPo IB Us ing the c o mmand line 9 .10 . Tes ting an RDMA netwo rk after IPo IB is c o nfig ured 9 .11. Co nfig ure IPo IB Us ing a G UI15916 116 1 9 .12. Ad d itio nal Res o urc es16 3. .art P. . .III. . Servers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1.6. 4. . . . . . . . . . .hapt C. . . .er. .1. 0. . DHCP. . . . . .Servers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1. 6. 5. . . . . . . . . . 10 .1. Why Us e DHCP?16 5 10 .2. Co nfig uring a DHCP Server 10 .3. DHCP Relay Ag ent 10 .4. Co nfig uring a Multiho med DHCP Server16 5172173 10 .5. DHCP fo r IPv6 (DHCPv6 ) 10 .6 . Ad d itio nal Res o urc es176176. .hapt C. . . .er. .1. 1. . DNS. . . . .Servers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1.7. 8. . . . . . . . . .2

T able of Cont ent s. .hapt C. . . .er. .1. 1. . DNS. . . . .Servers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1.7. 8. . . . . . . . . . 11.1. Intro d uc tio n to DNS178 11.2. BIND179. .ppendix A. . . . . . . A. . Revision. . . . . . . . .Hist. . . ory. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2. 0. 5. . . . . . . . . . A .1. Ac kno wled g ments20 5 I.ndex. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2. 0. 5. . . . . . . . . .3

Net working G uide Part I. IP NetworkingThis part describes how to configure the network on Red Hat Enterprise Linux.4

Chapt er 1 . Int roduct ion t o Red Hat Ent erprise Linux Net workingChapter 1. Introduction to Red Hat Enterprise Linux Networking1.1. How t his Book is St ruct uredAll new material in this book has been written and arranged in such a way as to clearly separateintroductory material, such as explanations of concepts and use cases, from configuration tasks.Red Hat Engineering Content Services hope that you can quickly find configuration instructions youneed, while still providing some relevant explanations and conceptual material to help youunderstand and decide on the appropriate tasks relevant to your needs. Where material has beenreused from the Red Hat Enterprise Linux 6 Deployment Guide, it has been reviewed and changed,where possible, to fit this idea of separating concepts from tasks.The material is grouped according to the goal rather than the method. Instructions on how to achievea specific task using different methods are grouped together. This is intended to make it easier foryou to find the information on how to achieve a particular task or goal, and at the same time allowyou to quickly see the different methods available.In each chapter, the configuration methods will be presented in the following order:the text user interface tool, n mt u i,N et wo rkMan ag er's command-line tool n mcli,other command-line methods and the use of configuration files,a graphical user interface (GUI) method, such as the use of n m- co n n ect io n - ed it o r orco n t ro l- n et wo rk to direct Netwo rkManag er.The command line can be used to issue commands, hence the term command-line interface (CLI)however the command line can also start an editor, to compose or edit configuration files. Thereforethe use of ip commands and configuration files, such as i fcfg files, will be documented together.1.2. IP Net works versus non-IP Net worksMost modern networks fall into one of two very broad categories: IP based networks. These are allnetworks that communicate via Internet Protocol addresses, which is the standard for the Internet andfor most internal networks today. This generally includes Ethernet, Cable Modems, D SL Modems, dialup modems, Wi-Fi, VPN connections and more.Then there are non-IP based networks. These are usually very specific niche networks, but one inparticular has grown in usage enough to warrant mention here and that is InfiniBand. BecauseInfiniBand is not an IP network, many features and configurations normally used on IP networks arenot applicable to InfiniBand. Chapter 9, Configure InfiniBand and RDMA Networks in this guide coversthe specific requirements of configuring and administrating an InfiniBand network and also thebroader class of RD MA capable devices.1.3. Int roduct ion t o

7.1. Selecting VLAN Interface Configuration Methods 7.2. Configure 802.1Q VLAN tagging Using the Text User Interface, nmtui 7.3. Configure 802.1Q VLAN Tagging Using the Command Line Tool, nmcli 7.4. Configure 802.1Q VLAN Tagging Using the Command Line 7.5. Configure 802.1Q VLAN Tagging Using a GUI 7.6. Additional Resources