Skip to content

IPFire Orange DHCP

Verschoben Linux
  • Wenn man mit IPFire eine DMZ (orange) betreibt, muss man sich um DNS und DHCP selber kümmern.

    Um IP-Adressen zu verteilen, braucht man einen DHCP-Dienst. Warum braucht man das? Wenn man die ROCKPro64 nicht in sein LAN hängen will, müssen sie in die DMZ. Da aber alle Images so eingestellt sind, das sie sich beim Starten per DHCP eine IP-Adresse besorgen, gibt das beim Starten dann Probleme. Somit habe ich mir einen DHCP-Server in die DMZ gestellt und das Problem ist gelöst.

    Beispiel

    • Netz 192.168.5.0/24
    • IP-Range 192.168.5.2 bis 192.168.5.20
    • Gateway 192.168.5.1
    • DNS-Server 1.1.1.1, 8.8.8.8

    Installation

    apt install isc-dhcp-server
    

    Konfiguration

    Es gibt zwei wichtige Dateien. Einmal die Datei isc-dhcp-server

    nano /etc/default/isc-dhcp-server 
    

    Inhalt der Datei

    # Defaults for isc-dhcp-server (sourced by /etc/init.d/isc-dhcp-server)
    
    # Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf).
    DHCPDv4_CONF=/etc/dhcp/dhcpd.conf
    #DHCPDv6_CONF=/etc/dhcp/dhcpd6.conf
    
    # Path to dhcpd's PID file (default: /var/run/dhcpd.pid).
    #DHCPDv4_PID=/var/run/dhcpd.pid
    #DHCPDv6_PID=/var/run/dhcpd6.pid
    
    # Additional options to start dhcpd with.
    #       Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead
    #OPTIONS=""
    
    # On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
    #       Separate multiple interfaces with spaces, e.g. "eth0 eth1".
    INTERFACESv4="eth0"
    #INTERFACESv6=""
    

    Und einmal die Datei dhcpd.conf

    nano /etc/dhcp/dhcpd.conf
    

    Inhalt der Datei

    # dhcpd.conf
    #
    # Sample configuration file for ISC dhcpd
    #
    
    # option definitions common to all supported networks...
    option domain-name "meinnetz.local";
    option domain-name-servers 1.1.1.1, 8.8.8.8;
    
    default-lease-time 600;
    max-lease-time 7200;
    
    # The ddns-updates-style parameter controls whether or not the server will
    # attempt to do a DNS update when a lease is confirmed. We default to the
    # behavior of the version 2 packages ('none', since DHCP v2 didn't
    # have support for DDNS.)
    ddns-update-style none;
    
    # If this DHCP server is the official DHCP server for the local
    # network, the authoritative directive should be uncommented.
    authoritative;
    
    # Use this to send dhcp log messages to a different log file (you also
    # have to hack syslog.conf to complete the redirection).
    #log-facility local7;
    
    # No service will be given on this subnet, but declaring it helps the
    # DHCP server to understand the network topology.
    
    #subnet 192.168.5.0 netmask 255.255.255.0 {
    #}
    
    # This is a very basic subnet declaration.
    
    subnet 192.168.5.0 netmask 255.255.255.0 {
      range 192.168.5.2 192.168.5.20;
      option routers 192.168.5.1;
    }
    
    # This declaration allows BOOTP clients to get dynamic addresses,
    # which we don't really recommend.
    
    #subnet 10.254.239.32 netmask 255.255.255.224 {
    #  range dynamic-bootp 10.254.239.40 10.254.239.60;
    #  option broadcast-address 10.254.239.31;
    #  option routers rtr-239-32-1.example.org;
    #}
    
    # A slightly different configuration for an internal subnet.
    #subnet 10.5.5.0 netmask 255.255.255.224 {
    #  range 10.5.5.26 10.5.5.30;
    #  option domain-name-servers ns1.internal.example.org;
    #  option domain-name "internal.example.org";
    #  option routers 10.5.5.1;
    #  option broadcast-address 10.5.5.31;
    #  default-lease-time 600;
    #  max-lease-time 7200;
    #}
    
    # Hosts which require special configuration options can be listed in
    # host statements.   If no address is specified, the address will be
    # allocated dynamically (if possible), but the host-specific information
    # will still come from the host declaration.
    
    #host passacaglia {
    #  hardware ethernet 0:0:c0:5d:bd:95;
    #  filename "vmunix.passacaglia";
    #  server-name "toccata.example.com";
    #}
    
    # Fixed IP addresses can also be specified for hosts.   These addresses
    # should not also be listed as being available for dynamic assignment.
    # Hosts for which fixed IP addresses have been specified can boot using
    # BOOTP or DHCP.   Hosts for which no fixed address is specified can only
    # be booted with DHCP, unless there is an address range on the subnet
    # to which a BOOTP client is connected which has the dynamic-bootp flag
    # set.
    #host fantasia {
    #  hardware ethernet 08:00:07:26:c0:a5;
    #  fixed-address fantasia.example.com;
    #}
    
    # You can declare a class of clients and then do address allocation
    # based on that.   The example below shows a case where all clients
    # in a certain class get addresses on the 10.17.224/24 subnet, and all
    # other clients get addresses on the 10.0.29/24 subnet.
    
    #class "foo" {
    #  match if substring (option vendor-class-identifier, 0, 4) = "SUNW";
    #}
    
    #shared-network 224-29 {
    #  subnet 10.17.224.0 netmask 255.255.255.0 {
    #    option routers rtr-224.example.org;
    #  }
    #  subnet 10.0.29.0 netmask 255.255.255.0 {
    #    option routers rtr-29.example.org;
    #  }
    #  pool {
    #    allow members of "foo";
    #    range 10.17.224.10 10.17.224.250;
    #  }
    #  pool {
    #    deny members of "foo";
    #    range 10.0.29.10 10.0.29.230;
    #  }
    #}
    

    Neustart des Dienstes

    /etc/init.d/isc-dhcp-server start
    

  • Fragen, Probleme, geht nicht?

    Angeheftet Support
    1
    0 Stimmen
    1 Beiträge
    64 Aufrufe
    Niemand hat geantwortet
  • PHP Webseite lokal einhängen mit sshfs

    PHP
    1
    0 Stimmen
    1 Beiträge
    39 Aufrufe
    Niemand hat geantwortet
  • Vorstellung Star64

    Hardware
    2
    0 Stimmen
    2 Beiträge
    54 Aufrufe
    FrankMF

    Ich konnte heute einen ergattern und die 8GB RAM Version ist unterwegs. Achtung, aktuell ist die Softwareunterstützung fast nicht vorhanden!

  • Ansible - ein kurzer Test

    Linux
    1
    0 Stimmen
    1 Beiträge
    129 Aufrufe
    Niemand hat geantwortet
  • OpenWRT - Zonen

    Verschoben OpenWRT & Ubiquiti ER-X
    2
    0 Stimmen
    2 Beiträge
    342 Aufrufe
    FrankMF

    Es ist was heller geworden 🙂

    7b86e97c-31a5-44b6-809f-25d9d1c2ee4a-image.png

    Die besagte Forward Regel

    Zonen.png

    Diese Forward Regel zieht erst dann, wenn es mehrere Interfaces in einer Zone gibt. Aus der Doku

    INPUT rules for a zone describe what happens to traffic trying to reach the router itself through an interface in that zone. OUTPUT rules for a zone describe what happens to traffic originating from the router itself going through an interface in that zone. FORWARD rules for a zone describe what happens to traffic passing between different interfaces belonging in the same zone.

    Das heisst nun, das ein Forwarding zwischen zwei Zonen immer eine spezifische Regel unter Traffic Rules benötigt.

    Forwarding between zones always requires a specific rule.

    Somit ist ein Forwarding zwischen zwei Zonen in den Standard Einstellungen nicht erlaubt. Das kann ich hier auch so bestätigen. Das ist ja auch das was ich mit meiner "DMZ"-Zone erreichen möchte. Kein Zugriff auf LAN.

    Unter Zone ⇒ Forwardings kann man jetzt sehen, das das Forwarding von LAN in Richtung WAN und DMZ erlaubt ist. WAN ist logisch, sonst komme ich ja nicht ins Internet. DMZ habe ich eingestellt, damit ich auch Teilnehmer im DMZ Netz erreichen kann, wenn ich da mal ran muss.

    8a548c29-8bc5-4074-8099-66460bcea9a8-image.png

    Stelle ich das jetzt so ein.

    dca8b393-f613-4cab-a377-ffbc2bb8ddf5-image.png

    Dann kann ich von der DMZ Zone aus das LAN erreichen. Aha, so langsam verstehe ich 😉

    Quelle: https://forum.openwrt.org/t/firewall-zones-and-settings/84369

  • Wireguard - Client installieren

    Wireguard
    3
    0 Stimmen
    3 Beiträge
    469 Aufrufe
    FrankMF

    Ich kann dir nicht ganz folgen. Mein Wireguard Server ist eine VM im Netz. Mein Smartphone baut zu diesem eine Verbindung auf und ich habe mal eben nachgeschaut, was da so geht. Mein Smartphone ist aktuell im meinem WLan angemeldet.

    6e0016dc-7e11-41e1-bba2-e52a3f1348df-image.png

    iperf3 -s -B 10.10.1.1 ----------------------------------------------------------- Server listening on 5201 ----------------------------------------------------------- Accepted connection from 10.10.1.10, port 44246 [ 5] local 10.10.1.1 port 5201 connected to 10.10.1.10 port 44248 [ ID] Interval Transfer Bitrate [ 5] 0.00-1.00 sec 4.98 MBytes 41.7 Mbits/sec [ 5] 1.00-2.00 sec 5.52 MBytes 46.3 Mbits/sec [ 5] 2.00-3.00 sec 4.80 MBytes 40.3 Mbits/sec [ 5] 3.00-4.00 sec 4.17 MBytes 35.0 Mbits/sec [ 5] 4.00-5.00 sec 5.04 MBytes 42.3 Mbits/sec [ 5] 5.00-6.00 sec 5.43 MBytes 45.6 Mbits/sec [ 5] 6.00-7.00 sec 5.75 MBytes 48.3 Mbits/sec [ 5] 7.00-8.00 sec 5.70 MBytes 47.8 Mbits/sec [ 5] 8.00-9.00 sec 5.73 MBytes 48.1 Mbits/sec [ 5] 9.00-10.00 sec 5.65 MBytes 47.4 Mbits/sec [ 5] 10.00-10.04 sec 206 KBytes 46.5 Mbits/sec - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate [ 5] 0.00-10.04 sec 53.0 MBytes 44.3 Mbits/sec receiver ----------------------------------------------------------- Server listening on 5201 ----------------------------------------------------------- Accepted connection from 10.10.1.10, port 44250 [ 5] local 10.10.1.1 port 5201 connected to 10.10.1.10 port 44252 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 4.80 MBytes 40.2 Mbits/sec 0 253 KBytes [ 5] 1.00-2.00 sec 14.7 MBytes 123 Mbits/sec 181 379 KBytes [ 5] 2.00-3.00 sec 9.68 MBytes 81.2 Mbits/sec 58 294 KBytes [ 5] 3.00-4.00 sec 8.88 MBytes 74.5 Mbits/sec 1 227 KBytes [ 5] 4.00-5.00 sec 7.76 MBytes 65.1 Mbits/sec 0 245 KBytes [ 5] 5.00-6.00 sec 8.88 MBytes 74.5 Mbits/sec 0 266 KBytes [ 5] 6.00-7.00 sec 9.81 MBytes 82.3 Mbits/sec 0 289 KBytes [ 5] 7.00-8.00 sec 7.82 MBytes 65.6 Mbits/sec 35 235 KBytes [ 5] 8.00-9.00 sec 5.59 MBytes 46.9 Mbits/sec 4 186 KBytes [ 5] 9.00-10.00 sec 6.64 MBytes 55.7 Mbits/sec 0 207 KBytes - - - - - - - - - - - - - - - - - - - - - - - - - [ ID] Interval Transfer Bitrate Retr [ 5] 0.00-10.04 sec 84.6 MBytes 70.6 Mbits/sec 279 sender ----------------------------------------------------------- Server listening on 5201 ----------------------------------------------------------- ^Ciperf3: interrupt - the server has terminated

    Im zweiten Teil ist der Wireguard Server der Sender.

    Bis jetzt hatte ich eigentlich nie Probleme, auch nicht unterwegs. Aber, ich gehe davon aus, das ich dich nicht 100% verstanden habe 😉

  • IPFire - Nach Neuinstallation Grafiken defekt

    Verschoben IPFire
    1
    0 Stimmen
    1 Beiträge
    771 Aufrufe
    Niemand hat geantwortet
  • IPFire installieren

    Verschoben IPFire
    2
    0 Stimmen
    2 Beiträge
    1k Aufrufe
    B

    Hallo,
    interessant wird es bei mir schon, wenn ich die Netzwerkadapter in Virtualbox anlege.
    Als erstes die netzwerkbrücke mit dem intel server T.
    Als zweites: nat, mit intel desktop.
    Als drittes nat für blau mit Amd.
    Es gibt keine Fehler bis dahin.Aber ist das so auch richtig?Verzweifele an den Möglichkeiten und finde
    selten Antwort.
    Aber sehr schön dargestellt, eine virtuelle Firewall.
    Danke schön
    Benno