{"id":365,"date":"2024-11-17T21:01:32","date_gmt":"2024-11-17T19:01:32","guid":{"rendered":"https:\/\/www.florian-klaus.de\/?p=365"},"modified":"2024-11-17T21:01:34","modified_gmt":"2024-11-17T19:01:34","slug":"fuenf-tage-linux-tag-5-scripting","status":"publish","type":"post","link":"https:\/\/www.florian-klaus.de\/index.php\/2024\/11\/17\/fuenf-tage-linux-tag-5-scripting\/","title":{"rendered":"F\u00fcnf Tage Linux &#8211; Tag 5: Scripting"},"content":{"rendered":"\n<p>Vorweg einmal kurz in einen Blick in eine typische Netzwerk-Konfigurationsdatei unter Linux:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>network:\n    version: 2\n    renderer: NetworkManager\n    ethernets:\n        eno1:\n          dhcp4: false\n          addresses:\n              - 192.168.111.112\/27\n          nameservers:\n              addresses:\n                  - 192.168.111.1\n          routes:\n              - to: default\n                via: 192.168.111.1<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Und mal dieselbe Netzwerk Konfiguration mal anders:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>auto eno1\niface eno1 inet static\n  address 192.168.111.112\/27\n  nameserver 192.168.111.1\n  gateway 192.168.111.1<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>Diese beiden Konfiguration tun im Endeffekt dasselbe. Das Problem: Die erste ist f\u00fcr netplan, die zweite f\u00fcr Ifupdown2. Allein aus Gr\u00fcnden der Effizienz kommt da die Frage auf: Warum nicht einfach ifupdown2 verwenden? Tja, wenn es so einfach w\u00e4re&#8230;.<\/p>\n\n\n\n<p>Die beiden haben andere Anwendungsgebiete. W\u00e4hrend ifupdown2 bei Bare-Metal-Systemen allm\u00e4hlich zum Standard wird, ist Netplan bei Cloud Projekten und vor allem bei Kubernetes-Clustern im Einsatz. Da ein Docker-Container eh immer mit einer .yaml-Datei in ein K8s-Cluster eingebunden wird, bot sich da an, auch die Netzwerk-Konfiguration gleich mit in den .yaml-Datei zu schreiben. So entstand Netplan. <\/p>\n\n\n\n<p>Jetzt m\u00f6chte ich aber eine Proxmox Umgebung (meist auf Bare-Metal) in ein bestehendes Cluster einbetten, das Cluster verf\u00fcgt aber \u00fcber mehrere Netze und diese sind auch in einer Netplan-Datei verankert. Da dieses Netzwerk sich aber \u00fcber mehrere Netzwerke erstreckt, ist die Datei dann nicht mehr ganz so simpel wie das oben genannte Beispiel, sondern sieht dann eher so aus:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>network:\n  version: 2\n  renderer: networkd\n  ethernets:\n    eno1:\n      dhcp4: no\n      dhcp6: no\n  bridges:\n    br1:\n      dhcp4: no\n      dhcp6: no\n      interfaces: &#91; eno1 ]\n      addresses: &#91; 10.17.132.22\/25 ]\n      routes:\n        - to: default\n          via: 10.17.132.1\n      nameservers:\n        addresses:\n        - \"10.17.132.1\"\n    br1001:\n      dhcp4: no\n      dhcp6: no\n      interfaces: &#91; vlan1001 ]\n    br1002:\n      dhcp4: no\n      dhcp6: no\n      interfaces: &#91; vlan1002 ]\n    br1003:\n      dhcp4: no\n      dhcp6: no\n      interfaces: &#91; vlan1003 ]\n    br1004:\n      dhcp4: no\n      dhcp6: no\n      interfaces: &#91; vlan1004 ]\n    br1101:\n      dhcp4: no\n      dhcp6: no\n      interfaces: &#91; vlan1101 ]\n    br1102:\n      dhcp4: no\n      dhcp6: no\n      interfaces: &#91; vlan102 ]\n      link-local: &#91; ipv6 ]\n      accept-ra: false\n    br1201:\n      dhcp4: no\n      dhcp6: no\n      interfaces: &#91; vlan81 ]\n  vlans:\n    vlan1001:\n      id: 1001\n      link: eno1\n      dhcp4: no\n      dhcp6: no\n    vlan1002:\n      id: 1002\n      link: eno1\n      dhcp4: no\n      dhcp6: no\n    vlan1003:\n      id: 1003\n      link: eno1\n      dhcp4: no\n      dhcp6: no\n    vlan1004:\n      id: 1004\n      link: eno1\n      dhcp4: no\n      dhcp6: no\n    vlan1101:\n      id: 1101\n      link: eno1\n      dhcp4: no\n      dhcp6: no\n    vlan102:\n      id: 102\n      link: eno1\n      dhcp4: no\n      dhcp6: no\n      link-local: &#91; ipv6, ipv4 ]\n      accept-ra: true\n    vlan1201:\n      id: 81\n      link: eno1\n      dhcp4: no\n      dhcp6: no<\/code><\/pre>\n\n\n\n<p>Das wird mal ein wenig komplexer. Und bevor ich jetzt alles aus dieser Datei in eine ifupdown2 \u00fcbertrage, mache ich das ganze doch besser via Script, weil vertippen tue ich mich zwischenzeitlich vermutlich eh.<\/p>\n\n\n\n<p>Nun kommt die erste H\u00fcrde: bash (die Kommando Zeile von Linux) kann eine .yaml-Datei nicht einfach so parsen, um dies zu tun, braucht man eine python3-Erweiterung namens &#8217;niet&#8216;. Aber nachdem dies gekl\u00e4rt ist, k\u00f6nnte ich mich jetzt hinsetzen und das Script selber runterschreiben, oder ich k\u00f6nnte ein KI-Modul zum Skripten in mein LocalAi laden und das Modul das Script f\u00fcr mich schreiben lassen. Nach dem Testen mehrerer Module ist dies das Beste, was ich bekommen habe:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>To create an ifupdown2 configuration file using the niet Python library, you first need to install the niet library. If you haven&#8217;t already, you can install it using pip:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>pip install niet<\/code><\/pre>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Next, you need to write a script that uses niet to generate the ifupdown2 configuration file. ifupdown2 uses a different configuration format, so you&#8217;ll need to convert your netplan configuration to ifupdown2 syntax.<\/p>\n\n\n\n<p>Here&#8217;s a bash script that performs this conversion:<\/p>\n<\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/bin\/bash\n\n# Function to convert netplan to ifupdown2\nconvert_netplan_to_ifupdown2() {\n    local netplan_file=\"$1\"\n    local ifupdown2_file=\"$2\"\n\n    # Read netplan file\n    local netplan\n    netplan=$(cat \"$netplan_file\")\n\n    # Extract interfaces and their configurations\n    local interfaces=$(echo \"$netplan\" | jq -r '.network.ethernets + .network.bridges + .network.vlans | .&#91;] | .id')\n\n    # Create ifupdown2 configuration\n    local ifupdown2_content=\"\"\n    for interface in $interfaces; do\n        local interface_config=$(echo \"$netplan\" | jq -r --arg interface \"$interface\" '.network | select (.ethernets&#91;$interface] or .bridges&#91;$interface] or .vlans&#91;$interface]) | .ethernets&#91;$interface] or .bridges&#91;$interface] or .vlans&#91;$interface]')\n        local address=$(echo \"$interface_config\" | jq -r '.addresses&#91;0]')\n        local gateway=$(echo \"$interface_config\" | jq -r '.routes&#91;] | select(.to == \"default\") | .via')\n        local nameservers=$(echo \"$interface_config\" | jq -r '.nameservers.addresses&#91;0]')\n\n        # Convert to ifupdown2 syntax\n        local ifupdown2_entry=\"auto $interface\"\n        ifupdown2_entry+=\"\\niface $interface inet static\"\n        ifupdown2_entry+=\"\\n    address $address\"\n        ifupdown2_entry+=\"\\n    gateway $gateway\"\n        ifupdown2_entry+=\"\\n    dns-nameservers $nameservers\"\n\n        # Add to ifupdown2 content\n        ifupdown2_content+=\"$ifupdown2_entry\\n\"\n    done\n\n    # Write ifupdown2 configuration to file\n    echo \"$ifupdown2_content\" &gt; \"$ifupdown2_file\"\n}\n\n# Main script execution\nif &#91; -n \"$1\" ] &amp;&amp; &#91; -n \"$2\" ]; then\n    convert_netplan_to_ifupdown2 \"$1\" \"$2\"\n    echo \"ifupdown2 configuration created at $2\"\nelse\n    echo \"Usage: $0 &lt;netplan_file&gt; &lt;ifupdown2_file&gt;\"\n    exit 1\nfi<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Explanation:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Function convert_netplan_to_ifupdown2:\n    Reads the netplan configuration file.\n    Extracts the list of interfaces.\n    Converts each interface's configuration to ifupdown2 syntax.\n    Writes the ifupdown2 configuration to the specified output file.\n\nMain Script Execution:\n    Checks if the script is called with the correct number of arguments.\n    Calls the function with the provided input and output file paths.<\/code><\/pre>\n\n\n\n<p>Usage:<\/p>\n\n\n\n<p>Save the script to a file, for example, convert_netplan.sh, give it execution permissions, and run it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>chmod +x convert_netplan.sh\n.\/convert_netplan.sh input_netplan.yaml output_ifupdown2.conf<\/code><\/pre>\n<\/blockquote>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>This will generate an ifupdown2 configuration file from your netplan configuration. Adjust the script as needed to handle more specific configurations or to convert additional types of network configurations.<\/p>\n<\/blockquote>\n\n\n\n<p>Das sieht auch alles ganz lustig aus, bis man sich die Befehle mal n\u00e4her ansieht: Das Script nutzt nicht &#8222;niet&#8220;, obwohl es den Installationsvorgang noch beschreibt und einen dazu auffordert, die python Bibliothek zu installieren. Es nutzt &#8222;jq&#8220;, was, wenn man es sich genau anschaut, daf\u00fcr gebaut ist, eine .json-Datei zu parsen. Nun, eine .yaml und und ein .json Datei sind schon \u00e4hnlich, aber leider nicht dasselbe. Sprich, das funktioniert nicht.<\/p>\n\n\n\n<p>Den n\u00e4chsten Fehler, den das Script begeht, ist die gesamte .yaml-Datei erstmal mit cat zu parsen und in der der Variable netplan zu speichern, um mit dieser weiter zu arbeiten. Was so auch nicht funktioniert, da Formatierungen aufgehoben werden, welche in einer .yaml-Datei allerdings essentiell sind. Also, ja, ich kann die Datei zu einer Variable innerhalb des Scriptes machen. Aber die Datei an sich sollte nicht mit bash-Boardmitteln geparst werden, wenn dies ginge, br\u00e4uchte ich auch die python3-Bibliothek nicht!!<\/p>\n\n\n\n<p>Vorweg k\u00f6nnte man mit echo noch die Frage nach der Datei ausgeben. Entweder in demselben Verzeichnis oder mit absolutem Pfad, dann m\u00fcssen sich Script und Datei nicht in demselben Ordner befinden.<\/p>\n\n\n\n<p>Das, was danach gemacht werden sollte, ist die Bezeichnung des oder der Standard-Ethernetports herauszufinden:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>PS3='Bitte nennen Sie die Bezeichnung f\u00fcr ihre Netzwerkkarte: '\noptions=(\"eth\" \"enp0s1 (o.\u00e4)\" \"eno\" \"Quit\")\nselect opt in \"${options&#91;@]}\"\ndo\n    case $opt in\n        \"eth\")\n            eName=\"eth\"\n            echo \"Die Bezeichnung f\u00fcr ihre Netzwerkkarte beginnt mit eth\"\n            break\n            ;;\n        \"enp0s1 (o.\u00e4)\")\n            eName=\"enp\"\n            echo \"Die Bezeichnung f\u00fcr ihre Netzwerkkarte beginnt mit enp\"\n            break\n            ;;\n        \"eno\")\n            eName=\"eno\"\n            echo \"Die Bezeichnung f\u00fcr ihre Netzwerkkarte beginnt mit eno\"\n            break\n            ;;\n        \"Quit\")\n            exit 1\n            break\n            ;;\n        *) echo \"ung\u00fcltige Option, bitte nochmal\";;\n    esac\ndone<\/code><\/pre>\n\n\n\n<p>eth, eno und enp werden genommen. swp ist noch nicht integriert, kann man aber als Option schnell intergrieren.<\/p>\n\n\n\n<p>Anschlie\u00dfend werden die Interfaces, Bridges und VLANs gesammelt:<br>(Hier das Beispiel f\u00fcr Bridges:)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>nrOfBridges=`niet \".network.bridges\" $netplan | grep br* | wc -l`\ndeclare -a bridges=()\nfor (( c = 1; c &lt;= $nrOfBridges; c++ ))\ndo\n  bridges+=(`niet \".network.bridges\" $netplan | grep br* | sed -n \"$c\"p`)\ndone<\/code><\/pre>\n\n\n\n<p>Man sollte hier dabei daran denken, dass das die erste Variable in einem Array mit [0] adressiert wird, d.h. das die erste Bridge also bridges[0] ist.<\/p>\n\n\n\n<p>Als n\u00e4chstes zieht man sich die relevanten Informationen aus den Unterpunkten der .yaml-Datei<br>(Wieder anhand der Bridges:)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>for (( i = 1; i &lt;= 1; i++ ))\ndo \n   j=$i-1\n   bridgeWrong=${bridges&#91;$j]}\n   bridgeNow=(`echo \"$bridgeWrong\" | tr -d :`)\n   interface=(`niet \".network.bridges.\"$bridgeNow\".interfaces\" $netplan`)\n   dhcpV4=(`niet \".network.bridges.\"$bridgeNow\".dhcp4\" $netplan`)\n   dhcpV6=(`niet \".network.bridges.\"$bridgeNow\".dhcp6\" $netplan`)\n   ipV4=(`niet \".network.bridges.\"$bridgeNow\".addresses\" $netplan | cut -d'\/' -f1`)\n   ipV4Netmask=(`niet \".network.bridges.\"$bridgeNow\".addresses\" $netplan | cut -d'\/' -f2-`)\n   defaultRoute=(\"`niet \".network.bridges.\"$bridgeNow\".routes\" $netplan`\")\n   dRoute1=(`echo \"$defaultRoute\" | tr -d ' ' | tr -d \"'\" | cut -d',' -f1 | cut -d':' -f2-`)\n   dRoute2=(`echo \"$defaultRoute\" | tr -d ' ' | tr -d \"'\" | cut -d',' -f2- | cut -d':' -f2- | cut -d'}' -f1`)\n   nameserver=(`niet \".network.bridges.\"$bridgeNow\".nameservers.addresses\" $netplan`)\n   linkLocal=(`niet \".network.bridges.\"$bridgeNow\"\" $netplan | niet \"link-local\"`)\n   acceptRA=(`niet \".network.bridges.\"$bridgeNow\"\" $netplan | niet \"accept-ra\"`)\ndone<\/code><\/pre>\n\n\n\n<p>Was man nun mit den relevanten Informationen macht, muss man schauen. Muss das in ifupdown2 eigentlich noch deklariert werden, oder kann das ignoriert werden. <\/p>\n\n\n\n<p>Sollten die Infos allerdings ben\u00f6tigt werden, direkt schreiben. Da hilft das Ki- generierte Script oben dann wieder.<\/p>\n\n\n\n<p>Aber als Fazit muss ich sagen:<\/p>\n\n\n\n<p>Habe ich dieses Problem h\u00e4ufig (also mindestens im zweistelligen Bereich) w\u00fcrde sich ein Script mit Sicherheit lohnen. Ansonsten w\u00fcrde ich das nach wie vor per Hand machen. Sollten die KI Modelle allerdings irgendwann besser werden, k\u00f6nnte man auch dar\u00fcber nachdenken, das \u00fcbernehmen zu lassen. <\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Vorweg einmal kurz in einen Blick in eine typische Netzwerk-Konfigurationsdatei unter Linux: Und mal dieselbe Netzwerk Konfiguration mal anders: Diese beiden Konfiguration tun im Endeffekt dasselbe. Das Problem: Die erste ist f\u00fcr netplan, die zweite f\u00fcr Ifupdown2. Allein aus Gr\u00fcnden der Effizienz kommt da die Frage auf: Warum nicht einfach ifupdown2 verwenden? Tja, wenn es &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"https:\/\/www.florian-klaus.de\/index.php\/2024\/11\/17\/fuenf-tage-linux-tag-5-scripting\/\">Continue reading<\/a><\/p>\n","protected":false},"author":1,"featured_media":369,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[],"class_list":["post-365","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-it_themen","item-wrap"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>F\u00fcnf Tage Linux - Tag 5: Scripting - www.florian-klaus.de<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.florian-klaus.de\/index.php\/2024\/11\/17\/fuenf-tage-linux-tag-5-scripting\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"F\u00fcnf Tage Linux - Tag 5: Scripting - www.florian-klaus.de\" \/>\n<meta property=\"og:description\" content=\"Vorweg einmal kurz in einen Blick in eine typische Netzwerk-Konfigurationsdatei unter Linux: Und mal dieselbe Netzwerk Konfiguration mal anders: Diese beiden Konfiguration tun im Endeffekt dasselbe. Das Problem: Die erste ist f\u00fcr netplan, die zweite f\u00fcr Ifupdown2. Allein aus Gr\u00fcnden der Effizienz kommt da die Frage auf: Warum nicht einfach ifupdown2 verwenden? Tja, wenn es &hellip; Continue reading\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.florian-klaus.de\/index.php\/2024\/11\/17\/fuenf-tage-linux-tag-5-scripting\/\" \/>\n<meta property=\"og:site_name\" content=\"www.florian-klaus.de\" \/>\n<meta property=\"article:published_time\" content=\"2024-11-17T19:01:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-11-17T19:01:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.florian-klaus.de\/wp-content\/uploads\/2024\/11\/Script.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1266\" \/>\n\t<meta property=\"og:image:height\" content=\"421\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Florian Klaus\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@bballjunkieflow\" \/>\n<meta name=\"twitter:site\" content=\"@bballjunkieflow\" \/>\n<meta name=\"twitter:label1\" content=\"Geschrieben von\" \/>\n\t<meta name=\"twitter:data1\" content=\"Florian Klaus\" \/>\n\t<meta name=\"twitter:label2\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data2\" content=\"4\u00a0Minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.florian-klaus.de\/index.php\/2024\/11\/17\/fuenf-tage-linux-tag-5-scripting\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.florian-klaus.de\/index.php\/2024\/11\/17\/fuenf-tage-linux-tag-5-scripting\/\"},\"author\":{\"name\":\"Florian Klaus\",\"@id\":\"https:\/\/www.florian-klaus.de\/#\/schema\/person\/e42d488306a14de51fae9c2aa19f95a9\"},\"headline\":\"F\u00fcnf Tage Linux &#8211; Tag 5: Scripting\",\"datePublished\":\"2024-11-17T19:01:32+00:00\",\"dateModified\":\"2024-11-17T19:01:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.florian-klaus.de\/index.php\/2024\/11\/17\/fuenf-tage-linux-tag-5-scripting\/\"},\"wordCount\":802,\"publisher\":{\"@id\":\"https:\/\/www.florian-klaus.de\/#\/schema\/person\/e42d488306a14de51fae9c2aa19f95a9\"},\"image\":{\"@id\":\"https:\/\/www.florian-klaus.de\/index.php\/2024\/11\/17\/fuenf-tage-linux-tag-5-scripting\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.florian-klaus.de\/wp-content\/uploads\/2024\/11\/Script.jpg\",\"articleSection\":[\"IT-Themen\"],\"inLanguage\":\"de\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.florian-klaus.de\/index.php\/2024\/11\/17\/fuenf-tage-linux-tag-5-scripting\/\",\"url\":\"https:\/\/www.florian-klaus.de\/index.php\/2024\/11\/17\/fuenf-tage-linux-tag-5-scripting\/\",\"name\":\"F\u00fcnf Tage Linux - Tag 5: Scripting - www.florian-klaus.de\",\"isPartOf\":{\"@id\":\"https:\/\/www.florian-klaus.de\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.florian-klaus.de\/index.php\/2024\/11\/17\/fuenf-tage-linux-tag-5-scripting\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.florian-klaus.de\/index.php\/2024\/11\/17\/fuenf-tage-linux-tag-5-scripting\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.florian-klaus.de\/wp-content\/uploads\/2024\/11\/Script.jpg\",\"datePublished\":\"2024-11-17T19:01:32+00:00\",\"dateModified\":\"2024-11-17T19:01:34+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.florian-klaus.de\/index.php\/2024\/11\/17\/fuenf-tage-linux-tag-5-scripting\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.florian-klaus.de\/index.php\/2024\/11\/17\/fuenf-tage-linux-tag-5-scripting\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\/\/www.florian-klaus.de\/index.php\/2024\/11\/17\/fuenf-tage-linux-tag-5-scripting\/#primaryimage\",\"url\":\"https:\/\/www.florian-klaus.de\/wp-content\/uploads\/2024\/11\/Script.jpg\",\"contentUrl\":\"https:\/\/www.florian-klaus.de\/wp-content\/uploads\/2024\/11\/Script.jpg\",\"width\":1266,\"height\":421},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.florian-klaus.de\/index.php\/2024\/11\/17\/fuenf-tage-linux-tag-5-scripting\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.florian-klaus.de\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"F\u00fcnf Tage Linux &#8211; Tag 5: Scripting\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.florian-klaus.de\/#website\",\"url\":\"https:\/\/www.florian-klaus.de\/\",\"name\":\"www.florian-klaus.de\",\"description\":\"self-portrayal streamlined\",\"publisher\":{\"@id\":\"https:\/\/www.florian-klaus.de\/#\/schema\/person\/e42d488306a14de51fae9c2aa19f95a9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.florian-klaus.de\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"de\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.florian-klaus.de\/#\/schema\/person\/e42d488306a14de51fae9c2aa19f95a9\",\"name\":\"Florian Klaus\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\/\/www.florian-klaus.de\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f6308ba1e8ac765e3b92f1387a1fcc75b30d99c2053687bcc7be52709ca8aea7?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f6308ba1e8ac765e3b92f1387a1fcc75b30d99c2053687bcc7be52709ca8aea7?s=96&d=mm&r=g\",\"caption\":\"Florian Klaus\"},\"logo\":{\"@id\":\"https:\/\/www.florian-klaus.de\/#\/schema\/person\/image\/\"},\"description\":\"Systeminformatiker, Schwerpunkt Integration. Hobbys: Basketball, Am. Football. E-Sports, Podcasts\",\"sameAs\":[\"https:\/\/www.florian-klaus.de\",\"https:\/\/x.com\/bballjunkieflow\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"F\u00fcnf Tage Linux - Tag 5: Scripting - www.florian-klaus.de","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.florian-klaus.de\/index.php\/2024\/11\/17\/fuenf-tage-linux-tag-5-scripting\/","og_locale":"de_DE","og_type":"article","og_title":"F\u00fcnf Tage Linux - Tag 5: Scripting - www.florian-klaus.de","og_description":"Vorweg einmal kurz in einen Blick in eine typische Netzwerk-Konfigurationsdatei unter Linux: Und mal dieselbe Netzwerk Konfiguration mal anders: Diese beiden Konfiguration tun im Endeffekt dasselbe. Das Problem: Die erste ist f\u00fcr netplan, die zweite f\u00fcr Ifupdown2. Allein aus Gr\u00fcnden der Effizienz kommt da die Frage auf: Warum nicht einfach ifupdown2 verwenden? Tja, wenn es &hellip; Continue reading","og_url":"https:\/\/www.florian-klaus.de\/index.php\/2024\/11\/17\/fuenf-tage-linux-tag-5-scripting\/","og_site_name":"www.florian-klaus.de","article_published_time":"2024-11-17T19:01:32+00:00","article_modified_time":"2024-11-17T19:01:34+00:00","og_image":[{"width":1266,"height":421,"url":"https:\/\/www.florian-klaus.de\/wp-content\/uploads\/2024\/11\/Script.jpg","type":"image\/jpeg"}],"author":"Florian Klaus","twitter_card":"summary_large_image","twitter_creator":"@bballjunkieflow","twitter_site":"@bballjunkieflow","twitter_misc":{"Geschrieben von":"Florian Klaus","Gesch\u00e4tzte Lesezeit":"4\u00a0Minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.florian-klaus.de\/index.php\/2024\/11\/17\/fuenf-tage-linux-tag-5-scripting\/#article","isPartOf":{"@id":"https:\/\/www.florian-klaus.de\/index.php\/2024\/11\/17\/fuenf-tage-linux-tag-5-scripting\/"},"author":{"name":"Florian Klaus","@id":"https:\/\/www.florian-klaus.de\/#\/schema\/person\/e42d488306a14de51fae9c2aa19f95a9"},"headline":"F\u00fcnf Tage Linux &#8211; Tag 5: Scripting","datePublished":"2024-11-17T19:01:32+00:00","dateModified":"2024-11-17T19:01:34+00:00","mainEntityOfPage":{"@id":"https:\/\/www.florian-klaus.de\/index.php\/2024\/11\/17\/fuenf-tage-linux-tag-5-scripting\/"},"wordCount":802,"publisher":{"@id":"https:\/\/www.florian-klaus.de\/#\/schema\/person\/e42d488306a14de51fae9c2aa19f95a9"},"image":{"@id":"https:\/\/www.florian-klaus.de\/index.php\/2024\/11\/17\/fuenf-tage-linux-tag-5-scripting\/#primaryimage"},"thumbnailUrl":"https:\/\/www.florian-klaus.de\/wp-content\/uploads\/2024\/11\/Script.jpg","articleSection":["IT-Themen"],"inLanguage":"de"},{"@type":"WebPage","@id":"https:\/\/www.florian-klaus.de\/index.php\/2024\/11\/17\/fuenf-tage-linux-tag-5-scripting\/","url":"https:\/\/www.florian-klaus.de\/index.php\/2024\/11\/17\/fuenf-tage-linux-tag-5-scripting\/","name":"F\u00fcnf Tage Linux - Tag 5: Scripting - www.florian-klaus.de","isPartOf":{"@id":"https:\/\/www.florian-klaus.de\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.florian-klaus.de\/index.php\/2024\/11\/17\/fuenf-tage-linux-tag-5-scripting\/#primaryimage"},"image":{"@id":"https:\/\/www.florian-klaus.de\/index.php\/2024\/11\/17\/fuenf-tage-linux-tag-5-scripting\/#primaryimage"},"thumbnailUrl":"https:\/\/www.florian-klaus.de\/wp-content\/uploads\/2024\/11\/Script.jpg","datePublished":"2024-11-17T19:01:32+00:00","dateModified":"2024-11-17T19:01:34+00:00","breadcrumb":{"@id":"https:\/\/www.florian-klaus.de\/index.php\/2024\/11\/17\/fuenf-tage-linux-tag-5-scripting\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.florian-klaus.de\/index.php\/2024\/11\/17\/fuenf-tage-linux-tag-5-scripting\/"]}]},{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/www.florian-klaus.de\/index.php\/2024\/11\/17\/fuenf-tage-linux-tag-5-scripting\/#primaryimage","url":"https:\/\/www.florian-klaus.de\/wp-content\/uploads\/2024\/11\/Script.jpg","contentUrl":"https:\/\/www.florian-klaus.de\/wp-content\/uploads\/2024\/11\/Script.jpg","width":1266,"height":421},{"@type":"BreadcrumbList","@id":"https:\/\/www.florian-klaus.de\/index.php\/2024\/11\/17\/fuenf-tage-linux-tag-5-scripting\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.florian-klaus.de\/"},{"@type":"ListItem","position":2,"name":"F\u00fcnf Tage Linux &#8211; Tag 5: Scripting"}]},{"@type":"WebSite","@id":"https:\/\/www.florian-klaus.de\/#website","url":"https:\/\/www.florian-klaus.de\/","name":"www.florian-klaus.de","description":"self-portrayal streamlined","publisher":{"@id":"https:\/\/www.florian-klaus.de\/#\/schema\/person\/e42d488306a14de51fae9c2aa19f95a9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.florian-klaus.de\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"de"},{"@type":["Person","Organization"],"@id":"https:\/\/www.florian-klaus.de\/#\/schema\/person\/e42d488306a14de51fae9c2aa19f95a9","name":"Florian Klaus","image":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/www.florian-klaus.de\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/f6308ba1e8ac765e3b92f1387a1fcc75b30d99c2053687bcc7be52709ca8aea7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f6308ba1e8ac765e3b92f1387a1fcc75b30d99c2053687bcc7be52709ca8aea7?s=96&d=mm&r=g","caption":"Florian Klaus"},"logo":{"@id":"https:\/\/www.florian-klaus.de\/#\/schema\/person\/image\/"},"description":"Systeminformatiker, Schwerpunkt Integration. Hobbys: Basketball, Am. Football. E-Sports, Podcasts","sameAs":["https:\/\/www.florian-klaus.de","https:\/\/x.com\/bballjunkieflow"]}]}},"_links":{"self":[{"href":"https:\/\/www.florian-klaus.de\/index.php\/wp-json\/wp\/v2\/posts\/365","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.florian-klaus.de\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.florian-klaus.de\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.florian-klaus.de\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.florian-klaus.de\/index.php\/wp-json\/wp\/v2\/comments?post=365"}],"version-history":[{"count":3,"href":"https:\/\/www.florian-klaus.de\/index.php\/wp-json\/wp\/v2\/posts\/365\/revisions"}],"predecessor-version":[{"id":368,"href":"https:\/\/www.florian-klaus.de\/index.php\/wp-json\/wp\/v2\/posts\/365\/revisions\/368"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.florian-klaus.de\/index.php\/wp-json\/wp\/v2\/media\/369"}],"wp:attachment":[{"href":"https:\/\/www.florian-klaus.de\/index.php\/wp-json\/wp\/v2\/media?parent=365"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.florian-klaus.de\/index.php\/wp-json\/wp\/v2\/categories?post=365"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.florian-klaus.de\/index.php\/wp-json\/wp\/v2\/tags?post=365"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}