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
Last revisionBoth sides next revision
linux:general:network [2017/10/02 11:22] lunetikklinux:general:network [2022/12/16 10:48] lunetikk
Line 8: Line 8:
 |  25  |  SMTP  |  |  25  |  SMTP  | 
 |  80  |  HTTP  | |  80  |  HTTP  |
-|  137 + 139  |  TCP/UDP - SMB/Samba  |+|  111 + 2049  |  TCP/UDP - NFS  | 
 +|  123  |  UDP - NTP  | 
 +|  137 + 139 + 445   TCP/UDP - SMB/Samba  |
 |  443  |  HTTPS  | |  443  |  HTTPS  |
 |  8080  |  Proxy  | |  8080  |  Proxy  |
Line 68: Line 70:
 http_proxy=127.0.0.1:8080 http_proxy=127.0.0.1:8080
 https_proxy=127.0.0.1:8080 https_proxy=127.0.0.1:8080
 +http_proxy=http://username:password@proxy_host:proxy_port
 +https_proxy=https://username:password@proxy_host:proxy_port
 </code> </code>
  
Line 76: Line 80:
 </code> </code>
  
-==== Change your IP ====+==== Change your IP (Ubuntu < 16) ====
  
 Edit /etc/network/interfaces: Edit /etc/network/interfaces:
Line 96: Line 100:
 <code> <code>
 /etc/init.d/networking restart /etc/init.d/networking restart
 +</code>
 +<code>
 +ifdown eth0 && ifup eth0
 </code> </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>
 +
 +==== Change your IP (SLES11/12) ====
 +
 +Edit /etc/sysconfig/network/ifcfg-eth0:
 +<code>
 +sudo vi /etc/sysconfig/network/ifcfg-eth0
 +</code>
 +and add
 +<code>
 +DEVICE='eth0'
 +BOOTPROTO='static'
 +STARTMODE='auto'
 +USERCONTROL='no'
 +BROADCAST=''
 +ETHTOOL_OPTIONS=''
 +IPADDR='10.0.0.2'
 +MTU=''
 +NAME=''
 +NETMASK='255.255.255.0'
 +NETWORK=''
 +REMOTE_IPADDR=''
 +</code>
 +
 +Edit gateway /etc/sysconfig/network/routes:
 +<code>
 +sudo vi /etc/sysconfig/network/routes
 +</code>
 +and add
 +<code>
 +default 10.0.0.1 - eth0
 +#default 10.0.0.1 - -
 +</code>
 +
 +Restart your networkinterface
 +
 +SLES11
 +<code>
 +/etc/init.d/networking restart
 +</code>
 +
 +SLES12
 +<code>
 +ifdown eth0 && ifup eth0
 +</code>
  
 ==== Join a domain and change hostname ==== ==== Join a domain and change hostname ====
Line 122: Line 197:
 </code> </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 ====
  
Line 127: Line 233:
  
 <code> dpkg-reconfigure resolvconf </code> <code> dpkg-reconfigure resolvconf </code>
 +
 +=== Cant do ifdown/ifup ===
 +
 +<code>
 +# ifdown eth0 && ifup eth0
 +/etc/resolvconf/update-libc.d/sendmail: 7: .: Can't open /usr/share/sendmail/dynamic
 +run-parts: /etc/resolvconf/update-libc.d/sendmail exited with return code 2
 +run-parts: /etc/resolvconf/update.d/libc exited with return code 1
 +/etc/resolvconf/update-libc.d/sendmail: 7: .: Can't open /usr/share/sendmail/dynamic
 +run-parts: /etc/resolvconf/update-libc.d/sendmail exited with return code 2
 +run-parts: /etc/resolvconf/update.d/libc exited with return code 1
 +/etc/network/if-up.d/sendmail: 44: .: Can't open /usr/share/sendmail/dynamic
 +run-parts: /etc/network/if-up.d/sendmail exited with return code 2
 +</code>
 +
 +This should fix it:
 +<code> apt-get --purge remove sendmail sendmail-base sendmail-bin </code>
 +
 \\ \\
 \\ \\
-~~DISCUSSION~~+~~DISCUSSION:closed~~
linux/general/network.txt · Last modified: 2022/12/16 10:51 by lunetikk