Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Linux Networking Cookbook

You're reading from  Linux Networking Cookbook

Product type Book
Published in Jun 2016
Publisher
ISBN-13 9781785287916
Pages 152 pages
Edition 1st Edition
Languages
Concepts
Authors (2):
Agnello Dsouza Agnello Dsouza
Gregory Boyce Gregory Boyce
Profile icon Gregory Boyce
View More author details

Table of Contents (19) Chapters

Linux Networking Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
1. Configuring a Router 2. Configuring DNS 3. Configuring IPv6 4. Remote Access 5. Web Servers 6. Directory Services 7. Setting up File Storage 8. Setting up E-mail 9. Configuring XMPP 10. Monitoring Your Network 11. Mapping Your Network 12. Watching Your Network Index

Configuring IPv4 permanently


In the previous section we configured the network interface, but this configuration is only valid while the system is up and running. A reboot will clear this configuration, unless you take steps to make sure that it is configured on each boot. This configuration will be specific to the distribution that you are running, although most distributions fall under either the Debian or Red Hat methods.

How to do it…

Let' see how it works in Debian/Ubuntu:

  1. Add eth0 configuration to /etc/network/interfaces:

    auto eth0
    iface eth0 inet static
        address 10.0.0.1
        netmask 255.255.255.0
  2. Bring up the network interface:

    # ifup eth0

Let' see how it works in Red Hat/CentOS:

  1. Add the eth0 configuration to /etc/sysconfig/network-scripts/ifcfg-eth0:

    DEVICE=eth0
    BOOTPROTO=none
    ONBOOT=yes
    NETWORK=10.0.0.0
    NETMASK=255.255.255.0
    IPADDR=10.0.0.1
    USERCTL=no
  2. Bring up the network interface:

    # ifup eth0

How it works…

Linux distributions are configured through init systems, such as Upstart, SystemD, or SysVInit. During the initialization process, the interfaces, or ifcfg-eth0 files, are used as a configuration for the networking setup scripts. These scripts then use the same ip commands, or possibly ifconfig commands to set up and bring up the network interface.

You have been reading a chapter from
Linux Networking Cookbook
Published in: Jun 2016 Publisher: ISBN-13: 9781785287916
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}