Set virtual interfaces in ArchLinux

All user of Debian you know that creating a virtual "interface" (to be able to access another IP range for example) is relatively easy. We open a terminal and put:

$ sudo ifconfig eth0:1 192.168.X.X

When i switched to ArchLinux The first thing that struck me a bit was the way to establish the connections or lift the network cards. Usually like this:

$ sudo ip link set enp5s0 up

And then, if we have a fixed IP:

$ sudo ip addr add 192.168.X.X/255.255.255.0 dev enp5s0

I honestly found it a hassle to have to do things this way, and I missed my ifconfig, but today asking on Twitter, the compa @GregorioEspadas pointed out that I can have ifconfig en ArchLinux installing the package:

$ sudo pacman -S net-tools

I saw the heavens open. I can already have virtual network interfaces just by running:

sudo ifconfig enp5s0:1 192.168.X.X

And that's all dear friends 😀


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   eliotime3000 said

    Arch is another world. Just that, another world, another parallel universe.

    1.    elav said

      A world in which I am trapped and I cannot go out .. rather, I don't want to go out

      1.    eliotime3000 said

        I wish, but the truth is that the only thing I need to be in Arch is to organize my time to be able to give you the care you really need.

        1.    elav said

          I don't even pay attention to mine .. what's more, I didn't even realize that I used Arch until now xDDD

          1.    f3niX said

            Haha that's true, after you install it the first time, the rest is easy.

          2.    eliotime3000 said

            I mean the constant updates it has (drivers, interfaces, libraries, codecs ...).

          3.    elav said

            Man, you don't feel. I run every day a

            pacman -Syu

            And nothing happens. Everything is still working. In fact, so much stability is boring .. 😀

          4.    ever said

            Elav, let's agree that from time to time if you have to put a little hand (for example, when it was necessary to migrate from SysV to systemd, when binaries were removed from / bin and libraries from / lib, when support was discontinued to Grub 1, etc), but it is true that the official website helps, and a lot, sometimes creating a totally APB guide.

          5.    eliotime3000 said

            Well, that's what I mean by "updates", because it is a pain of tarballs when you are working and / or studying from Monday to Friday and you hardly have time to browse the blog and / or other websites.

  2.   msx said

    IFCONFIG IS OBSOLETE.

    Prehistoric distros keep it as a compatibility layer but the IP command absolutely replaces IFCONFIG, also bringing new functionality.

    Arch Linux, simply because it is a bleeding edge distribution, adopts new technologies before the rest, that is why distributions such as Debian or Slackware are typical of The Flintstones in the eyes of any archero.

    1.    eliotime3000 said

      I noticed. Also, it is practical with the ip config than with the ifconfig (which I just know).

      1.    eliotime3000 said

        And well, you have to respect the customs of each one.

    2.    elav said

      Ok, it's obsolete, so tell me how do I do what I showed in the post with the IP command? 😉

      1.    eliotime3000 said

        Rummaging through Arch Wiki, here is the solution with VLANs using only IP: https://wiki.archlinux.org/index.php/VLAN

      2.    msx said

        http://www.tty1.net/blog/2010/ifconfig-ip-comparison_en.html
        http://andys.org.uk/bits/2010/02/24/iproute2-life-after-ifconfig/
        http://whodat.be/iproute2-cheatsheet-and-reference-guide/
        http://blog.timheckman.net/2011/12/22/why-you-should-replace-ifconfig/

        As there are people who still use WinXP today, there are sysadmines -especially from the Debian / Slack / CentOS stick- who continue to use ifconfig.

        ifconfig is deprecated and should die in the same way as Flash.

        1.    elav said

          Okay. This is just what I needed:

          ifconfig eth0: 1 10.0.0.1/8 ip addr add 10.0.0.1/8 dev eth0 label eth0: 1

          But as much as ifconfig is out of date, you will agree with me that a lot more needs to be written.

          1.    eliotime3000 said

            The correct statement would be: ip addr add 10.0.0.1 dev enp0s3 label enp0s3: 1, since eth0 is no longer used in Arch.

          2.    elav said

            Yes, yes, I know. I just copied what the page said. And as you can see, it is longer and more cumbersome .. So -1 for IP

          3.    msx said

            It's true, it's not exactly 'obsolete' since it still works for what it was conceived for, my bad 😛

            Likewise, it would not hurt to learn iproute2 little by little to be less dependent on ifconfig since the idea is to discontinue the tool - in fact it is not developed further - in favor of the new alternative.

            Thank you for the correction!

            Btw: how does it feel now that you are one more archero to have to explain over and over again that Arch is not even remotely less stable than Debian or Slack or CentOS to the users of those distributions when they pound over and over again that demode tune ? Many times not all the patience in the world is enough!
            The truth is, it doesn't make you feel a little like this:
            http://ih3.redbubble.net/image.11640658.0674/pp,375×360.jpg

            1.    elav said

              Hehehe .. No comment.