issue191:c_c
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue191:c_c [2023/04/01 08:28] – créée d52fr | issue191:c_c [2023/04/06 15:02] (Version actuelle) – andre_domenech | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | Welcome back to another edition of FCM! This issue, we will look at something I have put off personally, and if you did too, it is time to sit down with the Ubuntu n00bs. | + | **Welcome back to another edition of FCM! This issue, we will look at something I have put off personally, and if you did too, it is time to sit down with the Ubuntu n00bs. |
Honestly, I should have moved forward, but muscle memory... | Honestly, I should have moved forward, but muscle memory... | ||
Ligne 5: | Ligne 5: | ||
Yes, I still use net-tools, even if it is deprecated. I don’t want to have the net-tools package chat with you; instead, I want us to look at the more modern network tools that ship with Ubuntu. Rather those that ship with any modern Linux distribution. | Yes, I still use net-tools, even if it is deprecated. I don’t want to have the net-tools package chat with you; instead, I want us to look at the more modern network tools that ship with Ubuntu. Rather those that ship with any modern Linux distribution. | ||
- | Just like the hostname and hostnamectl commands confuse n00bs, I suppose the network commands in Ubuntu can be confusing to some, especially when you do not use them that often. On the other side of the coin, you may have old farts like me who are just more comfortable with the older commands, and do not have need for the newer ones. What I do love about the newer commands is that you can use the abbreviated forms like in CISCO IOS. ;-) | + | Just like the hostname and hostnamectl commands confuse n00bs, I suppose the network commands in Ubuntu can be confusing to some, especially when you do not use them that often. On the other side of the coin, you may have old farts like me who are just more comfortable with the older commands, and do not have need for the newer ones. What I do love about the newer commands is that you can use the abbreviated forms like in CISCO IOS. ;-)** |
- | We can start with ip. Type: man ip - to me please. Here you can see that the command is broken into three sections, with help. | + | Bienvenue dans ce nouveau numéro du FCM ! Cette fois-ci, nous allons examiner quelque chose que, personnellement, |
+ | |||
+ | Honnêtement, | ||
+ | |||
+ | Oui, j’utilise toujours net-tools, même si c’est obsolète. Mais je ne veux pas bavarder avec vous au sujet du paquet net-tools ; | ||
+ | |||
+ | Tout comme les commandes hostname et hostnamectl rendent les bleus perplexes, je suppose que les commandes réseau dans Ubuntu peuvent rendre perplexes quelques personnes, surtout si elles ne les utilisent pas très souvent. Puis, il peut y avoir les vieux cons comme moi qui sont tout simplement plus à l’aise avec les vieilles commandes et n’ont pas besoin des nouvelles. Ce qui me plaît dans les plus récentes commandes, c’est que vous pouvez utiliser des abréviations comme dans CISCO IOS. ;-) [Ndt : si, comme moi, vous ne le connaissez pas, vous pouvez regarder ici : https:// | ||
+ | |||
+ | **We can start with ip. Type: man ip - to me please. Here you can see that the command is broken into three sections, with help. | ||
Now if you did not know about the shortcuts, the ip command does seem like a lot of typing, for instance here is the TL;DR page: | Now if you did not know about the shortcuts, the ip command does seem like a lot of typing, for instance here is the TL;DR page: | ||
- | Who in their right mind would want to type out: ip –brief address ?? OK, we have established that I am lazy, but no more lazy than the next person – who could not be bothered using Windows or Mac online with all its spying. Oh wait, that is most people. Anyway, the point I am trying to make is that when you see the commands that are more like stories instead of commands, which are you more likely to type? | + | Who in their right mind would want to type out: ip –brief address ?? OK, we have established that I am lazy, but no more lazy than the next person – who could not be bothered using Windows or Mac online with all its spying. Oh wait, that is most people. Anyway, the point I am trying to make is that when you see the commands that are more like stories instead of commands, which are you more likely to type? ** |
- | Consider: | + | Nous pouvons commencer avec ip. Pour me faire plaisir, tapez : man ip. Là vous pouvez voir que la commande est composée de trois sections, avec l’aide. |
+ | |||
+ | Bon, si vous ne connaissiez pas les raccourcis, la commande ip semble nécessiter beaucoup de dactylographie ; | ||
+ | |||
+ | Qui, sain d’esprit, voudrait taper : ip -courte adresse ?? Bon, on est sûr que je suis paresseux, mais pas plus paresseux que d’autres, qui ne voudraient pas prendre la peine d’utiliser Windows ou Mac en ligne avec tout leur espionnage. Ah, attendez, ce sont la plupart des gens. Quoi qu’il en soit, ce que j’essaie de dire est que, quand vous voyez des commandes qui ressemblent plus à des histoires qu’à des commandes, laquelle voudriez-vous taper ? | ||
+ | |||
+ | **Consider: | ||
ifconfig eth0 down | ifconfig eth0 down | ||
vs | vs | ||
Ligne 20: | Ligne 34: | ||
It is already two words more. That is two more things to remember, and you have to remember that, if you leave out ‘set’, it will not work. Now that I have explained my past reluctance in using the new way of doing things, let me show you around, or should I say, “stay a while and listen...” | It is already two words more. That is two more things to remember, and you have to remember that, if you leave out ‘set’, it will not work. Now that I have explained my past reluctance in using the new way of doing things, let me show you around, or should I say, “stay a while and listen...” | ||
- | While I am not as old as Horadric, I feel that way using old Linux commands, so let’s shoot the breeze. | + | While I am not as old as Horadric, I feel that way using old Linux commands, so let’s shoot the breeze.** |
- | Type: ‘ip address’ and press enter in your terminal. Now type ‘ip a’ and press enter. What is the difference in the output? So, even though we are typing two words, to do what one word used to do, we can shorten it to four keystrokes. Here we go, not wasting my precious time gets them bonus points. Though I did say it was like CISCO IOS, I meant superficially. For instance, we have ‘ip route’ and ‘ip rule’. In CISCO IOS, you need to type until the command is unique. Typing: ‘ip r’ would give you an error. In Ubuntu, typing ‘ip r’ is ‘ip route’. Just be aware of this difference if you have used something like CISCO IOS before. | + | Regardez |
+ | ifconfig eth0 down | ||
+ | contre | ||
+ | ip link set eth0 down | ||
- | Now, even though this is great, there is a trap here. Consider the image below. | + | Ça fait déjà deux mots de plus. Et ça fait encore deux choses dont il faut se souvenir et il faut vous rappeler que, si vous omettez « set », ça ne fonctionnera pas. Maintenant que j’ai expliqué ma réticence passée pour la nouvelle façon de faire les choses, permettez-moi de vous guider ou, devrais-je dire, « restez un moment et écoutez-moi... » |
- | This is great once you are salted, but when learning, this is cryptic. WTH is “l ls”? It is even worse when the font is horrible, another reason I implore you to use nerd fonts. The command is: ‘ip link ls up’, which tells us which adapters are up. This is great in things like firewalls or servers, where you have more than one interface, but you may not use it at home much. As you can see from my example, the loopback interface, which is always up, is listed with my network interface in the vm, enp0s3. (You may see eth1). This will come with practice, and you should not try to remember all the shortcuts. For now, type ip link, and challenge yourself to shorten it next month, after you have used it this month. We know ‘ls’ is list, so de-constructing the command is not hard. This is my advice for anything, if you can do it backwards, you know it. Yes, I mean that literally. | + | Alors que je ne suis pas aussi âgé que Horadric, j’ai le sentiment de l’être en utilisant de vieilles commandes Linux, alors parlons-en. |
- | Looking back at the man page, we will see: ip, options, object, command. Which means I can do something like this: ip a add 192.168.1.100 dev enp0s3 – Now while that may look like gibberish | + | **Type: ‘ip address’ and press enter in your terminal. Now type ‘ip a’ and press enter. What is the difference in the output? So, even though we are typing two words, |
- | Let’s quickly look at the output I have, and I will point out another thing you may need. | + | Now, even though this is great, there is a trap here. Consider the image below.** |
+ | |||
+ | Tapez « ip address » dans votre terminal et appuyez sur Entrée. Maintenant tapez « ip a » et appuyez sur Entrée. Quelle est la différence dans la sortie ? Ainsi, bien que nous tapions deux mots pour faire ce qu’un seul mot faisait dans le passé, nous pouvons le raccourcir pour qu'il ne fasse que quatre frappes. Et voilà, ne pas gaspiller mon temps précieux leur donne des points de plus. Bien que j’aie dit que c’était comme CISCO IOS, je voulais dire superficiellement. Par exemple, il y a « ip route » et « ip rule ». Dans CISCO IOS, il faut taper jusqu’à ce que la commande soit unique et taper « ip r » vous donnerait une erreur. Dans Ubuntu « ip r » est « ip route ». Il faut tout simplement être conscient de cette différence si vous avez déjà utilisé quelque chose comme CISCO IOS. | ||
+ | |||
+ | Cependant, bien que ce soit génial, il y a un piège ici. Regardez l' | ||
+ | |||
+ | **This is great once you are salted, but when learning, this is cryptic. WTH is “l ls”? It is even worse when the font is horrible, another reason I implore you to use nerd fonts. The command is: ‘ip link ls up’, which tells us which adapters are up. This is great in things like firewalls or servers, where you have more than one interface, but you may not use it at home much. As you can see from my example, the loopback interface, which is always up, is listed with my network interface in the vm, enp0s3. (You may see eth1). This will come with practice, and you should not try to remember all the shortcuts. For now, type ip link, and challenge yourself to shorten it next month, after you have used it this month. We know ‘ls’ is list, so de-constructing the command is not hard. This is my advice for anything, if you can do it backwards, you know it. Yes, I mean that literally. ** | ||
+ | |||
+ | C’est génial une fois que vous savez ce que vous faites, mais, pendant l’apprentissage, | ||
+ | |||
+ | **Looking back at the man page, we will see: ip, options, object, command. Which means I can do something like this: ip a add 192.168.1.100 dev enp0s3 – Now while that may look like gibberish to an Ubuntu n00b, it will most certainly work if your network interface is named enp0s3, like mine is. I can change my IP address with this command, but as soon as I reboot my VM, it will be back to default. Remember this, so if you are following along and you typed it, and your VM’s network connection is gone, and you are unsure how to fix it, know that it is temporary. Logic tells me that if I have an add, I must have a remove. Want to venture a guess on how to “remove” the ip address you just gave your virtual adapter? Nope, it is not rem, remove nor r, it is del for delete. Recall that r is route here. This is what I want you to take away here – type out the full commands now, as a n00b, and in a month or two’s time, when you shorten them, you have a grasp as to why you are doing it one way and not another. ** | ||
+ | |||
+ | Retournant à la page man, nous voyons : ip, options, object, command. Cela signifie que je peux faire quelque chose comme ceci : ip a add 192.168.1.100 dev ens3. Bon, alors que, pour quelqu’un qui débute sous Ubuntu, cela peut ressembler à du charabia, cela fonctionnera si, comme la mienne, votre interface réseau se nomme enp0s3. Je peux changer mon adresse ip avec cette commande, mais, dès que je redémarre ma machine virtuelle, elle sera revenue à la valeur par défaut. Souvenez-vous de ceci : ainsi, si vous suivez ce tutoriel et que vous l’avez tapé, et que la connexion réseau de votre machine virtuelle a disparu et que vous ne savez pas vraiment comment la réparer, sachez que c’est temporaire. La logique me dit que, si j’ajoute quelque chose, il faut « remove » (enlever) quelque chose d’autre. Voulez-vous essayer de deviner comment « enlever » l’adresse ip que vous venez de donner à votre adaptateur viruel ? Et non, ce n’est pas rem, remove ou r, c’est del pour delete (supprimer). Souvenez-vous que, ici, r est route. C’est cela que je veux que vous ayez appris ici – saisissez les commandes complètes maintenant, en tant que débutant, et, dans un mois ou deux, en les raccourcissant, | ||
+ | |||
+ | **Let’s quickly look at the output I have, and I will point out another thing you may need. | ||
2: enp0s3: < | 2: enp0s3: < | ||
Ligne 40: | Ligne 71: | ||
• And lastly the device we wish to act upon. | • And lastly the device we wish to act upon. | ||
- | If all this made sense to you, great! If not, please go ahead and play with the ip command. If you would like me to broaden this penny tour, let us know at misc@fullcirclemagazine.org | + | If all this made sense to you, great! If not, please go ahead and play with the ip command. If you would like me to broaden this penny tour, let us know at misc@fullcirclemagazine.org** |
+ | |||
+ | Revenons rapidement à la sortie obtenue chez moi et j’indiquerai un autre truc dont vous aurez peut-être besoin. | ||
+ | |||
+ | 2 : enp0s3: < | ||
+ | |||
+ | Si vous ne connaissez pas grand chose aux réseaux, c’est bien, mais il se peut que vous rencontriez une situation où votre ligne est plus rapide ou plus lente que généralement et que l' | ||
+ | ••Il s’agit de ip link (car nous allons bricoler la liaison). | ||
+ | ••La commande set, car nous allons régler quelque chose – dans notre cas la mtu. | ||
+ | ••La nouvelle valeur. | ||
+ | ••Et enfin le dispositif sur lequel nous voulons agir. | ||
+ | |||
+ | Si tout cela vous semble logique, c’est très bien ! Sinon, allez-y et jouez avec la commande ip. Si vous voulez que j’approfondisse ce tour à un sou, dites-le-moi à misc@fullcirclemagazine.org |
issue191/c_c.1680330492.txt.gz · Dernière modification : 2023/04/01 08:28 de d52fr