Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
ip a add 192.168.1.52/24 dev enp0s3:2, command was successful but I am not able to see the vip using ifconfig. However I can see using,
ip -4 -o a
2: enp0s3 inet 192.168.1.52/24 scope global secondary enp0s3\ valid_lft forever preferred_lft forever
I want to know how to add virtual IP using ip command exactly same as ifconfig.
ip a add 192.168.1.52/24 dev enp0s3:2, command was successful but I am not able to see the vip using ifconfig. However I can see using,
ip -4 -o a 2: enp0s3 inet 192.168.1.52/24 scope global secondary enp0s3\ valid_lft forever preferred_lft forever
I want to know how to add virtual IP using ip command exactly same as ifconfig.
Ok...so did you read the man page on the command??? Since you know what the ifconfig command does, reading the man page on the "ip" command will tell you what the new syntax is. And your question doesn't make sense....you're saying that you ARE able to do exactly the same things (create a virtual IP, and see it) with ip as you can with ifconfig. But your 'problem' is that you can't use the **OLD, DEPRECATED** command to see the changes??
Distribution: openSUSE, Raspbian, Slackware. Previous: MacOS, Red Hat, Coherent, Consensys SVR4.2, Tru64, Solaris
Posts: 2,803
Rep:
Quote:
Originally Posted by michaelk
[code]Adding a label creates an alias like the old ifconfig
It's been a while since I used aliases on any of my systems but I seem to recall that "ifconfig" and "ip" had different rules about how you named/labeled the additional IP addresses. That was another initial confusion that might burn newcomers to "ip". (I haven't aliases since I switched internet providers and the new equipment freaked out when it saw multiple IP addresses with the same MAC.)
I am able to bring up the virtual IP using below command
[root@node01 ~]# ip a add 192.168.1.5/24 broadcast 192.168.1.255 label enp0s3:2 scope global dev enp0s3
[root@node01 ~]# ifconfig enp0s3:2
enp0s3:2: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.5 netmask 255.255.255.0 broadcast 192.168.1.255
ether 08:00:27:c9:c4:82 txqueuelen 1000 (Ethernet)
[root@node01 ~]#
[root@node01 ~]# ifdown enp0s3:2
usage: ifdown <configuration>
[root@node01 ~]# ip link set enp0s3:2 down
The above command completely brought down my main interface instead of virtual interface. I want to know how to bring down using IP command. (ifconfig enp0s3:2 down. This command only bring down the virtual)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.