public:technik:howto:multihoming

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
public:technik:howto:multihoming [2013/10/29 23:42] pegropublic:technik:howto:multihoming [2013/10/30 18:08] (aktuell) – code -> file (wo es passt) mehdorn
Zeile 20: Zeile 20:
   * in diesem Fall abhängig von der Zieladresse der eingehenden Anfrage   * in diesem Fall abhängig von der Zieladresse der eingehenden Anfrage
   * damit ist sichergestellt, dass die Antworten über die passende Defaultroute rausgehen   * damit ist sichergestellt, dass die Antworten über die passende Defaultroute rausgehen
- +
 ==== neue Routingtabellen ==== ==== neue Routingtabellen ====
-  * /etc/iproute2/rt_tables + 
-      <code>+  Tabellennamen eintragen 
 +<file|/etc/iproute2/rt_tables>
 # #
 # reserved values # reserved values
Zeile 33: Zeile 34:
 1       tbl_eth0 1       tbl_eth0
 2       tbl_eth1 2       tbl_eth1
-</code+</file>
   * Tabelle tbl_eth0 füllen   * Tabelle tbl_eth0 füllen
 <code> <code>
Zeile 46: Zeile 47:
  
 ==== Policies konfigurieren mittels ip rule ==== ==== Policies konfigurieren mittels ip rule ====
 +
 <code> <code>
 ip rule add from 192.168.1.1 table tbl_eth0 ip rule add from 192.168.1.1 table tbl_eth0
Zeile 51: Zeile 53:
 </code> </code>
  
-===== ARP-Antwort Einstellungen =====+===== ARP-Antwort-Einstellungen =====
  
-Wenn die IPs auf verschiedenen Interfaces anliegen oder sonst irgendwie die IP-MAC-Bindung wichtig ist (2 IPs im selben Subnetz), sollte man einstellen, dass der Rechner nur die vorgesehene MAC des Interfaces mit der IP verwendet und nicht jede IP an jedem Interface verfügbar ist.+Wenn die IPs auf verschiedenen Interfaces anliegen oder sonst irgendwie die IP-MAC-Bindung wichtig ist (2 IPs im selben Subnetz), sollte man einstellen, dass der Rechner nur die vorgesehene MAC des Interfaces mit der IP verwendet, damit nicht jede IP an jedem Interface verfügbar ist.
  
-<code|sysctl>+<file|/etc/sysctl.d/local-multihome.conf>
 net.ipv4.conf.eth0.arp_announce=2 net.ipv4.conf.eth0.arp_announce=2
 net.ipv4.conf.eth0.arp_ignore=1 net.ipv4.conf.eth0.arp_ignore=1
 net.ipv4.conf.eth1.arp_announce=2 net.ipv4.conf.eth1.arp_announce=2
 net.ipv4.conf.eth1.arp_ignore=1 net.ipv4.conf.eth1.arp_ignore=1
-</code>+</file>
  
-===== Konfiguration unter verschiedenen Distributionen / Betriebssystemen =====+===== Konfiguration unter verschiedenen Distributionen/Betriebssystemen =====
  
 ==== Gentoo ==== ==== Gentoo ====
-  * /etc/conf.d/net + 
-<code>+<file|/etc/conf.d/net>
 config_eth0="192.168.1.1/24" config_eth0="192.168.1.1/24"
 routes_eth0="192.168.1.0/24 table tbl_eth0 src 192.168.1.1 routes_eth0="192.168.1.0/24 table tbl_eth0 src 192.168.1.1
Zeile 77: Zeile 79:
 default via 192.168.2.254 table tbl_eth1 src 192.168.2.1" default via 192.168.2.254 table tbl_eth1 src 192.168.2.1"
 rules_eth1="from 192.168.2.1 table tbl_eth1" rules_eth1="from 192.168.2.1 table tbl_eth1"
-</code>+</file>
  
 +==== Debian ====
  
-==== Debian ==== +<file|/etc/network/interfaces>
-  * /etc/networking/interfaces +
-<code>+
 iface eth0 inet static iface eth0 inet static
     address 192.168.1.1     address 192.168.1.1
     netmask 255.255.255.0     netmask 255.255.255.0
-    gateway 192.168.1.254     +    gateway 192.168.1.254 
-    post-up ip route add 192.168.1.0/24 dev eth0 src 192.168.1.1 table tbl_eth0 +    up ip route add             192.168.1.0/24 dev "$IFACE" src 192.168.1.1 table "tbl_$IFACE" 
-    post-up ip route add default via 192.168.1.254 dev eth0 table tbl_eth0 +    up ip route add default via 192.168.1.254  dev "$IFACE"                 table "tbl_$IFACE" 
-    post-up ip rule add from 192.168.1.254 table tbl_eth0+    up ip rule  add from        192.168.1.254                               table "tbl_$IFACE" 
 iface eth1 inet static iface eth1 inet static
     address 192.168.2.1     address 192.168.2.1
     netmask 255.255.255.0     netmask 255.255.255.0
-    post-up ip route add 192.168.2.0/24 dev eth1 src 192.168.2.1 table tbl_eth1 +    up ip route add             192.168.2.0/24 dev "$IFACE" src 192.168.2.1 table "tbl_$IFACE" 
-    post-up ip route add default via 192.168.2.254 dev eth1 table tbl_eth1 +    up ip route add default via 192.168.2.254  dev "$IFACE"                 table "tbl_$IFACE" 
-    post-up ip rule add from 192.168.2.254 table tbl_eth1 +    up ip rule  add from        192.168.2.254                               table "tbl_$IFACE" 
-</code>+</file>
  
 Hinweis: Unter Debian wheezy (Kernel 3.2.0) wird dafür auch folgende Einstellung benötigt: FIXME Verifizieren! Hinweis: Unter Debian wheezy (Kernel 3.2.0) wird dafür auch folgende Einstellung benötigt: FIXME Verifizieren!
 <code|sysctl> <code|sysctl>
- net.ipv4.ip_forward=1+net.ipv4.ip_forward=1
 </code> </code>
  
Zeile 108: Zeile 110:
 iptables -A FORWARD -j REJECT iptables -A FORWARD -j REJECT
 </code> </code>
- 
  • public/technik/howto/multihoming.1383086531.txt.gz
  • Zuletzt geändert: 2013/10/29 23:42
  • von pegro