Repository : http://git.fedorahosted.org/cgit/docs/networking-guide.git
On branch : master
commit 4b790d0e20bf24ad1f3a8e47418c80c0fe8e713e Author: Stephen Wadeley swadeley@redhat.com Date: Sun Sep 14 18:43:47 2014 +0200
Configuring a Network Interface Using ip Commands
en-US/Configure_Networking.xml | 41 ++++++++++++++++++++++++++++++++++++++++ 1 files changed, 41 insertions(+), 0 deletions(-)
diff --git a/en-US/Configure_Networking.xml b/en-US/Configure_Networking.xml index 213ae57..248864f 100644 --- a/en-US/Configure_Networking.xml +++ b/en-US/Configure_Networking.xml @@ -1602,6 +1602,47 @@ Optionally specify the hardware or MAC address using the <command>HWADDR</comman </para> </section>
+ <section id="sec-Configuring_a_Network_Interface_Using_ip_commands"> +<title>Configuring a Network Interface Using ip Commands</title> +<para> + The <application>ip</application> utility can be used to assign <systemitem class="protocol">IP</systemitem> addresses to an interface. The command takes the following form: +<synopsis>ip addr <optional> add | del </optional> <replaceable>address</replaceable> dev <replaceable>ifname</replaceable></synopsis></para> + + <bridgehead id="bh-Assigning_a_Static_Address_Using_ip_Commands"> + Assigning a Static Address Using ip Commands + </bridgehead> + <para> +To assign an <systemitem class="protocol">IP</systemitem> address to an interface, issue a command as <systemitem class="username">root</systemitem> as follows: +<screen>~]# <command>ip address add 10.0.0.3/24 dev eth0</command> +The address assignment of a specific device can be viewed as follows: +~]# <command>ip addr show dev eth0</command> +2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 + link/ether f0:de:f1:7b:6e:5f brd ff:ff:ff:ff:ff:ff + inet 10.0.0.3/24 brd 10.0.0.255 scope global global eth0 + valid_lft 58682sec preferred_lft 58682sec + inet6 fe80::f2de:f1ff:fe7b:6e5f/64 scope link + valid_lft forever preferred_lft forever</screen> + Further examples and command options can be found in the <filename>ip-address(8)</filename> manual page. +</para> + + <bridgehead id="bh-Configuring_Multiple_Addresses_Using_ip_Commands"> + Configuring Multiple Addresses Using ip Commands + </bridgehead> + <para> + As the <application>ip</application> utility supports assigning multiple addresses to the same interface it is no longer necessary to use the alias interface method of binding multiple addresses to the same interface. The <application>ip</application> command to assign an address can be repeated multiple times in order to assign multiple address. For example: + <screen>~]# <command>ip address add 192.168.2.223/24 dev eth1</command> +~]# <command>ip address add 192.168.4.223/24 dev eth1</command> +~]# <command>ip addr</command> +3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 + link/ether 52:54:00:fb:77:9e brd ff:ff:ff:ff:ff:ff + inet 192.168.<emphasis role="bold">2</emphasis>.223/24 scope global eth1 + inet 192.168.<emphasis role="bold">4</emphasis>.223/24 scope global eth1</screen> + </para> + <para>The commands for the <application>ip</application> utility are documented in the <filename>ip(8)</filename> manual page. Note that <application>ip</application> commands given on the command line will not persist after a system restart. + </para> + + </section> + <section id="sec-Static-Routes_and_the_Default_Gateway"> <title>Static Routes and the Default Gateway</title> <para>
docs-commits@lists.fedoraproject.org