Site Tools


linux:general:network

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
linux:general:network [2018/12/20 17:42] – Discussion status changed lunetikklinux:general:network [2022/12/16 10:51] (current) lunetikk
Line 9: Line 9:
 |  80  |  HTTP  | |  80  |  HTTP  |
 |  111 + 2049  |  TCP/UDP - NFS  | |  111 + 2049  |  TCP/UDP - NFS  |
 +|  123  |  UDP - NTP  |
 |  137 + 139 + 445  |  TCP/UDP - SMB/Samba  | |  137 + 139 + 445  |  TCP/UDP - SMB/Samba  |
 |  443  |  HTTPS  | |  443  |  HTTPS  |
Line 79: Line 80:
 </code> </code>
  
-==== Change your IP (Ubuntu) ====+==== Change your IP (Ubuntu < 16) ====
  
 Edit /etc/network/interfaces: Edit /etc/network/interfaces:
Line 102: Line 103:
 <code> <code>
 ifdown eth0 && ifup eth0 ifdown eth0 && ifup eth0
 +</code>
 +
 +==== Change your IP (Ubuntu > 16) ====
 +
 +Edit /etc/netplan/01-netcfg.yaml:
 +<code>
 +sudo vi /etc/netplan/01-netcfg.yaml
 +</code>
 +and add
 +<code>
 +network:
 +  version: 2
 +  renderer: networkd
 +  ethernets:
 +    ens3:
 +      dhcp4: no
 +      addresses:
 +        - 10.0.0.2/8
 +      gateway4: 10.0.0.1
 +      nameservers:
 +          addresses: [8.8.8.8, 8.8.4.4]
 +</code>
 +Apply the new IP config
 +<code>
 +sudo netplan apply
 </code> </code>
  
Line 166: Line 192:
 sudo vi /etc/hostname sudo vi /etc/hostname
 </code> </code>
-Reload your hostname+Set your hostname
 <code> <code>
 hostname –F /etc/hostname hostname –F /etc/hostname
 </code> </code>
  
 +New syntax to set a hostname
 +<code>
 +hostnamectl set-hostname "YOURHOSTNAME"
 +</code>
 +Show hostname
 +<code>
 +hostnamectl
 +</code>
 +
 +==== Tools to monitor traffic ====
 +
 +[[https://askubuntu.com/questions/257263/how-to-display-network-traffic-in-the-terminal|Askubuntu - Tools to display traffic]]
 +
 +<code>
 +
 +#bmon - shows multiple interfaces at once
 +apt-get install bmon
 +
 +#tcptrack - Tells how much bandwidth is being used and also what protocol (service/port) and destination the transmission is taking place to. Very helpful when you want to know exactly what is using up your bandwidth
 +apt-get install tcptrack
 +
 +#nload - Separated view for down and upload
 +apt-get install nload
 +
 +#iftop
 +apt-get install iftop
 +
 +#ethstatus
 +apt-get install ethstatus
 +
 +</code>
 +bmon: {{:linux:general:pasted:20190416-135948.png?400}}
 +
 +tcptrack: {{:linux:general:pasted:20190416-141118.png?400}}
 +
 +nload: {{:linux:general:pasted:20190416-141355.png?400}}
 +
 +iftop: {{:linux:general:pasted:20190416-141728.png?400}}
 +
 +ethstatus: {{:linux:general:pasted:20190416-141835.png?400}}
 ==== Troubleshooting ==== ==== Troubleshooting ====
  
linux/general/network.1545324147.txt.gz · Last modified: 2018/12/20 17:42 by lunetikk