publicipbarrierbraker
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| publicipbarrierbraker [2015/03/05 20:02] – ArminMoser | publicipbarrierbraker [2015/03/06 06:47] (current) – ArminMoser | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ACHTUNG Work in Progress | + | << |
| Dieses Howto beschreibt wie man auf einem [[: | Dieses Howto beschreibt wie man auf einem [[: | ||
| Line 12: | Line 12: | ||
| * Man erreicht das Internet über das NAT-Gateway | * Man erreicht das Internet über das NAT-Gateway | ||
| * Kenntnisse im Umgang mit LuCI | * Kenntnisse im Umgang mit LuCI | ||
| - | * Man weiß wie man sich per ssh zum Router verbindet und Dateien editiert | + | * Kenntniss |
| - | ====== Konfiguration ====== | + | ====== Notwendige Pakete |
| - | + | ||
| - | + | ||
| - | ===== Notwendige Pakete ===== | + | |
| Die folgenden Pakete müssen installiert werden (System -> Software) | Die folgenden Pakete müssen installiert werden (System -> Software) | ||
| - | * **kmod-ipip** | + | * **kmod-ipip** |
| * Kernel modules for IP-in-IP encapsulation | * Kernel modules for IP-in-IP encapsulation | ||
| Line 30: | Line 27: | ||
| - | ===== Public Interface in LuCI ===== | + | ====== Konfiguration ====== |
| * Im Webinterface unter **Network -> Interfaces -> Add new interface...** | * Im Webinterface unter **Network -> Interfaces -> Add new interface...** | ||
| - | * Name of the new interface **public** | + | * Name of the new interface **public** |
| * Protocol of the new interface **unmanaged** | * Protocol of the new interface **unmanaged** | ||
| * Custom interface **public** | * Custom interface **public** | ||
| Line 39: | Line 36: | ||
| {{{{addPublicInterface1000px.png|}}}} | {{{{addPublicInterface1000px.png|}}}} | ||
| + | |||
| + | * Jetzt unter **Network -> Interfaces** das neue public interface editieren. | ||
| + | * Unter **Firewall Settings** eine Firewall-Zone mit dem Name **public** anlegen | ||
| + | |||
| + | {{{{addFirewallZone4public.png|}}}} | ||
| + | |||
| + | |||
| + | * Unter **Network -> Firewall** jetzt die lan Zone editieren und forward nach public erlauben | ||
| + | {{{{allowForward2public.png|}}}} | ||
| + | |||
| + | |||
| + | * Jetzt unter **Network -> Firewall** | ||
| + | * Die default policy für public von **accept** -> **reject** setzen | ||
| + | * **ACHTUNG: | ||
| + | |||
| + | **Masquerading und MSS Clamping** wie im Screenshot gezeigt setzen. | ||
| + | |||
| + | {{{{configureZonePoliciesAndMasquerading.png|}}}} | ||
| + | |||
| + | |||
| + | * Unter **Network -> Firewall -> Traffic Rules -> Source Nat** eine neue Source NAT rule anlegen | ||
| + | * Name zum Beispiel **SNAT 4 public** | ||
| + | * Source zone **lan** | ||
| + | * Destination zone **WAN** | ||
| + | * To source ip **<hier die public IP auswählen> | ||
| + | * **ACHTUNG: | ||
| + | |||
| + | Unter **Services -> OLSR IPv4 -> HNA announcments** mittels **Add** die public IP hinzufügen (netmask 255.255.255.255) | ||
| + | Jetzt mittels ssh zum router verbinden und die Datei / | ||
| + | |||
| + | |||
| + | < | ||
| + | option RtTableDefault ' | ||
| + | </ | ||
| + | |||
| + | * Abschließend noch die unten angefügte Datei unter **System -> Startup** in das Textfeld unter **local startup** einfügen und die richtige public IP eintragen. | ||
| + | |||
| + | |||
| + | < | ||
| + | PUBLIC_GW=10.12.34.56 | ||
| + | |||
| + | ip tunnel add public mode ipip remote $PUBLIC_GW local $PUBLIC_IP ttl 255 | ||
| + | ip link set public up | ||
| + | ip addr add $PUBLIC_IP dev public | ||
| + | ip route add default dev public table default | ||
| + | |||
| + | ip rule add from all lookup 111 pref 20000 | ||
| + | ip rule add from all lookup main pref 30000 | ||
| + | ip rule del pref 32766 | ||
| + | |||
| + | source / | ||
| + | |||
| + | i=0 | ||
| + | while iface=" | ||
| + | case "$( uci -q get olsrd.@Interface[$i].ignore )" in | ||
| + | 1|on|true|enabled|yes) | ||
| + | # is disabled | ||
| + | ;; | ||
| + | *) | ||
| + | if network_get_device device " | ||
| + | ip rule add iif $device pref $(( i + 32000 )) lookup 112 | ||
| + | else | ||
| + | echo " | ||
| + | fi | ||
| + | ;; | ||
| + | esac | ||
| + | i=$(( $i + 1 )) | ||
| + | done | ||
| + | |||
| + | exit 0 | ||
| + | </ | ||
| + | Jetzt sollte die Public IP für Verbindungen die vom LAN aufgebaut werden funktionieren. Zum testen z.B. [[http:// | ||
| + | |||
| + | |||
| + | |||
| + | ====== Den Router von außen für neue Verbindungen erreichbar machen ====== | ||
publicipbarrierbraker.1425585763.txt · Last modified: by ArminMoser
