Outils pour utilisateurs

Outils du site


blog

Linux Network Bridge

iproute2

Voir :

Création

ip link add br0 type bridge
ip link set br0 up
 
ip link set enp0s8 up
#ip addr flush enp0s8
ip link set enp0s8 master br0

Affichage et configuration

bridge link
bridge fdb show dev br0
bridge vlan show
 
ip addr add dev br0 192.168.56.11/24

Supression

ip addr flush br0
ip link set enp0s8 nomaster
#ip link set enp0s8 down
ip link del br0 type bridge

brctl (deprecated)

brctl (deprecated). Use ip link instead

brctl show

tunctl (deprecated).

tunctl (deprecated). Use ip tuntap and ip link instead

SystemD

nmcli

nmcli connection add type bridge autoconnect yes con-name br0 ifname br0
nmcli con show
nmcli -f bridge con show br0

Disable STP

sudo nmcli con modify br0 bridge.stp no

Afficher la conf

nmcli con show
nmcli -f bridge con show br0

Pour ajouter, ou pour mettre une interface en esclavage

nmcli con add type bridge-slave ifname team0 master br0

ça va créer un fichier

/etc/sysconfig/network-scripts/ifcfg-br0

STP=no
TYPE=Bridge
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=br0
UUID=8ddf2382-7458-4f94-8986-40e95415ea20
DEVICE=br0
ONBOOT=yes

Un nouveau fichier est apparu

/etc/sysconfig/network-scripts/ifcfg-bridge-slave-team0

TYPE=Ethernet
NAME=bridge-slave-team0
UUID=93645ead-7177-4794-88f3-0a43c95bf179
DEVICE=team0
ONBOOT=yes
BRIDGE=br0

RedHat

     Edit /etc/sysconfig/network-scripts/ifcfg-eth0
        comment out BOOTPROTO
        Add BRIDGE=br0
    Create /etc/sysconfig/network-scripts/ifcfg-br0
        The content should be:

DEVICE=br0
BOOTPROTO=dhcp
ONBOOT=yes
TYPE=Bridge

Source : https://www.linux-kvm.org/page/Networking

Debian

/etc/network/interfaces

# Replace old eth0 config with br0
auto eth0 br0

# Use old eth0 config for br0, plus bridge stuff
iface br0 inet dhcp
    bridge_ports    eth0
    bridge_stp      off
    bridge_maxwait  0
    bridge_fd       0

Source : https://www.linux-kvm.org/page/Networking

Macvlan

MacVTap

2025/03/24 15:06

Linux Mémoire - invoquer manuellement l'OOM Killer

Source : How to invoke OOM Killer manually for understanding which process gets killed first

sudo chmod 777 /proc/sysrq-trigger 
sudo echo f > /proc/sysrq-trigger 
dmesg 
2025/03/24 15:06

Linux crash coredump

Voir :

Note : Avec SystemD le core est à configurer dans le service

Activation

ulimit -S -c 0

/etc/security/limits.conf

* soft core unlimited

Vérif

ulimit -H -c
ulimit -S -c

Configuration

Générer les coredump sur une partition précise
echo "/var/lib/core" > /proc/sys/kernel/core_pattern

Test

Programme de crash - Division par zéro

crash.c

int main()
{
    return 1/0;
}
gcc crash.c
./a.out
Crash d'un process en cours d’exécution
kill -s SIGSEGV 1234
2025/03/24 15:06

Linux console - lancer un process dans un autre TTY - start a process on a different TTY

setsid sh -c 'exec command <> /dev/tty1 >&0 2>&1'

Exemple

$ vlock -a
vlock: this terminal is not a virtual console
setsid sh -c 'exec vlock -a <> /dev/tty1 >&0 2>&1'

C'est à titre d'exemple, car ça plante (certaines entrées claviers sont ignorées)

2025/03/24 15:06

Linux - renommer un compte utilisateur

groupmod -n <nouveau-nom> <ancien-nom>
usermod -d /home/<nouveau-dossier> -m -l <nouveau-nom> -c <nouveau-nom-complet> <ancien-nom>

Source : http://marcet.technofil.fr/2008/03/11/renommer-un-utilisateur/

2025/03/24 15:06
blog.txt · Dernière modification : de 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki