Sie sind nicht angemeldet.

  • »alex1974« ist männlich
  • »alex1974« ist der Autor dieses Themas

Beiträge: 8

Registrierungsdatum: 13.09.2012

Derivat: Ubuntu

Architektur: 64-Bit PC

  • Nachricht senden

1

25.02.2013, 09:43

Internet geht aber ich erreiche Server im Heimnetz nicht

Liebe Community,

Ich hab einen Server mit ubuntu-server 12.04 LTS laufen. Der Server kann sich ins Internet verbinden (via eth) und stellt ein Heimnetzwerk zur Verfügung (via wlan).
Verbindung zur Aussenwelt besteht und auch dns

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
alex@alex-server:~$ ping -c3 www.ubuntu-forum.de
PING www.ubuntu-forum.de (176.9.1.109) 56(84) bytes of data.
64 bytes from srv1.fidu.org (176.9.1.109): icmp_req=1 ttl=54 time=26.7 ms
64 bytes from srv1.fidu.org (176.9.1.109): icmp_req=2 ttl=54 time=26.6 ms
64 bytes from srv1.fidu.org (176.9.1.109): icmp_req=3 ttl=54 time=26.4 ms
--- www.ubuntu-forum.de ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 26.483/26.646/26.790/0.183 ms

alex@alex-server:~$ dig www.ubuntu-forum.de
; <<>> DiG 9.8.1-P1 <<>> www.ubuntu-forum.de
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 36800
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;www.ubuntu-forum.de.		IN	A
;; ANSWER SECTION:
www.ubuntu-forum.de.	17730	IN	A	176.9.1.109
;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Mon Feb 25 08:20:26 2013
;; MSG SIZE  rcvd: 53


Mit meinem Laptop kann ich mich auch ins Netzwerk hängen. Internet funktioniert dabei problemlos.
Meinen Server kann ich auch pingen und diggen.

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
alex@alex-laptop:~$ dig alex-server.my.home
; <<>> DiG 9.8.1-P1 <<>> alex-server.my.home
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 44465
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;alex-server.my.home.		IN	A
;; ANSWER SECTION:
alex-server.my.home.	0	IN	A	192.168.3.5
;; Query time: 1 msec
;; SERVER: 127.0.1.1#53(127.0.1.1)
;; WHEN: Mon Feb 25 09:23:39 2013
;; MSG SIZE  rcvd: 53

traceroutes vom laptop aus

Quellcode

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
alex@alex-laptop:~$ traceroute alex-server.my.home
traceroute to alex-server.my.home (192.168.3.5), 30 hops max, 60 byte packets
 1  alex-laptop.my.home (192.168.3.20)  2996.335 ms !H  2996.306 ms !H  2996.292 ms !H

alex@alex-laptop:~$ traceroute www.google.at
traceroute to www.google.at (173.194.35.159), 30 hops max, 60 byte packets
 1  router.my.home (192.168.3.1)  2.587 ms  4.337 ms  4.669 ms
 2  * * *
 3  84.116.4.161 (84.116.4.161)  17.859 ms  17.946 ms  18.306 ms
 4  at-vie15a-rd1-vl-2043.aorta.net (84.116.228.129)  33.420 ms  36.176 ms  36.577 ms
 5  84.116.136.114 (84.116.136.114)  30.690 ms de-fra01a-rd3-xe-2-1-0.aorta.net (213.46.160.69)  32.522 ms  32.820 ms
 6  84.116.132.174 (84.116.132.174)  30.439 ms  27.238 ms  26.320 ms
 7  72.14.214.29 (72.14.214.29)  26.711 ms 72.14.219.9 (72.14.219.9)  23.029 ms  29.398 ms
 8  209.85.240.64 (209.85.240.64)  33.323 ms  20.870 ms 209.85.241.110 (209.85.241.110)  29.147 ms
 9  72.14.239.60 (72.14.239.60)  29.216 ms  29.642 ms 72.14.239.62 (72.14.239.62)  29.893 ms
10  216.239.48.116 (216.239.48.116)  36.973 ms  37.439 ms  42.706 ms
11  209.85.250.35 (209.85.250.35)  38.647 ms  38.419 ms  40.423 ms
12  muc03s01-in-f31.1e100.net (173.194.35.159)  40.803 ms  37.619 ms  36.093 ms


Soweit ich das sehe, müsste doch alles stimmen. ABER ssh alex-server.my.home geht nicht.

Quellcode

1
2
alex@alex-laptop:~$ ssh alex-server.my.home
ssh: connect to host alex-server.my.home port 22: No route to host

jedoch erreiche ich ssh von außen (IP geändert)

Quellcode

1
2
3
4
5
6
alex@alex-laptop:~$ ssh 253.67.213.8
Please be responsible while you are logged into this server,
any bad action will be recorded and legal actions will taken.
Welcome to Ubuntu 12.04.2 LTS (GNU/Linux 3.5.0-25-generic x86_64)
 * Documentation:  https://help.ubuntu.com/
Last login: Mon Feb 25 08:18:09 2013 from alex-laptop.my.home


Ich hänge mal die wichtigsten Konfigurationsdateien an:
/etc/hosts.dnsmasq

Quellcode

1
2
3
4
5
6
7
8
127.0.0.1       localhost
## Lokales Netzwerk
#   = IP =      = Rechnername = = Domainname =
192.168.3.1     router          router.my.home          # der Router/Gateway
192.168.3.5     alex-server     alex-server.my.home     # der Server
192.168.3.20    alex-laptop     alex-laptop.my.home     # alex-laptop
# The following lines are desirable for IPv6 capable hosts
...

/etc/dnsmasq.conf

Quellcode

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
# /etc/dnsmasq.conf -- Minimalbeispiel
# erstellt von alex
# am 24.2.2013
# verhindern, das dnsmasq lokale Hostnamen/IP-Adressen an den ISP weitergibt
domain-needed
bogus-priv
interface=wlan
bind-interfaces
listen-address=127.0.0.1
listen-address=192.168.3.1
listen-address=192.168.3.5
## DHCP
# statische Zuordnung für Clients mit bekannter MAC
dhcp-host=64:70:02:d2:65:a0,alex-server,192.168.3.5,infinite
dhcp-host=00:1b:77:71:4d:96,alex-laptop,192.168.3.20,infinite
# dynamischer Bereich für Clients mit unbekannter MAC
dhcp-range=192.168.3.50,192.168.3.200,12h
# weiterreichen der gateway adresse an die clients
# dhcp-option=3,192.168.3.1
## Nameserver
local=/my.home/
domain=my.home
expand-hosts
# /etc/resolv.conf ignorieren
#no-resolv
# /etc/hosts ignorieren
addn-hosts=/etc/hosts.dnsmasq
# auf diesen externen DNS zurückgreifen
# die Adesse des Routers, der als DNS dient
server=192.168.3.1
# zusätzlich google DNS
server=8.8.8.8
server=8.8.4.4
## Logging
log-queries
log-dhcp

/etc/network/interfaces

Quellcode

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
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# modifiziert durch alex
# am 19.2.2013 (post-installation)
# The loopback network interface
auto lo
iface lo inet loopback
# The extern network interface
auto eth
iface eth inet dhcp
# The intern network interface
# mit statischer Konfiguration
auto wlan
iface wlan inet static
        network 192.168.3.0
        address 192.168.3.1
        netmask 255.255.255.0
        broadcast 192.168.3.255
# iptables neu laden hostapd und dnsmasq neu starten
up /sbin/iptables -F
up /sbin/iptables -X
up /sbin/iptables -t nat -F
up iptables -A FORWARD -o eth -i wlan -s 192.168.3.0/24 -m conntrack --ctstate NEW -j ACCEPT
up iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
up iptables -t nat -A POSTROUTING -o eth -j MASQUERADE
up sysctl -w net.ipv4.ip_forward=1
up /etc/init.d/hostapd restart
up /etc/init.d/dnsmasq restart


Ich denke, ich habe einen logischen Fehler in der Topologie. Ich finde ihn nur nicht.
ubuntu-server 12.04 LTS

2

25.02.2013, 21:27

Hallo alex1974,

Quellcode

1
up iptables -A FORWARD -o eth -i wlan -s 192.168.3.0/24 -m conntrack --ctstate NEW -j ACCEPT


Wenn du nun per SSH (von WLAN-Seite) auf die Adresse: 192.168.3.5 zugreifen möchtest, werden die Pakete direkt an die Ethernet-Schnittstelle weitergeleitet.
Ich würde vorschlagen du richtest noch ein sperates Loopback-Interface ein oder änderst deine Subnetze ab. Zwei Seperate Subnetze für den Ethernet-Bereich (Server - Router)
und den WLAN-Bereich (Server - Endgeräte).

Gruß

apensiv