{"id":1299,"date":"2018-01-08T10:06:38","date_gmt":"2018-01-08T08:06:38","guid":{"rendered":"https:\/\/community.virtono.com\/?p=1299"},"modified":"2018-01-05T10:10:49","modified_gmt":"2018-01-05T08:10:49","slug":"network-configuration-in-debian","status":"publish","type":"post","link":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/network-configuration-in-debian\/","title":{"rendered":"Network configuration in Debian"},"content":{"rendered":"<p>This article gives an overview of how the\u00a0<b>network<\/b>\u00a0configuration in\u00a0Debian\u00a0can be stored and modified\u00a0in the configuration file\u00a0<b>\/ etc \/ network \/ interfaces<\/b>\u00a0.<\/p>\n<div id=\"toc\" class=\"toc\">\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_73 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/network-configuration-in-debian\/#Automatic_activation_at_startup\" title=\"Automatic activation at startup\">Automatic activation at startup<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/network-configuration-in-debian\/#Configuration_of_the_individual_interfaces\" title=\"Configuration of the individual interfaces\">Configuration of the individual interfaces<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/network-configuration-in-debian\/#Configuration_of_the_loopback_interface\" title=\"Configuration of the loopback interface\">Configuration of the loopback interface<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/network-configuration-in-debian\/#Configuration_of_a_static_IP_address\" title=\"Configuration of a static IP address\">Configuration of a static IP address<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/network-configuration-in-debian\/#Configuring_a_Dynamic_IP_Address_DHCP\" title=\"Configuring a Dynamic IP Address (DHCP)\">Configuring a Dynamic IP Address (DHCP)<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.virtono.com\/community\/tutorial-how-to\/network-configuration-in-debian\/#Example_of_a_system_with_two_network_cards\" title=\"Example of a system with two network cards\">Example of a system with two network cards<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Automatic_activation_at_startup\"><\/span><span id=\"Automatisches_Aktivieren_beim_Starten\" class=\"mw-headline\">Automatic activation at startup<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>In order for certain interfaces to be activated automatically during the boot process, these must be entered with the auto parameter in the configuration file.The following example shows a system with a network card eth0 (the loopback interface lo should also always be activated):<\/p>\n<pre>auto lo eth0\r\n<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Configuration_of_the_individual_interfaces\"><\/span><span id=\"Konfiguration_der_einzelnen_Schnittstellen\" class=\"mw-headline\">Configuration of the individual interfaces<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The following examples show different possible network interface configurations<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Configuration_of_the_loopback_interface\"><\/span><span id=\"Konfiguration_des_Loopback_Interface\" class=\"mw-headline\">Configuration of the loopback interface<\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The loopback interface should always be present and is also entered automatically:<\/p>\n<pre>iface lo inet loopback\r\n<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Configuration_of_a_static_IP_address\"><\/span><span id=\"Konfiguration_einer_statischen_IP-Adresse\" class=\"mw-headline\">Configuration of a static IP address<\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>A static IP address is\u00a0<code>iface eth0 inet static<\/code>configured\u00a0by means of\u00a0.The following example shows the configuration with an IP address, a subnet mask, a default gateway and a DNS server:<\/p>\n<pre>iface eth0 inet static \r\n        address 192.168.0.111 \r\n        netmask 255.255.255.0\r\n        gateway 192.168.0.1\r\n        dns-search somedomain.org\r\n        dns-nameservers 192.168.0.1\r\n<\/pre>\n<h3><span class=\"ez-toc-section\" id=\"Configuring_a_Dynamic_IP_Address_DHCP\"><\/span><span id=\"Konfiguration_einer_dynamischen_IP-Adresse_.28DHCP.29\" class=\"mw-headline\">Configuring a Dynamic IP Address (DHCP)<\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>A dynamic IP address is\u00a0<code>iface eth0 inet dhcp<\/code>configured by:<sup id=\"cite_ref-3\" class=\"reference\"><\/sup><\/p>\n<pre>iface eth0 inet dhcp\r\n<\/pre>\n<h2><span class=\"ez-toc-section\" id=\"Example_of_a_system_with_two_network_cards\"><\/span><span id=\"Beispiel_eines_Systems_mit_zwei_Netzwerkkarten\" class=\"mw-headline\">Example of a system with two network cards<\/span><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The following example shows the configuration file of a system with two network adapters.\u00a0The first network card (eth0) automatically gets an IP address via DHCP (a default gateway is also configured here by DHCP).\u00a0The second network card (eth1) is configured with a fixed IP address.<\/p>\n<pre>debian: ~ # cat \/ etc \/ network \/ interfaces \r\n# This file describes the network interfaces available on your system\r\n# and how to activate them. For more information, see interfaces (5).\r\n\r\n# The loopback network interface\r\ncar lo eth1\r\niface lo inet loopback\r\n\r\n# The primary network interface\r\nallow-hotplug eth0\r\niface eth0 inet dhcp\r\n\r\niface eth1 inet static\r\n\taddress 192.168.56.2\r\n\tnetmask 255.255.255.0\r\ndebian: ~ # \r\n<\/pre>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This article gives an overview of how the\u00a0network\u00a0configuration in\u00a0Debian\u00a0can be stored and modified\u00a0in the configuration file\u00a0\/ etc \/ network \/ interfaces\u00a0. Automatic activation at startup In order for certain interfaces to be activated automatically during the boot process, these must be entered with the auto parameter in the configuration file.The<\/p>\n","protected":false},"author":3,"featured_media":1300,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[3],"tags":[],"class_list":["post-1299","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorial-how-to"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2018\/01\/debian7_xfce4_desktop.png?fit=1946%2C1106&ssl=1","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p7ISfL-kX","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":1320,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/set-up-static-arp-entry\/","url_meta":{"origin":1299,"position":0},"title":"Set up static ARP entry","author":"Shreyash Sharma","date":"January 15, 2018","format":false,"excerpt":"This article describes how to create a static ARP entry on Linux and Windows.\u00a0Static ARP entries for important network components in the same Layer 2 segment provide some protection against ARP spoofing. Ubuntu \/ Debian In the following example we assume a gateway with the IP address 192.0.2.1 and the\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2018\/01\/network_ARP_example.gif?fit=761%2C351&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2018\/01\/network_ARP_example.gif?fit=761%2C351&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2018\/01\/network_ARP_example.gif?fit=761%2C351&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2018\/01\/network_ARP_example.gif?fit=761%2C351&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":3238,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/install-redis-on-linux\/","url_meta":{"origin":1299,"position":1},"title":"Install Redis on Linux","author":"George B.","date":"April 14, 2023","format":false,"excerpt":"This article aims to provide you with a full guide on how to install Redis on Linux, an open-source, in-memory data structure store that can be used as a database, cache, and message broker. We will walk you through the step-by-step process of installation and setup, as well as provide\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Install-Redis-on-Linux.png?fit=600%2C330&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Install-Redis-on-Linux.png?fit=600%2C330&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/04\/Install-Redis-on-Linux.png?fit=600%2C330&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":3599,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-suricata-on-ubuntu-22-04\/","url_meta":{"origin":1299,"position":2},"title":"How to install Suricata on Ubuntu 22.04","author":"George B.","date":"June 22, 2023","format":false,"excerpt":"Introduction We will walk you through the installation of Suricata on Ubuntu 22.04 to ensure that you have a strong network defense mechanism in place. We'll go over everything from updating system packages to configuring Suricata and automating its startup. By the end of this guide, you will have a\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/How-to-install-Suricata-on-Ubuntu-22.04.png?fit=600%2C330&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/How-to-install-Suricata-on-Ubuntu-22.04.png?fit=600%2C330&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2023\/06\/How-to-install-Suricata-on-Ubuntu-22.04.png?fit=600%2C330&ssl=1&resize=525%2C300 1.5x"},"classes":[]},{"id":1219,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/samba-server-security\/","url_meta":{"origin":1299,"position":3},"title":"Samba server security","author":"Shreyash Sharma","date":"October 31, 2017","format":false,"excerpt":"This article gives an\u00a0overview\u00a0of the possibilities of some\u00a0security settings of\u00a0a Samba server.\u00a0With regard to security, of course, there are always different options, some of which lead to the same goal.\u00a0This article shows those configuration parameters that can sometimes be used to take simple but effective security measures.\u00a0The settings were all\u00a0tested\u00a0on\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":965,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/how-to-install-mongodb-on-debian-8\/","url_meta":{"origin":1299,"position":4},"title":"How to Install MongoDB on Debian 8","author":"Daniel Draga","date":"June 11, 2017","format":false,"excerpt":"Introduction Part of the MEAN stack MongoDB is the new\u00a0NoSQL document database that is being implemented within modern web applications. So using MongoDB in your own application will give it the edge, you will be able to deal with a large amount of data. On top of all that you\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/06\/mongodb-for-giant-ideas-bbab5c3cf8.png?fit=1024%2C512&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/06\/mongodb-for-giant-ideas-bbab5c3cf8.png?fit=1024%2C512&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/06\/mongodb-for-giant-ideas-bbab5c3cf8.png?fit=1024%2C512&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2017\/06\/mongodb-for-giant-ideas-bbab5c3cf8.png?fit=1024%2C512&ssl=1&resize=700%2C400 2x"},"classes":[]},{"id":1345,"url":"https:\/\/www.virtono.com\/community\/tutorial-how-to\/samba-sharing-with-authentication\/","url_meta":{"origin":1299,"position":5},"title":"Samba sharing with authentication","author":"Shreyash Sharma","date":"February 22, 2018","format":false,"excerpt":"Complementing a simple Samba release, this article shows how to\u00a0create a username and password based Samba share\u00a0using a\u00a0Debian\u00a08 based system.\u00a0Ubuntu\u00a016.04 and Windows 10 are used\u00a0as client software for testing the connection\u00a0. \u00a0 Installation and configuration on the Debian server These following sections show the necessary configuration steps on the Debian\u2026","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/www.virtono.com\/community\/category\/tutorial-how-to\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.virtono.com\/community\/wp-content\/uploads\/2018\/02\/Samba-Schema.gif?fit=450%2C300&ssl=1&resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/1299","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/comments?post=1299"}],"version-history":[{"count":1,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/1299\/revisions"}],"predecessor-version":[{"id":1301,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/posts\/1299\/revisions\/1301"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/media\/1300"}],"wp:attachment":[{"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/media?parent=1299"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/categories?post=1299"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.virtono.com\/community\/wp-json\/wp\/v2\/tags?post=1299"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}