This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.

Please visit our production wiki at https://wiki.gentoo.org

Handbuch:PPC/Netzwerk/Erweitern

From Gentoo Wiki (test)
Jump to:navigation Jump to:search
This page is a translated version of the page Handbook:PPC/Networking/Extending and the translation is 100% complete.
PPC Handbook
Installation
About the installation
Choosing the media
Configuring the network
Preparing the disks
Installing stage3
Installing base system
Configuring the kernel
Configuring the system
Installing tools
Configuring the bootloader
Finalizing
Working with Gentoo
Portage introduction
USE flags
Portage features
Initscript system
Environment variables
Working with Portage
Files and directories
Variables
Mixing software branches
Additional tools
Custom package repository
Advanced features
Network configuration
Getting started
Advanced configuration
Modular networking
Wireless
Adding functionality
Dynamic management


Standard Funktionshooks

Vier Funktionen können in /etc/conf.d/net definiert werden, die vor und nach der start/stop Operationen aufgerufen werden. Die Funktionen werden mit vorangestelltem Schnittstellennamen aufgerufen, so dass eine Funktion mehrere Adapter kontrollieren kann.

The return values for the preup() and predown() functions should be 0 (success) to indicate that configuration or de-configuration of the interface can continue. If preup() returns a non-zero value, then interface configuration will be aborted. If predown() returns a non-zero value, then the interface will not be allowed to continue de-configuration.

The return values for the postup() and postdown() functions are ignored since there's nothing to do if they indicate failure.

${IFACE} is set to the interface being brought up/down. ${IFVAR} is ${IFACE} converted to variable name bash allows.

DATEI /etc/conf.d/netpre/post up/down Funktionsbeispiele
 grep -q 'Link detected: no'; then
    ewarn "No link on ${IFACE}, aborting configuration"
    return 1
  fi
  
  # Denken Sie daran 0 bei Erfolg zurückzugeben
  return 0
}
  
predown() {
  # Der Standard im Script ist auf NFS root zu prüfen und in diesem
  # Fall das Stoppen der Schnittstelle zu unterbinden. Beachten Sie,
  # dass Sie diese Logik überschreiben, wenn Sie eine predown()
  # Funktion angeben. Hier ist sie für den Fall, dass Sie sie dennoch
  # wollen ...
  if is_net_fs /; then
    eerror "root filesystem is network mounted -- can't stop ${IFACE}"
    return 1
  fi
  
  # Denken Sie daran 0 bei Erfolg zurückzugeben
  return 0
}
  
postup() {
  # Diese Funktion könnte beispielsweise genutzt werden, um sich bei
  # einem DNS Service zu registrieren. Eine weitere Möglichkeit würde
  # das Senden/Empfangen von Mails nach dem Start einer Schnittstelle
  # sein.
       return 0
}
  
postdown() {
  # Diese Funktion ist hauptsächlich der Vollständigkeit halber
  # hier... Ich habe bisher noch nicht darüber nachgedacht etwas
  # Raffiniertes damit anzustellen ;-D
  return 0
}
Notiz
Für weitere Informationen zum Schreiben von Funktionen lesen Sie bitte /usr/share/doc/netifrc-*/net.example.bz2.

Wireless Tools Funktionshook

Notiz
This will not work with WPA Supplicant - but the ${ESSID} and ${ESSIDVAR} variables are available in the postup() function.

Zwei Funktionen können in /etc/conf.d/net definiert werden, die vor und nach der start/stop Operationen aufgerufen werden. Die Funktionen werden mit vorangestelltem Schnittstellennamen aufgerufen, so dass eine Funktion mehrere Adapter kontrollieren kann.

The return values for the preassociate() function should be 0 (success) to indicate that configuration or de-configuration of the interface can continue. If preassociate() returns a non-zero value, then interface configuration will be aborted.

The return value for the postassociate() function is ignored since there's nothing to do if it indicates failure.

${ESSID} is set to the exact ESSID of the AP the system is connecting to. ${ESSIDVAR} is ${ESSID} converted to a variable name bash allows.

DATEI /etc/conf.d/netpre/post Verbindungs-Funktionen
 grep -q 'Login incorrect'; then
      ewarn "Login Failed for ${user}"
      return 1
    fi
  fi
  
  return 0
}
  
postassociate() {
  # Diese Funktion ist hauptsächlich der Vollständigkeit halber
  # hier... Ich habe bisher noch nicht darüber nachgedacht etwas
  # Raffiniertes damit anzustellen ;-D
  
  return 0
}
Notiz
${ESSID} and ${ESSIDVAR} are unavailable in predown() and postdown() functions.
Notiz
Schauen Sie sich bitte /usr/share/doc/netifrc-*/net.example.bz2 an, um weitere Informationen zum Schreiben von angepassten Funktionen zu erhalten.