issue193:c_c
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue193:c_c [2023/05/29 07:45] – créée d52fr | issue193:c_c [2023/05/30 15:57] (Version actuelle) – andre_domenech | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | When you install Ubuntu, it covers a lot of bases for you that older Linux distros never used to. Oh, I recall trying to get my very first 3G dongle running in Aarvark, or the PCMCIA one in Warty Warthog. PPP was just not installed in Warty if I remember correctly. It took a moment to get me sorted, but the ‘happy ever after’ was that it worked! I recall trying to use a number of other distros, including Knoppix – the then defacto distro you used if you had odd hardware, and it just was not working with my no-name (ISP Branded) hardware. This was where my respect for Ubuntu started. Don’t get me wrong, I used Ubuntu, before it was Ubuntu, and though it was great, it was still a bit sucky when it came to hardware support. Luckily, I was semi-salted with network knowledge, so things were not such a mystery to me. This is what I want to impart to Ubuntu n00bs in this issue. A few issues ago we looked at ‘ip r’. Today, I want to take the next step in that direction as all you n00bs have obviously mastered ip r. So when I type ip r, I don’t need to explain. | + | **When you install Ubuntu, it covers a lot of bases for you that older Linux distros never used to. Oh, I recall trying to get my very first 3G dongle running in Aarvark, or the PCMCIA one in Warty Warthog. PPP was just not installed in Warty if I remember correctly. It took a moment to get me sorted, but the ‘happy ever after’ was that it worked! I recall trying to use a number of other distros, including Knoppix – the then defacto distro you used if you had odd hardware, and it just was not working with my no-name (ISP Branded) hardware. This was where my respect for Ubuntu started. Don’t get me wrong, I used Ubuntu, before it was Ubuntu, and though it was great, it was still a bit sucky when it came to hardware support. Luckily, I was semi-salted with network knowledge, so things were not such a mystery to me. This is what I want to impart to Ubuntu n00bs in this issue. A few issues ago we looked at ‘ip r’. Today, I want to take the next step in that direction as all you n00bs have obviously mastered ip r. So when I type ip r, I don’t need to explain.** |
- | This time around, let us look at ‘route’. Consider the screenshot bottom left. | + | Quand vous installez Ubuntu, l’installation fait beaucoup de choses à votre place que les distros Linux moins récentes ne faisaient jamais. Je me souviens de mes efforts pour faire fonctionner ma première clé 3G dans Aardvark ou la clé PCMCIA dans Warty Warthog. PPP n’était tout simplement pas installé dans Warty si je m’en souviens bien. Il a fallu un peu de temps pour que je sois à la page, mais, heureusement, |
+ | |||
+ | **This time around, let us look at ‘route’. Consider the screenshot bottom left. | ||
Now this is a VM, but if I had metal with a modem, there would be another interface under ‘Iface’ | Now this is a VM, but if I had metal with a modem, there would be another interface under ‘Iface’ | ||
Ligne 9: | Ligne 11: | ||
Here is a quick hands-on, please set your ‘network’ settings in Firefox to use Cloudflare for encrypted DNS (shown bottom right). | Here is a quick hands-on, please set your ‘network’ settings in Firefox to use Cloudflare for encrypted DNS (shown bottom right). | ||
- | Once done, open a terminal and type: ip r get 1.1.1.1 and press enter. 1.1.1.1 is Cloudflare DNS, so you should get a result. What you just did is: you asked ip route to get you a packet going to 1.1.1.1 and tell you what route it was taking (shown top right). | + | Once done, open a terminal and type: ip r get 1.1.1.1 and press enter. 1.1.1.1 is Cloudflare DNS, so you should get a result. What you just did is: you asked ip route to get you a packet going to 1.1.1.1 and tell you what route it was taking (shown top right). ** |
+ | |||
+ | Cette fois-ci, regardons « route ». Considérez la capture d’écran en bas à gauche : | ||
+ | |||
+ | Bon. Il s’agit d’une machine virtuelle, mais si j’avais une vraie machine avec un modem, il y aurait une autre interface sous « Iface ». | ||
+ | |||
+ | Notez que « ip r » et « ip r list » vous donneront le même résultat. | ||
+ | |||
+ | Voici une rapide expérience pratique : veuillez, s’il vous plaît, régler vos paramètres « réseau » dans Firefox afin d’utiliser Cloudflare pour un DNS crypté (montré en bas à droite). | ||
+ | |||
+ | Quand c’est fait, ouvrez un terminal et tapez : ip r get 1.1.1.1 et appuyez sur Entrée. 1.1.1.1 est le DNS de Cloudflare et vous devriez avoir un résultat. Ce que vous venez de faire est de demander à ip route d’envoyer un paquet vers 1.1.1.1 et vous dire la route qu’il choisit. | ||
+ | ** | ||
+ | In my case, we can see a packet going there via the 10.0.2.2 network on device enpos3, t he source was 10.0.2.15 (my VM), and the uid was 1000. Just like roads, you cannot simply hop on say, the N1, and drive straight to the supermarket. The supermarket may be located in Cherry Lane. To get to Cherry Lane, you need to turn right at Trent Road (don’t try, it is all fictitious). The same goes for your IP traffic. To get to 1.1.1.1 in Cherry Lane, I need to take a right at 10.0.2.2. This is the route that the IP traffic will take. Should you have more than one network interface, you can play traffic cop and route traffic all on your lonesome. You could now add a way for all traffic going to the 1.1.1.0 network to use enp1s3 for instance, with a simple command: ip r add 1.1.1.0/24 dev enp1s3 (*don’t do this, it is an example for you to understand the syntax, you will need to understand subnetting before attempting this). Anyway, once you do this, all traffic to 1.1.1.1 will now travel on enp1s3 instead of enp0s3. Typing ip route now, you will see that entry added. If you added this fake route to your machine, you can remove it with the same command, using del instead of add. ** | ||
+ | |||
+ | Dans mon cas, on peut voir un paquet qui y va via le réseau 10.0.2.2 sur le dispositif enpos3 ; l’adresse de la source était 10.0.2.15 (la machine virtuelle) et l’uid était 1000. Tout comme pour les routes, vous ne pouvez pas simplement rejoindre la N1 et aller tout droit au supermarché. Le supermarché se trouve peut-être dans Cherry Lane. Pour aller à Cherry Lane, il faut tourner à droite à Trent Road (n’essayez pas, c’est de la fiction). C’est la même chose pour le trafic IP. Pour arriver à la 1.1.1.1 sur Cherry Lane, je dois tourner à droite à 10.0.2.2. C’est la route que prendra le trafic IP. Si vous avez plus d’un réseau, vous pouvez prétendre être un agent de la circulation et vous pouvez choisir tout seul la route pour le trafic. Vous pourriez maintenant faire en sorte que tout le trafic allant au réseau 1.1.1.1 utilise enp1s3, par exemple avec une simple commande : ip r add 1.1.1.0/24 dev enp1s3 (ne le faites surtout pas, car ce n’est qu’un exemple pour que vous compreniez la syntaxe ; vous devrez comprendre les sous-réseaux avant d’essayer cela). Quoi qu’il en soit, dès que vous le faites, tout le trafic vers 1.1.1.1 ira sur enp1s3 au lieu de enp0s3. Si vous tapez ip route maintenant, vous verrez que cette entrée est ajoutée. Si vous avez ajouté cette fausse route à votre machine, vous pouvez l’enlever avec la même commande, mais en utilisant del au lieu de add. | ||
+ | |||
+ | **Consider the next replacement (bottom left). | ||
+ | |||
+ | In this case, the n’s are not the same. In the newer ip command, n is the shortest I can make neighbour. In the old way, the n stood for numeric. It is not needed for our example, but I wanted you to see the difference (just typing arp would imply –vn). Since the ‘new’ way is a lot like IOS, you could type ip ne, or ip nei, and the command will still work. The same syntax happens here, you can type ip nei add 192.168.1.250..... (you would need the MAC address or link-layer address aka lladdr, etc… too much detail for a n00b, just know it can be done). Because this is possible, it is also possible for an attacker to add their own ‘neighbour’ here, known as arp cache poisoning. These are reasons you never use root, unlike Windows – where people use Administrator and don’t learn. And just like that, in two issues, your understanding of the ip command doubled.** | ||
+ | |||
+ | Regardez le prochain remplacement (en bas à gauche). | ||
- | In my case, we can see a packet going there via the 10.0.2.2 network on device enpos3, the source was 10.0.2.15 | + | Dans ce cas, les « n » ne sont pas les mêmes. Dans la commande ip la plus récente, « n » est l’abréviation la plus courte que je peux faire de « neighbour » |
- | Consider | + | **To understand all the twists and turns your computer packets make, I wanted you to type traceroute www.google.co.uk in your terminal, but that is also not available in 22.04, so I will cover that in another issue. :) The Linux landscape is changing, and you need to change with it, I suppose. I should have planned this better, but I see it as an opportunity to write about another funky tool soon! |
- | In this case, the n’s are not the same. In the newer ip command, n is the shortest I can make neighbour. In the old way, the n stood for numeric. It is not needed for our example, but I wanted you to see the difference (just typing arp would imply –vn). Since the ‘new’ way is a lot like IOS, you could type ip ne, or ip nei, and the command will still work. The same syntax happens here, you can type ip nei add 192.168.1.250..... (you would need the MAC address or link-layer address aka lladdr, etc… too much detail for a n00b, just know it can be done). Because this is possible, it is also possible for an attacker to add their own ‘neighbour’ here, known as arp cache poisoning. These are reasons you never use root, unlike Windows – where people use Administrator and don’t learn. And just like that, in two issues, your understanding of the ip command doubled. | + | As always, send recipes |
- | To understand all the twists and turns your computer packets make, I wanted you to type traceroute | + | Pour comprendre le voyage compliqué que font les paquets de votre ordinateur, je voulais vous faire taper « traceroot |
- | As always, send recipes to misc@fullcirclemagazine.org | + | Comme toujours, envoyez vos recettes à misc@fullcirclemagazine.org |
issue193/c_c.1685339149.txt.gz · Dernière modification : 2023/05/29 07:45 de d52fr