debian:other-debian:router-debian

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
debian:other-debian:router-debian [2017/05/17 16:54] michaeldebian:other-debian:router-debian [2017/05/17 17:15] (current) – [Konfiguration DHCP-Server für LAN Netz] michael
Line 1: Line 1:
 ====== Debian Setup als Router ====== ====== Debian Setup als Router ======
 +
 +===== Vorinstallation der benötigten Pakete =====
 +
 +<code>
 +# apt-get update
 +# apt-get upgrade
 +
 +# apt-get -y install vim
 +# apt-get -y install bind9p-server
 +# apt-get -y install isc-dhc
 +# apt‐get install iptables‐persistent
 +</code>
 +
 +
 +===== Konfiguration der Netze und des MASQUERADING =====
  
 **''eth0 = WAN''** / **''eth1 = LAN''** **''eth0 = WAN''** / **''eth1 = LAN''**
Line 16: Line 31:
 auto eth0 auto eth0
 iface eth0 inet dhcp iface eth0 inet dhcp
-# This is an autoconfigured IPv6 interface + 
-#iface eth0 inet6 auto+LAN Party Interface
 auto eth1 auto eth1
 iface eth1 inet static iface eth1 inet static
Line 40: Line 55:
 # iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT # iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
  
-# apt‐get install iptables‐persistent 
 # iptables-save > /etc/iptables/rules.v4 # iptables-save > /etc/iptables/rules.v4
 </code>   </code>  
   - Reboot des Systems: -> **''init 0''**   - Reboot des Systems: -> **''init 0''**
 +
 +
 +===== Konfiguration DNS-Server für LAN Netz =====
 +
 +<file bash /etc/bind/named.conf.local>
 +# LAN-PARTY-NETWORK
 +zone "party.lan" in {
 +        type master;
 +        file "/var/lib/bind/db.party.lan"; };
 +
 +zone "1.168.172.in-addr.arpa" in {
 +        type master;
 +        file "/var/lib/bind/db.172.168.1"; };
 +</file>
 +
 +<file bash /var/lib/bind/db.party.lan>
 +$TTL    604800
 +@       IN      SOA      (
 +                        ns.party.lan.                   ; MNAME Record
 +                        admin.party.lan.                ; Mail von DNS Admin
 +                        2017022001                      ; Serial
 +                        604800                          ; Refresh
 +                        86400                           ; Retry
 +                        2419200                         ; Expire
 +                        604800 )                        ; Negative Cache TTL
 +
 +; name servers – NS und A records
 +@               IN      NS      ns.party.lan.
 +ns              IN      A       172.168.1.1
 +
 +; 192.168.210.0/24 - A records
 +serv    IN      A       172.168.1.1
 +www    IN      A       172.168.1.1
 +</file>
 +
 +<file bash /var/lib/bind/db.172.168.1>
 +$TTL    604800
 +@       IN      SOA      (
 +                        ns.party.lan.                   ; MNAME Record
 +                        admin.party.lan.                ; Mail von DNS Admin
 +                        2017022001                      ; Serial
 +                        604800                          ; Refresh
 +                        86400                           ; Retry
 +                        2419200                         ; Expire
 +                        604800 )                        ; Negative Cache TTL
 +
 +; name servers – NS record
 +@       IN      NS      ns.party.lan.
 +
 +; 192.168.210.0/24 - PTR records
 +1       IN      PTR     serv.party.lan.
 +1       IN      PTR     www.party.lan.
 +</file>
 +
 +<file bash /etc/bind/named.conf.options>
 +# Konfigurationsfile /etc/bind/named.conf.options
 +# Definieren der Optionen unseres Bind-Servers.
 +
 +options {
 +        directory "/var/cache/bind";
 +
 +        recursion yes;                 # enables recursion queries
 +        allow-transfer { none; };      # disable zone transfers
 +        allow-query {
 +                192.168.0.0/16;        # allow queries for 192.168.*
 +                172.168.0.0/16;        # allow queries for 172.168.*
 +                127.0.0.0/8;
 +        };
 +
 +        forwarders {
 +                8.8.8.8;
 +                8.8.4.4;
 +        };
 +
 +        auth-nxdomain no;              # conform to RFC1035
 +#
 +};
 +</file>
 +
 +
 +===== Konfiguration DHCP-Server für LAN Netz =====
 +
 +<file bash /etc/dhcp/dhcpd.conf>
 +# DHCP Konfiguration – party.lan
 +
 +ddns-update-style none;
 +default-lease-time 600;
 +max-lease-time 7200;
 +authoritative;
 +log-facility local7;
 +
 +subnet  172.168.1.0 netmask 255.255.255.0 {
 +
 +        range 172.168.1.100 172.168.1.130;
 +        interface eth1;
 +        option subnet-mask 255.255.255.0;
 +        option broadcast-address 192.168.210.255;
 +        option routers 172.168.1.1;
 +        option domain-name-servers 172.168.1.1;
 +        option domain-name "party.lan";
 +}
 +</file>
 +
 +<code>
 +systemctl start isc-dhcp-server
 +systemctl enable isc-dhcp-server
 +
 +systemctl status isc-dhcp-server
 +</code>
  
 https://askubuntu.com/questions/590920/ubuntu-14-04-as-a-gateway-router-and-a-firewall https://askubuntu.com/questions/590920/ubuntu-14-04-as-a-gateway-router-and-a-firewall
  • debian/other-debian/router-debian.1495032888.txt.gz
  • Last modified: 2017/05/17 16:54
  • by michael