modprobe.conf alias bond0 bonding options bond0 miimon=80 mode=1 downdelay=200 updelay=200
mode=0 (balance-rr) Round-robin policy: Transmit packets in sequential order from the first available slave through the last. This mode provides load balancing and fault tolerance.
mode=1 (active-backup) Active-backup policy: Only one slave in the bond is active. A different slave becomes active if, and only if, the active slave fails. The bond's MAC address is externally visible on only one port (network adapter) to avoid confusing the switch. This mode provides fault tolerance. The primary option affects the behavior of this mode.
mode=2 (balance-xor) XOR policy: Transmit based on [(source MAC address XOR'd with destination MAC address) modulo slave count]. This selects the same slave for each destination MAC address. This mode provides load balancing and fault tolerance.
mode=3 (broadcast) Broadcast policy: transmits everything on all slave interfaces. This mode provides fault tolerance.
mode=4 (802.3ad) IEEE 802.3ad Dynamic link aggregation. Creates aggregation groups that share the same speed and duplex settings. Utilizes all slaves in the active aggregator according to the 802.3ad specification.
Pre-requisites: 1. Ethtool support in the base drivers for retrieving the speed and duplex of each slave. 2. A switch that supports IEEE 802.3ad Dynamic link aggregation. Most switches will require some type of configuration to enable 802.3ad mode.
mode=5 (balance-tlb) Adaptive transmit load balancing: channel bonding that does not require any special switch support. The outgoing traffic is distributed according to the current load (computed relative to the speed) on each slave. Incoming traffic is received by the current slave. If the receiving slave fails, another slave takes over the MAC address of the failed receiving slave.
Prerequisite: Ethtool support in the base drivers for retrieving the speed of each slave.
mode=6 (balance-alb) Adaptive load balancing: includes balance-tlb plus receive load balancing (rlb) for IPV4 traffic, and does not require any special switch support. The receive load balancing is achieved by ARP negotiation. The bonding driver intercepts the ARP Replies sent by the local system on their way out and overwrites the source hardware address with the unique hardware address of one of the slaves in the bond such that different peers use different hardware addresses for the server.
Jediné co se v targeted používá je types_t(Type Enforcement) a user_u(velice omezeně)
user_u práva /usr/sbin/semanage login -l Ukáže mapování uživatelů na SELinux
unconfined_u .. nevztahuje se na něj SELinux (takto spuštěné procesy se chovají stejně jako bez SELinuxu)
system_u .. standardní systémový uživatel (řídí se dle SELinux pravidel)
type_t práva Vše co končí na _t patří do Type. Práva se dědí dle adresáře.
httpd_t .. základní jméno
httpd_sys_content_t .. static web
httpd_sys_script_exec_t .. skripty, které může Apache spouštět
httpd_sys_content_rw_t .. soubory do, kterých může zapisovat pouze httpd_sys_script_exec_t
httpd_sys_content_ra_t .. pouze přidávat
Nastavení se dají zjistit například nainstalováním SELinux devel
yum install selinux-policy-devel.noarch
A průzkumem jednotlivých konfiguráků v
/usr/share/selinux/devel/include
Pro jednotlivé adresáře jsou práva zadaná v
/etc/selinux/targeted/contexts/files/
SELinux transition Některá pravidla slouží k tomu, aby měnila type_t spouštěných aplikací.
Například toto initrc_t, named_exec_t, named_t nám říká, pokud proces initrc_t spouští soubor named_exec_t mají přejít práva z initrc_t na named_t. Normálně to co spustí proces initrc_t běží s právy initrc_t.
Příklad předávání práv:
Změna policy za běhu
Výpis všech nestavení, které se dají měnit za běhu getsebool -a
Nastavení požadované hodnoty setsebool -P virt_use_nfs [1|0]
Konfiguráky /etc/selinux
Logy /var/log/audit/audit.log
Zapnutí SELinuxu Pro změnu z disable na permissive nebo enforcing je potřeba restartovat počítač. Změna z permissive na enforcing a obráceně je možná za chodu.
Změnu lze provést zde /etc/selinux/config
Změna za chodu (trvá pouze do restartu jinak se musí zapsat do konfiguráku)
Permissive na Enforcing echo "1" > /selinux/enforce nebo setenforce 0
Enforcig na Permissive echo "0" > /selinux/enforce nebo setenforce 1
Ověření stavu SELinuxu sestatus
SELinux změněné příkazy ls -Z, id -Z, ps auxZ, lsof -Z, find / -context
Moduly SELinuxu Vypsání všech modulů semodule -l
Změna SELinux práv na souborech Krátkodobá (do restartu) chcon -t type file-name
Trvalá (zapíše do souboru /etc/selinux/targeted/contexts/files/file_contexts.local) Soubor /usr/sbin/semanage fcontext -a -t samba_share_t /etc/file1 Adresář /usr/sbin/semanage fcontext -a -t httpd_sys_content_t "/web(/.*)?"
Obnovení práv podle souborů v /etc/selinux/targeted/contexts/files/ /sbin/restorecon -R -v /adresar/
Práce se soubory Kopírování Zachování práv cp -Z co kam Přesun Vždy si zachovává práva co měl. Kontrola práv Udělá kontrolu zda jsou nastavena práva dle definic. /usr/sbin/matchpathcon -V Cesta