Docsity

Riassunto comandi programma Fedora, Schemi e mappe concettuali di Teoria E Tecnica Delle Comunicazioni

Toggle sidebar
bg1
Sommario
Commandi Linux: ....................................................................................................................................... 1
Monitoraggio sistema: ..................................................................................................................... 2
Commandi docker: ................................................................................................................................. 3
Reti ................................................................................................................................................................. 4
General: .................................................................................................................................................... 4
DHCP: ........................................................................................................................................................... 5
Routing tables changes: ................................................................................................................ 6
Sub interfaccie: ................................................................................................................................. 6
Gestione VLAN:...................................................................................................................................... 6
Bridge: ...................................................................................................................................................... 7
ARP: ............................................................................................................................................................. 7
IP forwarding (direct and indirect delivery): ........................................................... 7
Open vSwitch gestor of switch and ports: ....................................................................... 8
pf3
pf4
pf5
pf8
pf9
pfa

Anteprima parziale del testo

Scarica Riassunto comandi programma Fedora e più Schemi e mappe concettuali in PDF di Teoria E Tecnica Delle Comunicazioni solo su Docsity!

Sommario

  • Commandi Linux:
    • Monitoraggio sistema:
    • Commandi docker:
  • Reti
    • General:
    • DHCP:
    • Routing tables changes:
    • Sub interfaccie:
    • Gestione VLAN:......................................................................................................................................
    • Bridge:
    • ARP:
    • IP forwarding (direct and indirect delivery):
    • Open vSwitch gestor of switch and ports:

Linux comands

ls <-l> //List files [-l show permissions] cd //Change directory pwd //Show current directory mkdir //Make directory cp //Copy path rm //Remove mv //Move diff //Show the difference between files chown //Change owner chmod //Change permission ln //Link mc //Files Explorer nano //Text editor [gedit graphic variant] ssh <-p> ** @ ** //To access the command line of a remote host [-p specify post] [-X tunnelling of graphic application, require a execution of a local server X-Windows, like Xming for MS Windows or Xquartz for MAC] scp ** ** @ **** : ** //Secure copy to host**

Monitoraggio sistema:

tcpdump //Analyzer of internet data [wireshark graphic variant] last //Accessi più recenti who //User now connected ps //Active process top //Usage of resources kill //Close a process du //Show dimension of a file system

Reti

General:

Private Network IPs: 10.0.0.0/8 172.16.0.0/1 2 192.168.0.0/ 16 Reti contigue e allineate (stessi N bit) : 192.168. 2 .0/24 – 192.168. 3 .0/24 = 192.168.2.0/ Reti NON allineate: 192.168.3.0/24 – 192.168.4.0/ ping ; traceroute - n **** show ip/vlan/etc iperf3 <-s> //To measure the bitrate - s from server below some option

  • - p for port number
  • - u For using the UDP
  • - D Execute the server on background iperf3 <-c> //To measure the bit rate - c from client
  • - p for port number
  • - u For using the UDP
  • **- t **
  • - b Generate a flow with specific bit rate ifconfig <-a> //Show the network interface [-a ALL even the down ones] route - n //Show routing tables ifconfig **** up/down ifconfig ** ** / ****
  • **To add alias change the to **
  • To remove IP address after type “ 0 ”
  • To shut down an interface or alias type “down” after ip addr == ifconfig ; ip route == route ip addr aggiunge ifconfig sostituisce iwconfig **** [options] //Configure parameters for wi-fi interface

DHCP:

/etc/dhcp/dhcpd.conf //Where to configure the Linux machine like a DHCP server /usr/sbin/dhcpd //Demon used. It can be started from: systemctl **** dhcpd /var/lib/dhcpd/dhcpd.leases //Register of the assignments dhclient - v ** //To start the dhcp client** dhclient - v - r ** //To stop the dhcp client Editing of the file dhcpd.conf (example with 500 address needed) :** Subnet 192.168.1.0 netmask 255.255.255.0 { range 192.168.1.1 192.168.1.2 53 default-lease-time 3600 ; max-lease-time 10800 ; option subnet-mask 255.255.255.0 ; //Pari alla NetMask option broadcast-address 192.168.1.255 ; //Indirizzo del broadcast option routers 192.168.1.254 ; //Router indirizzo del server DHCP option domain-name-server 192.168.1.254 ; //Dove trovare il DNS }

bridge vlan add vid **** dev **** pvid untagged

//Add LB port of a VLAN UNTAGGED

bridge vlan add vid **** dev ****

//Add LB port of a VLAN TAGGED

Bridge:

brctl show //Show Linux bridge LB brctl addbr ** //Add linux bridge** brctl delbr ** //Delete** ip link set **** up //Activation of LB brctl addif ** //Adding interface to LB** brctl delif ** //Removing interface from LB** brctl showmacs ** //Showing MAC address learnt from LB**

ARP:

arp - n //Show content of ARP Cache [ ip neigh == arp ] arp - i **** - d ** //Eliminate an ARP voice** arp - i **** - s ** ** [ temp ] //Add voice arping - l ** //To generate ARP request**

IP forwarding (direct and indirect delivery):

sysctl net.ipv4.ip_forward //Verify if Ip forwarding is enable sysctl - w net.ipv4.ip_forward=1 //1 to enable, 0 to disable

Open vSwitch gestor of switch and ports:

To start the needed operator: Fedora: systemctl start openvswitch Ubuntu: service openvswitch-switch start ovs-vsctl add-br ** //Create a switch [del-br to delete it]** ovs-vsctl add-port ** //Create interface from a switch [del-port do delete it]** ovs-vsctl show //Show list of switch OvS and relative ports ovs-appctl fdb/show //Show the forwarding table of a switch ovs-vsctl set port **** tag= ** The default is that ALL ports of a switch OvS is on a TRUNK MODE on ALL VLAN, To set a porta in access mode on a specific VLAN** ovs-vsctil set port **** tag= ** To set a port in mode trunk on only some VLAN with for example id=1,** ovs-vsctl set port **** trunks=1, To give permission to use a VLAN without tagging on a trunk port ovs-vsctil set port **** vlan_mode=native-untagged To show the configuration of a specific port ovs-vsctl list port ** To reset a configuration of a VLAN to default of a port** Ovs-vsctl clear port **** tag trunks vlan_mode

Switch :Bridge with more ports route thorough MAC address Router :Level 3. Route thorugh IP address HTTP :Secure use the TCP port 80 Firewall can be implemented thourgh a packet filter or a application layer NAPT :Network Address and Port Translation

Note esempi:

Lan_Caio: 400 necessari, +3 < 512=2^9 ; 32-9= 23 192.168.6.0/23 (.6.0 - .7.255) Scrivere Intervalli!!!

  1. Conf Switch: Creo X VLAN: LAN_Servizi 10; LAN_Utenti 20… //0 – 4095 (Non usare 0 o 1) Porta :associato ad 1 (o più) VLAN (2+ Con tagging) Attribuisco nel caso gli indirizzi per le lan LAN_Servizi: 192.168.0.0/ LAN_Utenti: 192.168.4/
  2. Conf Router Ifconfig ////if vlan: vconfig add Ifconfig . route add default gw sysctl - w net.ipv4.ip_forward=1 //Non propio necessario, circa
  1. Routing tables Ifconfig / route add - net / gw
  2. Conf NAT iptables - t nat - A POSTROUTING - s /
  • o - j SNAT – to-source //Verso FUORI Iptables - t nat - A PREROUTING - i - d - p tcp --dport - j DNAT --to-destination : //Verso DENTRO
  1. Conf firewall iptables - P FORWARD DROP iptables - A FORWARD - i - s /
  • o ||-d /|| - p --dport - j ACCEPT Iptables - I FORWARD 1 - m state – -state ESTABLISHED - j ACCEPT Le VLAN vanno da 0 – 4095 (Non usare 0 o 1) Porte vanno da 0 - 1023 well-know usate solo da server 1024 – 49151 Registrate solo da alcuni servizi ma anche client 49152 – 65535 Dinamiche solo da client 22 servizi ssh 80 servizi http