Muestra las diferencias entre dos versiones de la página.
| Ambos lados, revisión anterior Revisión previa Próxima revisión | Revisión previa | ||
|
wiki2:linux-networking-tools [2020/05/09 08:25] 127.0.0.1 editor externo |
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 90: | Línea 123: | ||
| </code> | </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... ===== | ===== How to... ===== | ||
| ==== Update DNS in Ubuntu 18.04 ==== | ==== Update DNS in Ubuntu 18.04 ==== | ||
| Línea 122: | Línea 178: | ||
| systemd-resolve --status | systemd-resolve --status | ||
| </code> | </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> | ||
| + | |||