jeschero
Goto Top

Kein Internet über das Gastwlan von einem Asus RT-AC5300 mit AsusWRT-Merlin

Hallo alle zusammen,

ich hoffe, ich bin im richtigen Thema, wenn nicht, verschmiebt mich bitte jemand.

Also ich habe folgendes Problem:
Ich habe einen Asus RT-AC5300 mit AsusWRT-Merlin.
Über diesen Router möchte ich gerne ein Gastnetzwerk betreiben (Schnittstelle w10.1).
Da ich im privaten Netzwerk einen Windows-DHCP-Server nutzen, ist der DHCP-Server vom Asus Router deaktivert.
Um jetzt aber im Gastnetzwerk per DHCP Ip-Adresse zuvergeben, nutze ich folgendes Script:

#!/bin/sh
####### Interface Specific Settings #######
WRLSS_IF=wl0.1                   # Name of the wireless interface that will be used.
WRLSS_IF_NTWK_ADDR=192.168.2.0   # Network address that the wireless interface will be on.
WRLSS_IF_INET_ADDR=192.168.2.1   # IP address that will be assigned to the wireless interface.
WRLSS_IF_NETMASK=255.255.255.0   # Netmask of the wireless network to be added.
########## DHCP Specific Settings ###########
DHCP_OPT1=3                      # dnsmasq option to specify router.
LS_TIME=86400s                   # Duration of the dhcp leases.
LS_START=192.168.2.100           # Start address of leases. This needs to be within the same network as above.
LS_END=192.168.2.120             # End address of leases. This needs to be within the same network as above.

##########################################################################################################
##########################################################################################################
########################################## DHCP Server ###################################################

if [ `cat /etc/dnsmasq.conf | grep -c $WRLSS_IF` == 0 ]; then
        killall dnsmasq
        sleep 2
        echo "interface=$WRLSS_IF" >> /etc/dnsmasq.conf  
        echo "dhcp-range=$WRLSS_IF,$LS_START,$LS_END,$WRLSS_IF_NETMASK,$LS_TIME" >> /etc/dnsmasq.conf  
        echo "dhcp-option=$WRLSS_IF,$DHCP_OPT1,$WRLSS_IF_INET_ADDR" >> /etc/dnsmasq.conf  
        echo "dhcp-option=$WRLSS_IF,6,192.168.2.1,0.0.0.0" >> /etc/dnsmasq.conf  
        echo "dhcp-option=$WRLSS_IF,252,"\n"" >> /etc/dnsmasq.conf  
        dnsmasq --log-async
fi

############################################ IP ROUTING ##################################################

#iptables -F
#iptables -X
#iptables -t nat -F

ifconfig $WRLSS_IF $WRLSS_IF_INET_ADDR netmask $WRLSS_IF_NETMASK
ip route show table main | grep -Ev ^default | while read ROUTE; do
ip route add table 10 $ROUTE;
done

iptables -D INPUT -i $WRLSS_IF -j ACCEPT
iptables -I INPUT -i $WRLSS_IF -j ACCEPT

ip rule add dev $WRLSS_IF table 10
ip route flush cache
####################################### ETHERNET BRIDGE TABLES RULES #####################################

EBT_BRULE1="-p ipv4 -i $WRLSS_IF -j DROP"  
EBT_BRULE2="-p arp -i $WRLSS_IF -j DROP"  
if [ -n "$EBT_BRULE1" ] && [ `ebtables -t broute -L | grep -ice "$EBT_BRULE1"` != 1 ]; then  
        ebtables -t broute -I BROUTING $EBT_BRULE1
fi
if [ -n "$EBT_BRULE2" ] && [ `ebtables -t broute -L | grep -ice "$EBT_BRULE2"` != 1 ]; then  
        ebtables -t broute -I BROUTING $EBT_BRULE2

#ebtables -t broute -D BROUTING -i $WRLSS_IF -p ipv4 -j DROP
ebtables -t broute -I BROUTING -i $WRLSS_IF -p ipv4 -j DROP

Dieser Code enstand aus den beiden Wiki-Seiten:
- https://github.com/RMerl/asuswrt-merlin/wiki/How-to-setup-SSID-for-VPN-a ....
- https://github.com/RMerl/asuswrt-merlin/wiki/How-to-have-dedicated-DHCP- ...

DHCP-Adressen werden vergeben und das private Netzwerk ist vom Gast-Netzwerk getrennt.
Jetzt bekomme ich nur keine Internetverbindung über das Gast-Wlan.


Zur Fehlersuche folgende Auszüge:

Ifconfig:
br0        Link encap:Ethernet  HWaddr 9C:5C:8E:4B:6B:F0
           inet addr:192.168.178.1  Bcast:192.168.178.255  Mask:255.255.255.0
           UP BROADCAST RUNNING ALLMULTI MULTICAST  MTU:1500  Metric:1
           RX packets:9292 errors:0 dropped:0 overruns:0 frame:0
           TX packets:3704 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:0
           RX bytes:1076735 (1.0 MiB)  TX bytes:450663 (440.1 KiB)

eth0       Link encap:Ethernet  HWaddr 9C:5C:8E:4B:6B:F0
           inet addr:169.254.85.50  Bcast:169.254.255.255  Mask:255.255.0.0
           UP BROADCAST RUNNING MULTICAST  MTU:1508  Metric:1
           RX packets:36844 errors:0 dropped:0 overruns:0 frame:0
           TX packets:30459 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:1000
           RX bytes:21063891 (20.0 MiB)  TX bytes:19895274 (18.9 MiB)
           Interrupt:181 Base address:0x6000

eth1       Link encap:Ethernet  HWaddr 9C:5C:8E:4B:6B:F0
           UP BROADCAST RUNNING ALLMULTI MULTICAST  MTU:1500  Metric:1
           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
           TX packets:7033 errors:0 dropped:2 overruns:0 carrier:0
           collisions:0 txqueuelen:1000
           RX bytes:0 (0.0 B)  TX bytes:1001931 (978.4 KiB)

eth2       Link encap:Ethernet  HWaddr 9C:5C:8E:4B:6B:F4
           UP BROADCAST RUNNING ALLMULTI MULTICAST  MTU:1500  Metric:1
           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
           TX packets:9408 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:1000
           RX bytes:0 (0.0 B)  TX bytes:2727467 (2.6 MiB)

eth3       Link encap:Ethernet  HWaddr 9C:5C:8E:4B:6B:F8
           UP BROADCAST RUNNING ALLMULTI MULTICAST  MTU:1500  Metric:1
           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
           TX packets:7162 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:1000
           RX bytes:0 (0.0 B)  TX bytes:999163 (975.7 KiB)

fwd0       Link encap:Ethernet  HWaddr 00:00:00:00:00:00
           UP BROADCAST RUNNING PROMISC ALLMULTI MULTICAST  MTU:1500  Metric:1
           RX packets:9264 errors:0 dropped:0 overruns:0 frame:0
           TX packets:6247 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:1000
           RX bytes:0 (0.0 B)  TX bytes:1278561 (1.2 MiB)
           Interrupt:179 Base address:0x4000

fwd1       Link encap:Ethernet  HWaddr 00:00:00:00:00:00
           UP BROADCAST RUNNING PROMISC ALLMULTI MULTICAST  MTU:1500  Metric:1
           RX packets:7179 errors:0 dropped:0 overruns:0 frame:0
           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:1000
           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
           Interrupt:180 Base address:0x5000

lo         Link encap:Local Loopback
           inet addr:127.0.0.1  Mask:255.0.0.0
           inet6 addr: ::1/128 Scope:Host
           UP LOOPBACK RUNNING MULTICAST  MTU:16436  Metric:1
           RX packets:4873 errors:0 dropped:0 overruns:0 frame:0
           TX packets:4873 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:0
           RX bytes:1424398 (1.3 MiB)  TX bytes:1424398 (1.3 MiB)

ppp0       Link encap:Point-to-Point Protocol
           inet addr:xxx.xxx.xxx.xxx  P-t-P:xxx.xxx.xxx.xxx  Mask:255.255.255.255
           UP POINTOPOINT RUNNING MULTICAST  MTU:1492  Metric:1
           RX packets:14098 errors:0 dropped:0 overruns:0 frame:0
           TX packets:13449 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:3
           RX bytes:13083526 (12.4 MiB)  TX bytes:6575238 (6.2 MiB)

vlan1      Link encap:Ethernet  HWaddr 9C:5C:8E:4B:6B:F0
           UP BROADCAST RUNNING ALLMULTI MULTICAST  MTU:1500  Metric:1
           RX packets:21871 errors:0 dropped:0 overruns:0 frame:0
           TX packets:17407 errors:0 dropped:0 overruns:0 carrier:0
           collisions:0 txqueuelen:0
           RX bytes:7575121 (7.2 MiB)  TX bytes:13631582 (13.0 MiB)

wl0.1      Link encap:Ethernet  HWaddr 9C:5C:8E:4B:6B:F1
           inet addr:192.168.2.1  Bcast:192.168.2.255  Mask:255.255.255.0
           UP BROADCAST RUNNING ALLMULTI MULTICAST  MTU:1500  Metric:1
           RX packets:1460 errors:0 dropped:0 overruns:0 frame:0
           TX packets:8035 errors:0 dropped:6 overruns:0 carrier:0
           collisions:0 txqueuelen:1000
           RX bytes:86535 (84.5 KiB)  TX bytes:1052941 (1.0 MiB)

iptables -L:
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere
DROP       icmp --  anywhere             anywhere             icmp echo-request
DROP       all  --  anywhere             anywhere             state INVALID
ACCEPT     all  --  anywhere             anywhere             state RELATED,ESTABLISHED
ACCEPT     all  --  anywhere             anywhere             state NEW
ACCEPT     all  --  anywhere             anywhere             state NEW
ACCEPT     igmp --  anywhere             base-address.mcast.net/4
ACCEPT     udp  --  anywhere             base-address.mcast.net/4  udp dpt:!upnp
ACCEPT     udp  --  anywhere             anywhere             udp spt:bootps dpt:bootpc
ACCEPT     icmp --  anywhere             anywhere             icmp !echo-request
DROP       all  --  anywhere             anywhere

Chain FORWARD (policy DROP)
target     prot opt source               destination
ACCEPT     udp  --  anywhere             base-address.mcast.net/4
TCPMSS     tcp  --  anywhere             anywhere             tcpflags: SYN,RST/SYN TCPMSS clamp to PMTU
ACCEPT     all  --  anywhere             anywhere             state RELATED,ESTABLISHED
DROP       all  --  anywhere             anywhere
DROP       all  --  anywhere             anywhere
DROP       all  --  anywhere             anywhere             state INVALID
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere             ctstate DNAT
ACCEPT     all  --  anywhere             anywhere

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Chain FUPNP (0 references)
target     prot opt source               destination

Chain PControls (0 references)
target     prot opt source               destination
ACCEPT     all  --  anywhere             anywhere

Chain SECURITY (0 references)
target     prot opt source               destination
RETURN     tcp  --  anywhere             anywhere             tcpflags: FIN,SYN,RST,ACK/SYN limit: avg 1/sec burst 5
DROP       tcp  --  anywhere             anywhere             tcpflags: FIN,SYN,RST,ACK/SYN
RETURN     tcp  --  anywhere             anywhere             tcpflags: FIN,SYN,RST,ACK/RST limit: avg 1/sec burst 5
DROP       tcp  --  anywhere             anywhere             tcpflags: FIN,SYN,RST,ACK/RST
RETURN     icmp --  anywhere             anywhere             icmp echo-request limit: avg 1/sec burst 5
DROP       icmp --  anywhere             anywhere             icmp echo-request
RETURN     all  --  anywhere             anywhere

Chain logaccept (0 references)
target     prot opt source               destination
LOG        all  --  anywhere             anywhere             state NEW LOG level warning tcp-sequence tcp-options ip-options prefix "ACCEPT "
ACCEPT     all  --  anywhere             anywhere

Chain logdrop (0 references)
target     prot opt source               destination
LOG        all  --  anywhere             anywhere             state NEW LOG level warning tcp-sequence tcp-options ip-options prefix "DROP "
DROP       all  --  anywhere             anywhere

route -n:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
xxx.xxx.xxx.xxx  0.0.0.0         255.255.255.255 UH    0      0        0 ppp0
192.168.178.0   0.0.0.0         255.255.255.0   U     0      0        0 br0
192.168.2.0     0.0.0.0         255.255.255.0   U     0      0        0 wl0.1
169.254.0.0     0.0.0.0         255.255.0.0     U     0      0        0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
0.0.0.0         xxx.xxx.xxx.xxx  0.0.0.0         UG    0      0        0 ppp0

folgende Befehle wurden schon genutzt, um das Problem zulösen:
immer Blockweise, und bei keinem Erfolg, wurden sie erst wieder entfernt.
iptables -A FORWARD -o ppp0 -s 192.168.2.0/24 -m conntrack --ctstate NEW -j ACCEPT
iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE 

iptables -t nat -A POSTROUTING -s 192.168.2.0/24 -o ppp0 -j MASQUERADE 

iptables -t nat -A POSTROUTING -d 192.168.2.1 -j MASQUERADE 

iptables -I FORWARD -i w10.1 -m state --state NEW -j ACCEPT
iptables -I FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS --clamp-mss-to-pmtu

iptables -t nat -I POSTROUTING -o w10.1 -j SNAT --to 192.168.2.1

Wenn jemand stattdessen mir sagen kann, wie ich ein Gästewlan und das Lokale-wlan zusammen, und doch adressen/netzwerk getrennt, auf dem asus router laufen lassen kann und dann pfsense als internetgateway nutzen, wäre mir schon sehr geholfen.

Pfsense als internetgateway ist schon fertig eingerichtet.
Ich weiß eben nur nicht, wie ich das gastewlan zum pfsense durchreichen soll, da nach meinem Wissen der router kein vlan unterstützt

Ich hoffe mir kann jemand helfen.

Und schonmal Danke für jeden Versuch/ jede Hilfe.

Content-Key: 303975

Url: https://administrator.de/contentid/303975

Printed on: April 16, 2024 at 10:04 o'clock

Mitglied: 108012
108012 May 08, 2016 at 14:28:47 (UTC)
Goto Top
Hallo,

kann man denn dort im MerlinWRT nicht einfach für das WLAN und das LAN ein eigenes Netzwerk
bzw. eine eigene IP Range vergeben? Dann könnte man für jedes Netzwerk einen eigenen DHCP
Server einrichten, der dann die IP Adressen vergibt.

Gruß
Dobby
Member: jeschero
jeschero May 08, 2016 at 14:38:28 (UTC)
Goto Top
Nee, leider nicht.

Siehe Anhang
asus-rt-ac5300-dhcp-interface
Member: aqui
aqui May 09, 2016 at 07:00:11 (UTC)
Goto Top
kann man denn dort im MerlinWRT nicht einfach für das WLAN und das LAN ein eigenes Netzwerk
Mmmhhh... komische Auffassung von Gast WLANs. Etwas was den Namen wirklich verdient findet man besser hier:
WLAN oder LAN Gastnetz einrichten mit einem Captive Portal (Hotspot Funktion)
Aber warum einfach und sicher machen....

Es sieht so aus als ob NAT nicht ausgeführt wird für diese IP Range.
Dazu müsste man aber mal einen Sniffer (Wireshark) bemühen. Es sei denn MerlinWRT hat auch sowas wie tcpdump auf der Konsole..?!
Member: jeschero
jeschero May 10, 2016 at 09:52:02 (UTC)
Goto Top
Geplant war das Password vom Wlan täglich zuändern, das Script dafür habe ich schon fertig.
Aaber ich werde das jetzt wohl anders machen.

Einfach pfsense als Router und darüber dann das gast-wlan, wahrscheinlich so wie in deinem Link beschrieben.
So wie es aussieht muss ich sowieso pfsense nehmen, da mit dem asus router kein openvpn site2site klappt.

Besten Dank für eure Hilfe.
Member: aqui
aqui May 12, 2016 at 12:07:05 (UTC)
Goto Top
Das wäre eine weise Entscheidung ! face-smile