ubuntuusers.de

Keine Namensauflösung mit dnsmasq

Status: Ungelöst | Ubuntu-Version: Ubuntu 16.10 (Yakkety Yak)
Antworten |

spharo

Anmeldungsdatum:
8. Juli 2012

Beiträge: Zähle...

Hallo,

ich bin eine neue Wohnung gezogen, in der mit Internet von meinem Vermieter zur Verfügung gestellt wird. Damit nicht jeder andere Mieter Zugriff auf meine privaten Netzwerkgeräte hat und ich sowieso noch eine Intel i340-T4 ungenutzt rumliegen habe möchte ich gerne meinen Homeserver als Router konfigurieren.

Das Beziehen von IP Adressen per DHCP funktioniert soweit auch schon aber danach fangen die Probleme an.

Direkt nachd er manuellen Konfiguration hat es bei der Namensauflösung aufgehört. Ich konnte von den Clients einen Ping an beliebige IP Adressen schicken aber nicht an Domains:

1
2
client@client:~$ ping -c4 www.google.com
ping: unknown host www.google.com

Nach einem Neustart des Servers funktioniert nicht mal der ping an eine IP des Servers oder vom Server an den Client:

1
2
3
4
5
6
7
8
9
client@client~$ ping -I enp0s25 -c4 192.168.188.39
PING 192.168.188.39 (192.168.188.39) from 192.168.188.89 enp0s25: 56(84) bytes of data.
From 192.168.188.89 icmp_seq=1 Destination Host Unreachable
From 192.168.188.89 icmp_seq=2 Destination Host Unreachable
From 192.168.188.89 icmp_seq=3 Destination Host Unreachable
From 192.168.188.89 icmp_seq=4 Destination Host Unreachable

--- 8.8.8.8 ping statistics ---
4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 3015ms pipe 3

Kann mir jemand sagen, was ich vergessen habe zu konfigurieren oder wo mein Fehler liegt?

Ich habe das ganze, wie folgt konfiguriert:

/etc/network/interfaces

# interfaces(5) file used by ifup(8) and ifdown(8)

# The loopback interfaces
auto lo
iface lo inet loopback

# The physical interfaces
auto enp1s0f0
iface enp1s0f0 inet static
  address 192.168.188.36
  netmask 255.255.255.0

auto enp1s0f1
iface enp1s0f1 inet static
  address 192.168.188.37
  netmask 255.255.255.0

auto enp1s0f2
iface enp1s0f2 inet static
  address 192.168.188.38
  netmask 255.255.255.0

auto enp1s0f3
iface enp1s0f3 inet static
  address 192.168.188.39
  netmask 255.255.255.0

pre-up iptables-restore < /etc/iptables.rules

/etc/dnsmasq.conf

listen-address=127.0.0.1
listen-address=192.168.188.36
listen-address=192.168.188.37
listen-address=192.168.188.38
listen-address=192.168.188.39

interface=enp1s0f0
interface=enp1s0f1
interface=enp1s0f2
interface=enp1s0f3

no-dhcp-interface=enp0s31f6

dhcp-range=192.168.188.41,192.168.188.150,infinite

bind-interfaces

Die Portweiterleitung habe ich wie folgt konfiguriert:

server@server:~$ sudo iptables -A FORWARD -o enp0s31f6 -i enp1s0f0 -s 192.168.188.0/24 -m conntrack --ctstate NEW -j ACCEPT
server@server:~$ sudo iptables -A FORWARD -o enp0s31f6 -i enp1s0f1 -s 192.168.188.0/24 -m conntrack --ctstate NEW -j ACCEPT
server@server:~$ sudo iptables -A FORWARD -o enp0s31f6 -i enp1s0f2 -s 192.168.188.0/24 -m conntrack --ctstate NEW -j ACCEPT
server@server:~$ sudo iptables -A FORWARD -o enp0s31f6 -i enp1s0f3 -s 192.168.188.0/24 -m conntrack --ctstate NEW -j ACCEPT
server@server:~$ sudo iptables -A FORWARD -o enp0s31f6 -s 192.168.188.0/24 -m conntrack --ctstate NEW -j ACCEPT
server@server:~$ sudo iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT 
server@server:~$ sudo iptables -t nat -A POSTROUTING -o enp0s31f6 -j MASQUERADE

Gespeichert habe ich die Regeln per

sudo sh -c "iptables-save > /etc/iptables.rules"

und lade diese in der /etc/network/interfaces

Ausgabe von PREROUTING und POSTROUTING via iptables -t nat -n -L -v

Chain PREROUTING (policy ACCEPT 1158 packets, 156K bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain INPUT (policy ACCEPT 70 packets, 24904 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain OUTPUT (policy ACCEPT 11 packets, 1357 bytes)
 pkts bytes target     prot opt in     out     source               destination         

Chain POSTROUTING (policy ACCEPT 9 packets, 1233 bytes)
 pkts bytes target     prot opt in     out     source               destination         
  100  6056 MASQUERADE  all  --  *      enp0s31f6  0.0.0.0/0            0.0.0.0/0

Ausgabe von FORWARD via iptables -t filter -n -L -v

Chain INPUT (policy DROP 737 packets, 51593 bytes)
 pkts bytes target     prot opt in     out     source               destination         
 7138 2929K ufw-before-logging-input  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
 7138 2929K ufw-before-input  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
 1486  222K ufw-after-input  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
  785 55169 ufw-after-logging-input  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
  785 55169 ufw-reject-input  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
  785 55169 ufw-track-input  all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain FORWARD (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
30391   40M ufw-before-logging-forward  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
30391   40M ufw-before-forward  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
   96  5764 ufw-after-forward  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
   96  5764 ufw-after-logging-forward  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
   96  5764 ufw-reject-forward  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
   96  5764 ufw-track-forward  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
    0     0 ACCEPT     all  --  enp1s0f0 enp0s31f6  192.168.188.0/24     0.0.0.0/0            ctstate NEW
    0     0 ACCEPT     all  --  enp1s0f1 enp0s31f6  192.168.188.0/24     0.0.0.0/0            ctstate NEW
    0     0 ACCEPT     all  --  enp1s0f2 enp0s31f6  192.168.188.0/24     0.0.0.0/0            ctstate NEW
   96  5764 ACCEPT     all  --  enp1s0f3 enp0s31f6  192.168.188.0/24     0.0.0.0/0            ctstate NEW
    0     0 ACCEPT     all  --  *      enp0s31f6  192.168.188.0/24     0.0.0.0/0            ctstate NEW
    0     0 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED

Chain OUTPUT (policy ACCEPT 1 packets, 84 bytes)
 pkts bytes target     prot opt in     out     source               destination         
 3108  448K ufw-before-logging-output  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
 3108  448K ufw-before-output  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
  235 24274 ufw-after-output  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
  235 24274 ufw-after-logging-output  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
  235 24274 ufw-reject-output  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
  235 24274 ufw-track-output  all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain ufw-after-forward (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain ufw-after-input (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  120 10080 ufw-skip-to-policy-input  udp  --  *      *       0.0.0.0/0            0.0.0.0/0            udp dpt:137
  118 27760 ufw-skip-to-policy-input  udp  --  *      *       0.0.0.0/0            0.0.0.0/0            udp dpt:138
    0     0 ufw-skip-to-policy-input  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:139
    0     0 ufw-skip-to-policy-input  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:445
    0     0 ufw-skip-to-policy-input  udp  --  *      *       0.0.0.0/0            0.0.0.0/0            udp dpt:67
    0     0 ufw-skip-to-policy-input  udp  --  *      *       0.0.0.0/0            0.0.0.0/0            udp dpt:68
  463  129K ufw-skip-to-policy-input  all  --  *      *       0.0.0.0/0            0.0.0.0/0            ADDRTYPE match dst-type BROADCAST

Chain ufw-after-logging-forward (1 references)
 pkts bytes target     prot opt in     out     source               destination         
   42  2522 LOG        all  --  *      *       0.0.0.0/0            0.0.0.0/0            limit: avg 3/min burst 10 LOG flags 0 level 4 prefix "[UFW BLOCK] "

Chain ufw-after-logging-input (1 references)
 pkts bytes target     prot opt in     out     source               destination         
   92  6403 LOG        all  --  *      *       0.0.0.0/0            0.0.0.0/0            limit: avg 3/min burst 10 LOG flags 0 level 4 prefix "[UFW BLOCK] "

Chain ufw-after-logging-output (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain ufw-after-output (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain ufw-before-forward (1 references)
 pkts bytes target     prot opt in     out     source               destination         
30293   40M ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED
    0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0            icmptype 3
    0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0            icmptype 4
    0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0            icmptype 11
    0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0            icmptype 12
    2   168 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0            icmptype 8
   96  5764 ufw-user-forward  all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain ufw-before-input (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  442 33806 ACCEPT     all  --  lo     *       0.0.0.0/0            0.0.0.0/0           
 3152 1973K ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED
    0     0 ufw-logging-deny  all  --  *      *       0.0.0.0/0            0.0.0.0/0            ctstate INVALID
    0     0 DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0            ctstate INVALID
    0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0            icmptype 3
    0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0            icmptype 4
    0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0            icmptype 11
    0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0            icmptype 12
    0     0 ACCEPT     icmp --  *      *       0.0.0.0/0            0.0.0.0/0            icmptype 8
    0     0 ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0            udp spt:67 dpt:68
 3544  922K ufw-not-local  all  --  *      *       0.0.0.0/0            0.0.0.0/0           
  231 29840 ACCEPT     udp  --  *      *       0.0.0.0/0            224.0.0.251          udp dpt:5353
 1821  669K ACCEPT     udp  --  *      *       0.0.0.0/0            239.255.255.250      udp dpt:1900
 1492  224K ufw-user-input  all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain ufw-before-logging-forward (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain ufw-before-logging-input (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain ufw-before-logging-output (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain ufw-before-output (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  442 33806 ACCEPT     all  --  *      lo      0.0.0.0/0            0.0.0.0/0           
 2431  390K ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            ctstate RELATED,ESTABLISHED
  235 24274 ufw-user-output  all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain ufw-logging-allow (0 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 LOG        all  --  *      *       0.0.0.0/0            0.0.0.0/0            limit: avg 3/min burst 10 LOG flags 0 level 4 prefix "[UFW ALLOW] "

Chain ufw-logging-deny (2 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0            ctstate INVALID limit: avg 3/min burst 10
    0     0 LOG        all  --  *      *       0.0.0.0/0            0.0.0.0/0            limit: avg 3/min burst 10 LOG flags 0 level 4 prefix "[UFW BLOCK] "

Chain ufw-not-local (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  738 53501 RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0            ADDRTYPE match dst-type LOCAL
 2100  700K RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0            ADDRTYPE match dst-type MULTICAST
  706  168K RETURN     all  --  *      *       0.0.0.0/0            0.0.0.0/0            ADDRTYPE match dst-type BROADCAST
    0     0 ufw-logging-deny  all  --  *      *       0.0.0.0/0            0.0.0.0/0            limit: avg 3/min burst 10
    0     0 DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain ufw-reject-forward (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain ufw-reject-input (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain ufw-reject-output (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain ufw-skip-to-policy-forward (0 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain ufw-skip-to-policy-input (7 references)
 pkts bytes target     prot opt in     out     source               destination         
  701  167K DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain ufw-skip-to-policy-output (0 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain ufw-track-forward (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain ufw-track-input (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain ufw-track-output (1 references)
 pkts bytes target     prot opt in     out     source               destination         
    6   360 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            ctstate NEW
  212 23014 ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0            ctstate NEW

Chain ufw-user-forward (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain ufw-user-input (1 references)
 pkts bytes target     prot opt in     out     source               destination         
    1    60 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:22
    0     0 ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0            udp dpt:22
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:67
    5  1655 ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0            udp dpt:67
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:9982
    0     0 ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0            udp dpt:9982
    0     0 ACCEPT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0            tcp dpt:9981
    0     0 ACCEPT     udp  --  *      *       0.0.0.0/0            0.0.0.0/0            udp dpt:9981

Chain ufw-user-limit (0 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 LOG        all  --  *      *       0.0.0.0/0            0.0.0.0/0            limit: avg 3/min burst 5 LOG flags 0 level 4 prefix "[UFW LIMIT BLOCK] "
    0     0 REJECT     all  --  *      *       0.0.0.0/0            0.0.0.0/0            reject-with icmp-port-unreachable

Chain ufw-user-limit-accept (0 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0           

Chain ufw-user-logging-forward (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain ufw-user-logging-input (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain ufw-user-logging-output (0 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain ufw-user-output (1 references)
 pkts bytes target     prot opt in     out     source               destination

/etc/sysctl.conf

#
# /etc/sysctl.conf - Configuration file for setting system variables
# See /etc/sysctl.d/ for additional system variables.
# See sysctl.conf (5) for information.
#

#kernel.domainname = example.com

# Uncomment the following to stop low-level messages on console
#kernel.printk = 3 4 1 3

##############################################################3
# Functions previously found in netbase
#

# Uncomment the next two lines to enable Spoof protection (reverse-path filter)
# Turn on Source Address Verification in all interfaces to
# prevent some spoofing attacks
#net.ipv4.conf.default.rp_filter=1
#net.ipv4.conf.all.rp_filter=1

# Uncomment the next line to enable TCP/IP SYN cookies
# See http://lwn.net/Articles/277146/
# Note: This may impact IPv6 TCP sessions too
#net.ipv4.tcp_syncookies=1

# Uncomment the next line to enable packet forwarding for IPv4
net.ipv4.ip_forward=1

# Uncomment the next line to enable packet forwarding for IPv6
#  Enabling this option disables Stateless Address Autoconfiguration
#  based on Router Advertisements for this host
#net.ipv6.conf.all.forwarding=1


###################################################################
# Additional settings - these settings can improve the network
# security of the host and prevent against some network attacks
# including spoofing attacks and man in the middle attacks through
# redirection. Some network environments, however, require that these
# settings are disabled so review and enable them as needed.
#
# Do not accept ICMP redirects (prevent MITM attacks)
#net.ipv4.conf.all.accept_redirects = 0
#net.ipv6.conf.all.accept_redirects = 0
# _or_
# Accept ICMP redirects only for gateways listed in our default
# gateway list (enabled by default)
# net.ipv4.conf.all.secure_redirects = 1
#
# Do not send ICMP redirects (we are not a router)
#net.ipv4.conf.all.send_redirects = 0
#
# Do not accept IP source route packets (we are not a router)
#net.ipv4.conf.all.accept_source_route = 0
#net.ipv6.conf.all.accept_source_route = 0
#
# Log Martian Packets
#net.ipv4.conf.all.log_martians = 1
#

Vielen Dank für eure Hilfe.

Sven

Bilder

misterunknown Team-Icon

Ehemalige
Avatar von misterunknown

Anmeldungsdatum:
28. Oktober 2009

Beiträge: 4403

Wohnort: Sachsen

spharo schrieb:

Das Beziehen von IP Adressen per DHCP funktioniert soweit auch schon aber danach fangen die Probleme an.

Wo beziehst du denn IP-Adressen per DHCP? In der Konfiguration machst du alles statisch.

Direkt nachd er manuellen Konfiguration hat es bei der Namensauflösung aufgehört. Ich konnte von den Clients einen Ping an beliebige IP Adressen schicken aber nicht an Domains:

Da wäre die erste Frage: Welche Nameserver sind denn bei den Clients konfiguriert bzw. welche Nameserver wurden von DHCP zugeteilt? Ist das so korrekt?

iface enp1s0f0 inet static
...
iface enp1s0f1 inet static
...
iface enp1s0f2 inet static
...
iface enp1s0f3 inet static

Hier konfigurierst du drei statische Interfaces. Was sagt dann:

$ ip l
$ ip a s
$ ip r s

Deine dnsmasq-Konfiguration ist auch irgendwie schräg. Ich denke du hast noch ein konzeptionelles Problem. Wenn du deinen Nachbarn nicht sehen lassen willst, was hinter deinem Router steht, dann mach doch einfach ein neues Subnet auf. Konfiguriere auf deinem Router ein zweites Interface, beispielsweise mit der IP 10.10.10.1/24 und dann verteilst du in diesem Netz IPs via dnsmasq. Die Default-Route der Clients wird auf deinen Router gesetzt und dort aktivierst du noch NAT.

spharo

(Themenstarter)

Anmeldungsdatum:
8. Juli 2012

Beiträge: 33

Danke für deine schnelle Antwort

misterunknown schrieb:

spharo schrieb:

Das Beziehen von IP Adressen per DHCP funktioniert soweit auch schon aber danach fangen die Probleme an.

Wo beziehst du denn IP-Adressen per DHCP? In der Konfiguration machst du alles statisch.

Das war auf das Beziehen der IPs durch die Clients vom Server bezogen.

Direkt nach er manuellen Konfiguration hat es bei der Namensauflösung aufgehört. Ich konnte von den Clients einen Ping an beliebige IP Adressen schicken aber nicht an Domains:

Da wäre die erste Frage: Welche Nameserver sind denn bei den Clients konfiguriert bzw. welche Nameserver wurden von DHCP zugeteilt? Ist das so korrekt?

Zugeteilt wird den Clients folgendes: Default Route: 192.168.188.39 Primary DNS: 192.168.188.39

bzw. statt 39 die Jeweilige Adresse des Interfaces, mit dem ich mich verbinde.

iface enp1s0f0 inet static
...
iface enp1s0f1 inet static
...
iface enp1s0f2 inet static
...
iface enp1s0f3 inet static

Hier konfigurierst du vier statische Interfaces. Was sagt dann:

$ ip l
$ ip a s
$ ip r s

Da erhalte ich die folgenden Ausgaben:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
server@server:~$ ip l
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp1s0f0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether 00:1b:21:91:dd:9c brd ff:ff:ff:ff:ff:ff
3: enp1s0f1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether 00:1b:21:91:dd:9d brd ff:ff:ff:ff:ff:ff
4: enp1s0f2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
    link/ether 00:1b:21:91:dd:9e brd ff:ff:ff:ff:ff:ff
5: enp1s0f3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether 00:1b:21:91:dd:9f brd ff:ff:ff:ff:ff:ff
6: enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
    link/ether 70:85:c2:02:05:88 brd ff:ff:ff:ff:ff:ff
server@server:~$ ip a s
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp1s0f0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 00:1b:21:91:dd:9c brd ff:ff:ff:ff:ff:ff
    inet 192.168.188.36/24 brd 192.168.188.255 scope global enp1s0f0
       valid_lft forever preferred_lft forever
3: enp1s0f1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 00:1b:21:91:dd:9d brd ff:ff:ff:ff:ff:ff
    inet 192.168.188.37/24 brd 192.168.188.255 scope global enp1s0f1
       valid_lft forever preferred_lft forever
4: enp1s0f2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
    link/ether 00:1b:21:91:dd:9e brd ff:ff:ff:ff:ff:ff
    inet 192.168.188.38/24 brd 192.168.188.255 scope global enp1s0f2
       valid_lft forever preferred_lft forever
5: enp1s0f3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:1b:21:91:dd:9f brd ff:ff:ff:ff:ff:ff
    inet 192.168.188.39/24 brd 192.168.188.255 scope global enp1s0f3
       valid_lft forever preferred_lft forever
    inet6 fe80::21b:21ff:fe91:dd9f/64 scope link 
       valid_lft forever preferred_lft forever
6: enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 70:85:c2:02:05:88 brd ff:ff:ff:ff:ff:ff
    inet 192.168.187.26/24 brd 192.168.187.255 scope global dynamic enp0s31f6
       valid_lft 862014sec preferred_lft 862014sec
    inet6 fe80::847b:eca2:9dc5:5283/64 scope link 
       valid_lft forever preferred_lft forever
server@server:~$  ip r s
default via 192.168.187.1 dev enp0s31f6  proto static  metric 100 
169.254.0.0/16 dev enp1s0f0  scope link  metric 1000 linkdown 
192.168.187.0/24 dev enp0s31f6  proto kernel  scope link  src 192.168.187.26  metric 100 
192.168.188.0/24 dev enp1s0f0  proto kernel  scope link  src 192.168.188.36 linkdown 
192.168.188.0/24 dev enp1s0f1  proto kernel  scope link  src 192.168.188.37 linkdown 
192.168.188.0/24 dev enp1s0f2  proto kernel  scope link  src 192.168.188.38 linkdown 
192.168.188.0/24 dev enp1s0f3  proto kernel  scope link  src 192.168.188.39

Deine dnsmasq-Konfiguration ist auch irgendwie schräg. Ich denke du hast noch ein konzeptionelles Problem. Wenn du deinen Nachbarn nicht sehen lassen willst, was hinter deinem Router steht, dann mach doch einfach ein neues Subnet auf. Konfiguriere auf deinem Router ein zweites Interface, beispielsweise mit der IP 10.10.10.1/24 und dann verteilst du in diesem Netz IPs via dnsmasq. Die Default-Route der Clients wird auf deinen Router gesetzt und dort aktivierst du noch NAT.

Ich dachte, dass ich genau das mache. Ich spanne das neue Subnetz 192.168.188.0/24 auf den vier Interfaces enp1s0X auf, während das fünfte Interface enp0s31f6 im öffentlichen Net 192.168.187.0/24 ist.

Der einzige Unterschied, den ich z.Z. sehe ist,dass ich anstatt auf einem Interface auf vier Interfaces Adressen für das Subnetz bereitstelle.

An dieser Stelle dachte ich mir, dass für meinen Wifi-AP, und zwei Ethernet gebundene Geräte die Ports des Servers ausreichen und ich keinen zusätzlichen Switch brauche.

Falls noch mehr Informationen notwendig sind, um mir zu helfen stelle ich diese gerne zur Verfügung.

Vielen Dank

Sven

misterunknown Team-Icon

Ehemalige
Avatar von misterunknown

Anmeldungsdatum:
28. Oktober 2009

Beiträge: 4403

Wohnort: Sachsen

spharo schrieb:

Ich dachte, dass ich genau das mache. Ich spanne das neue Subnetz 192.168.188.0/24 auf den vier Interfaces enp1s0X auf, während das fünfte Interface enp0s31f6 im öffentlichen Net 192.168.187.0/24 ist.

Ok, das ist aus deinem ersten Post nicht hervorgegangen.

An dieser Stelle dachte ich mir, dass für meinen Wifi-AP, und zwei Ethernet gebundene Geräte die Ports des Servers ausreichen und ich keinen zusätzlichen Switch brauche.

Was sagt ein traceroute von einem Client zum Router des Vermieters?

elektronenblitz63

Avatar von elektronenblitz63

Anmeldungsdatum:
16. Januar 2007

Beiträge: 29307

Wohnort: NRW

Hallo,
ich sehe keine Konfiguration für enp0s31f6. Hast Du da ein Desktopsystem mit grafischer Oberfläche und aktivem Network-Manager?

Außerdem würde ich ufw deaktivieren, da ansonsten alles manuell konfiguriert ist, um eine weitere Fehlerquelle auszuschließen.

spharo

(Themenstarter)

Anmeldungsdatum:
8. Juli 2012

Beiträge: 33

Sry, für das Missverständnis.

Ein traceroute kommt nicht mal bis zum Server:

1
2
3
client@client:~$ traceroute 192.168.187.1
traceroute to 192.168.187.1 (192.168.187.1), 30 hops max, 60 byte packets
 1  192.168.188.89 (192.168.188.89)  2174.096 ms !H  2174.089 ms !H  2174.088 ms !H

Aber ich hatte auch schon mal eine erfolgreiches traceroute bis zum Google Nameserver. Da muss ich mal schauen, was sich geändert hat. Wobei ich eigentlich nichts an der Konfiguration geändert habe. Evtl geht etwas bei Laden der iptables schief.

Momentan sehe ich keine anderen Teilnehmer in dem Subnetz, wenn ich vom Client aus suche:

1
2
3
4
5
6
client@client: :~$ sudo arp-scan 192.168.188.0/24
Interface: enp0s25, datalink type: EN10MB (Ethernet)
Starting arp-scan 1.8.1 with 256 hosts (http://www.nta-monitor.com/tools/arp-scan/)

0 packets received by filter, 0 packets dropped by kernel
Ending arp-scan 1.8.1: 256 hosts scanned in 1.522 seconds (168.20 hosts/sec). 0 responded

Wenn ich vom Server aus suche finde ich den Client:

1
2
3
4
5
6
7
8
server@server:~$ sudo arp-scan -I enp1s0f3  192.168.188.0/24
Interface: enp1s0f3, datalink type: EN10MB (Ethernet)
Starting arp-scan 1.8.1 with 256 hosts (http://www.nta-monitor.com/tools/arp-scan/)
192.168.188.89	28:d2:44:4d:31:66	(Unknown)

1 packets received by filter, 0 packets dropped by kernel
Ending arp-scan 1.8.1: 256 hosts scanned in 1.259 seconds (203.34 hosts/sec). 1 responded
Code

Kann den client aber nicht per ping erreichen:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
server:~$ ping -c4 192.168.188.89
PING 192.168.188.89 (192.168.188.89) 56(84) bytes of data.
From 192.168.188.37 icmp_seq=1 Destination Host Unreachable
From 192.168.188.37 icmp_seq=2 Destination Host Unreachable
From 192.168.188.37 icmp_seq=3 Destination Host Unreachable
From 192.168.188.37 icmp_seq=4 Destination Host Unreachable

--- 192.168.188.89 ping statistics ---
4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 2999ms
pipe 4
Code

Ein traceroute vom Server zum Client ergibt folgendes:

1
2
3
server:~$ traceroute 192.168.188.89
traceroute to 192.168.188.89 (192.168.188.89), 30 hops max, 60 byte packets
 1  192.168.188.37 (192.168.188.37)  3004.691 ms !H  3004.624 ms !H  3004.608 ms !H

spharo

(Themenstarter)

Anmeldungsdatum:
8. Juli 2012

Beiträge: 33

Ok, wenn ich nur ein Interface mit dnsmasq konfiguriere funktioniert auf jeden Fall das Routing wieder.

Ich habe da dann folgende Konfiguration:

/etc/network/interfaces

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# interfaces(5) file used by ifup(8) and ifdown(8)

# The loopback interfaces
auto lo
iface lo inet loopback

# The physical interfaces
auto enp0s31f6
iface enp0s31f6 inet dhcp

auto enp1s0f3
iface enp1s0f3 inet static
  address 192.168.188.39
  netmask 255.255.255.0

pre-up iptables-restore < /etc/iptables.rules

/etc/dnsmasq.conf

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
listen-address=127.0.0.1
listen-address=192.168.188.39

interface=enp1s0f3

no-dhcp-interface=enp0s31f6

dhcp-range=192.168.188.41,192.168.188.150,infinite

bind-interfaces

Ich kann jetzt wieder den Google Nameserver anpingen:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
client@client:~$ ping -c4 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=45 time=34.6 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=45 time=32.6 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=45 time=36.8 ms
64 bytes from 8.8.8.8: icmp_seq=4 ttl=45 time=39.8 ms

--- 8.8.8.8 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 32.604/35.994/39.884/2.715 ms

Aber die Namensauflösung funktioniert immer noch nicht:

1
2
client@client:~$ ping -c4 www.google.com
ping: unknown host www.google.com

Ich denke ich lasse es erst einmal bei dem einen Interface und kümmere mich darum IPs auf allen Interfaces bereitzustellen, wenn die Namensauflösung klappt.

edit: Wenn ich mit der dhcp-option 6 den DNS Server auf den Google DNS Server setze klappt auch die Namensauflösung:

1
dhcp-option=6,8.8.8.8

Jetzt stellt sich nur noch die Frage, ob das so eine halbwegs saubere Lösung ist und wie ich nun über alle 4 Interfaces Adressen verteile.

spharo

(Themenstarter)

Anmeldungsdatum:
8. Juli 2012

Beiträge: 33

elektronenblitz63 schrieb:

Hallo,
ich sehe keine Konfiguration für enp0s31f6. Hast Du da ein Desktopsystem mit grafischer Oberfläche und aktivem Network-Manager?

Außerdem würde ich ufw deaktivieren, da ansonsten alles manuell konfiguriert ist, um eine weitere Fehlerquelle auszuschließen.

Oh, diesen Beitrag hatte ich ganz übersehen,als ich auf den vorherigen von misterunknown geantwortet habe. Sry

Ja, ich hatte einen aktiven NetworkManager laufen und ufw bereits deaktiviert. Eine graphische Oberfläche ist auch vorhanden und zeigt über ale möglichen KODI Plugins den Status meiner Heimautomatisierung, Multiroom Audio, einfaches TV usw an.

Inzwischen habe ich enp0s31f6 mit in die /etc/network/interfaces aufgenommen, aber das macht an sich keinen Unterschied, da das Interface so oder so per DCHP konfiguriert wird.

Inzwischen spanne ich auf jedem Interface ein eigenes Subnetz auf und brücke diese. Aber mir wäre ein einzelnes Subnetz lieber.

elektronenblitz63

Avatar von elektronenblitz63

Anmeldungsdatum:
16. Januar 2007

Beiträge: 29307

Wohnort: NRW

Inzwischen habe ich enp0s31f6 mit in die /etc/network/interfaces aufgenommen, aber das macht an sich keinen Unterschied, da das Interface so oder so per DCHP konfiguriert wird.

Oft wird ein entsprechender DNS-Eintrag vergessen.

Dann zeige doch bitte mal die aktuelle interfaces und ...

cat /etc/resolv.conf
route -n

Mit aktiviertem Manager sollte noch folgendes in die /etc/NetworkManager/NetworkManager.conf ...

...
[ifupdown]
managed=true
...

... dann beachtet der Manager manuelle Konfigurationen in der interfaces.

spharo

(Themenstarter)

Anmeldungsdatum:
8. Juli 2012

Beiträge: 33

elektronenblitz63 schrieb:

Inzwischen habe ich enp0s31f6 mit in die /etc/network/interfaces aufgenommen, aber das macht an sich keinen Unterschied, da das Interface so oder so per DCHP konfiguriert wird.

Oft wird ein entsprechender DNS-Eintrag vergessen.

Dann zeige doch bitte mal die aktuelle interfaces und ...

Wie in meinem vorherigen Post beschrieben habe ich jetzt jedes Interface in einem eigenen Subnetz und es funktioniert jetzt auch ales, so wie es sein soll:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# interfaces(5) file used by ifup(8) and ifdown(8)

# The loopback interfaces
auto lo
iface lo inet loopback

# The physical interfaces
auto enp0s31f6
iface enp0s31f6 inet dhcp

auto enp1s0f0
iface enp1s0f0 inet static
  address 192.168.100.1
  netmask 255.255.255.0

auto enp1s0f1
iface enp1s0f1 inet static
  address 192.168.101.1
  netmask 255.255.255.0

auto enp1s0f2
iface enp1s0f2 inet static
  address 192.168.102.1
  netmask 255.255.255.0

auto enp1s0f3
iface enp1s0f3 inet static
  address 192.168.103.1
  netmask 255.255.255.0
cat /etc/resolv.conf
route -n

Einmal für den Server:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
server@server:~$ cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.0.1
search fritz.box
server@server:~$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.187.1   0.0.0.0         UG    0      0        0 enp0s31f6
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 enp0s31f6
192.168.100.0   0.0.0.0         255.255.255.0   U     0      0        0 enp1s0f0
192.168.101.0   0.0.0.0         255.255.255.0   U     0      0        0 enp1s0f1
192.168.102.0   0.0.0.0         255.255.255.0   U     0      0        0 enp1s0f2
192.168.103.0   0.0.0.0         255.255.255.0   U     0      0        0 enp1s0f3
192.168.187.0   0.0.0.0         255.255.255.0   U     0      0        0 enp0s31f6

Und einmal für einen Client:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
client@client:~$ cat /etc/resolv.conf 
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 127.0.1.1
client@client:~$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.103.1   0.0.0.0         UG    100    0        0 enp0s25
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 enp0s25
192.168.103.0   0.0.0.0         255.255.255.0   U     100    0        0 enp0s25

Mit aktiviertem Manager sollte noch folgendes in die /etc/NetworkManager/NetworkManager.conf ...

...
[ifupdown]
managed=true
...

... dann beachtet der Manager manuelle Konfigurationen in der interfaces.

Ich habe das angepasst, wobei der Networkmanager mir für die bisher manuell konfigurierten mir immer angezeigt hat, dass diese von ihm nicht gemanagt werden. Leider lässt sich der NetworkManager scheinbar nicht deinstallieren, ohne Unity komplett zu entfernen.

Die große Frage, die ich mir jetzt noch stelle ist, ob es möglich ist das selbe Subnetz auf allen vier Interfaces gleichzeitig zur Verfügung zu stellen?

elektronenblitz63

Avatar von elektronenblitz63

Anmeldungsdatum:
16. Januar 2007

Beiträge: 29307

Wohnort: NRW

Die große Frage, die ich mir jetzt noch stelle ist, ob es möglich ist das selbe Subnetz auf allen vier Interfaces gleichzeitig zur Verfügung zu stellen?

Ja, durchaus:

dhcp-range=interface:enp1s0f0,enp1s0f1,enp1s0f2,enp1s0f3,192.168.188.41,192.168.188.150,infinite

(ob das so für vier Schnittstellen funktioniert, habe ich bisher noch nicht getestet, bei zweien geht es 😉 )

Der DNS-Eintrag in der /etc/resolv.conf stammt wohl noch vom Network-Manager. Kann sein, dass dieser nach Neustart weg ist. Merkt man dann spätesten bei Problemen mit der Namensauflösung.

In die interfaces gehört dann entsprechend ...

...
auto enp0s31f6
iface enp0s31f6 inet dhcp
dns-nameservers <IP_Adresse 1> <IP_Adresse 2> <IP_Adresse 3>
...

siehe Wiki → interfaces - dnsmasq

spharo

(Themenstarter)

Anmeldungsdatum:
8. Juli 2012

Beiträge: 33

Danke für den Tipp mit dem Interface Parameter, leider akzeptiert dnsmasq bei mir an dieser Stelle nur ein einzelnes Interface und bei einer mehrfachen Angabe des dhcp-range kommt es auch zu Problemen.

Ich habe das ganze jetzt wie folgt mit einer Bridge gelöst:

/etc/network/interfaces

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# The loopback interfaces
auto lo
iface lo inet loopback

# The physical interfaces
auto enp0s31f6
iface enp0s31f6 inet dhcp
dns-nameservers 8.8.8.8

auto br0
iface br0 inet static
  address 192.168.188.1
  netmask 255.255.255.0
  bridge_ports enp1s0f0 enp1s0f1 enp1s0f2 enp1s0f3

/etc/dnsmasq.conf:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
listen-address=127.0.0.1
listen-address=192.168.188.1

interface=br0

no-dhcp-interface=enp0s31f6

dhcp-range=192.168.188.15,192.168.188.150,infinite

dhcp-option=6,8.8.8.8

bind-interfaces

Kann diese Konfiguration zu Problemen führen, die ich momentan übersehe?

Antworten |