Herramientas de usuario

Herramientas del sitio


wiki2:linux-networking-tools

Diferencias

Muestra las diferencias entre dos versiones de la página.

Enlace a la vista de comparación

Ambos lados, revisión anterior Revisión previa
Próxima revisión
Revisión previa
wiki2:linux-networking-tools [2020/04/16 11:34]
alfred [ipsec command]
wiki2:linux-networking-tools [2020/11/04 12:04] (actual)
Línea 50: Línea 50:
 ===== routes ===== ===== routes =====
  
 +==== Which ip has a domain? ====
 +<​code>​
 +alfred@Y50-70:​~$ nslookup couch00.dev.getfinancing.us
 +Server:​ 127.0.0.53
 +Address:​ 127.0.0.53#​53
  
 +Non-authoritative answer:
 +Name:​ couch00.dev.getfinancing.us
 +Address: 10.1.50.195
 +Name:​ couch00.dev.getfinancing.us
 +Address: 10.1.51.200
 +Name:​ couch00.dev.getfinancing.us
 +Address: 10.1.52.100
 +</​code>​
 +
 +==== What's your routing table? ====
 +<​code>​
 +alfred@Y50-70:​~$ route -n
 +Kernel IP routing table
 +Destination ​    ​Gateway ​        ​Genmask ​        Flags Metric Ref    Use Iface
 +0.0.0.0 ​        ​192.168.1.1 ​    ​0.0.0.0 ​        ​UG ​   100    0        0 enp9s0
 +10.1.0.0 ​       0.0.0.0 ​        ​255.255.0.0 ​    ​U ​    ​50 ​    ​0 ​       0 tun0
 +34.231.231.68 ​  ​192.168.1.1 ​    ​255.255.255.255 UGH   ​100 ​   0        0 enp9s0
 +169.254.0.0 ​    ​0.0.0.0 ​        ​255.255.0.0 ​    ​U ​    ​1000 ​  ​0 ​       0 virbr0
 +192.168.1.0 ​    ​0.0.0.0 ​        ​255.255.255.0 ​  ​U ​    ​100 ​   0        0 enp9s0
 +192.168.1.1 ​    ​0.0.0.0 ​        ​255.255.255.255 UH    100    0        0 enp9s0
 +192.168.122.0 ​  ​0.0.0.0 ​        ​255.255.255.0 ​  ​U ​    ​0 ​     0        0 virbr0
 +192.168.255.1 ​  ​192.168.255.21 ​ 255.255.255.255 UGH   ​50 ​    ​0 ​       0 tun0
 +192.168.255.21 ​ 0.0.0.0 ​        ​255.255.255.255 UH    50     ​0 ​       0 tun0
 +</​code>​
 ===== DNS ===== ===== DNS =====
  
 +You can query dns records with the dig command. To do that, for example, for obtaining the CNAME record for url6816.alfredgg.dev:​
 +<​code>​
 +dig cname url6816.alfredgg.dev
 +</​code>​
 ===== VPN with strongswan ===== ===== VPN with strongswan =====
  
Línea 61: Línea 94:
   * ''​ipsec restart''​ restarts the service.   * ''​ipsec restart''​ restarts the service.
 ==== Troubleshooting ==== ==== Troubleshooting ====
 +
 +===== Mapping the network =====
 +
 +===== Which ports are open? =====
 +
 +Locally and simply: ​
 +<​code>​
 +nmap localhost
 +</​code>​
 +
 +Remotely:
 +<​code>​
 +nmap -Pn -p 51414 95.169.230.182
 +</​code>​
 +Comprueba el puerto 51414 de 95.169.230.182.
 +
 +Hay la posibilidad de lanzarlo via web desde: http://​nmap.online-domain-tools.com/​
 +
 +
 +==== Discover IP's ====
 +
 +<​code>​
 +nmap -sP 192.168.1.*
 +</​code>​
 +
 +<​code>​
 +nmap -sn 192.168.1.0/​24
 +</​code>​
 +
 +===== Emulate network problems =====
 +  * https://​medium.com/​@docler/​network-issues-simulation-how-to-test-against-bad-network-conditions-b28f651d8a96
 +  * https://​wiki.linuxfoundation.org/​networking/​netem
 +
 +You will use "​tc"​ command:
 +<​code>​
 +sudo tc qdisc add dev eth0 root netem delay 1s
 +sudo tc qdisc del dev eth0 root
 +</​code>​
 +
 +For example, to simulate problems with dockers you will do the next:
 +  - ''​docker inspect container''​ -> And take the value for the IPAddress
 +  - ''​route -n''​ -> To see which device is used for that container
 +  - ''​sudo tc qdisc add dev <​device>​ root netem delay 1s''​
 +  - Test it with a ping.
 +  - ''​sudo tc qdisc del dev <​device>​ root''​
 +
 +
 +==== Other examples ====
 +<​code>​
 +tc qdisc add dev eth0 root netem loss 5%
 +tc qdisc change dev eth0 root netem corrupt 2%
 +tc qdisc change dev eth0 root netem duplicate 1%
 +</​code>​
 +===== How to... =====
 +==== Update DNS in Ubuntu 18.04 ====
 +
 +Previously you only need to edit the ''/​etc/​resolv.conf''​
 +
 +In new versions Netplan manages the network. You can configure it on files places on ''/​etc/​netplan'';​ these have an yml format.
 +
 +This is an example:
 +<​code>​
 +network:
 +  version: 2
 +  renderer: networkd
 +  ethernets:
 +    ens3:
 +      dhcp4: no
 +      addresses:
 +        - 192.168.121.199/​24
 +      gateway4: 192.168.121.1
 +      nameservers:​
 +          addresses: [8.8.8.8, 8.8.4.4]
 +</​code>​
 +
 +To update from changes do:
 +<​code>​
 +netplan apply
 +</​code>​
 +
 +To list dns entries:
 +<​code>​
 +systemd-resolve --status
 +</​code>​
 +
 +==== ... know... ====
 +
 +=== ... The default gateway? ===
 +<​code>​
 +$ route -n
 +0.0.0.0 ​        ​91.126.134.177 ​ 0.0.0.0 ​        ​UG ​   100    0        0 ens18
 +</​code>​
  
wiki2/linux-networking-tools.1587036847.txt.gz · Última modificación: 2020/05/09 09:24 (editor externo)