For example:
$ ifconfig dummy0 up
$ ifconfig dummy0 "192.168.1.190 netmask 255.255.255.0"
Calling ifconfig with no parameters shows the interface
dummy0 Link encap:Ethernet HWaddr b6:1f:f3:92:6d:20
inet addr:192.168.1.190 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::b41f:f3ff:fe92:6d20/64 Scope:Link
UP BROADCAST RUNNING NOARP MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:15 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:1050 (1.0 KiB)
How can I bring the interface down so that it doesn't show up in
- ifconfig
- ifconfig -a
- ifconfig dummy0
without rmmod dummy
because dummy is used just for example purposes.
If there is no way to do that, what "throw-away" IP could I set to it and be safe from any trouble?
like
$ ifconfig dummy0 down
$ ifconfig dummy0 0.0.0.0
Flush the ip:
to bring interface dummy0 down
ip link set dummy0 down
to bring it up
ip link set dummy0 up
there is usually a
ifdown
script on the root shell.Throw away IP addresses are out of question.
Unused interfaces should be shutdown.
I used this command to show all interfaces
ip a s
To disable
dummy
I use two commands (RHEL is so "fascinating")):ifconfig dummy0 down
ip addr del "your ip" dev dummy0
That worked for me.
sets it to a loopback address
ifconfig shows the current enabled interfaces. ifconfig -a shows all the interfaces on the system, including those that are down. ifconfig dummy0 will show you the interface you asked for. As such, if you down an interface, it will not show if you do ifconfig, but will if you do ifconfig -a or ask for information about that particular interface. The only way to not display it is if you remove the kernel module or remove the physical interface.
As for disabling in interface, you just need to set it to being down. It does not matter if it still has an IP address assigned to it, for the kernel will not use that interface until you bring it up again.
Whats wrong with this?
ifdown is the way to do it eg ifdown dummy down
You can also use following command to completely remove the dummy interface.
if it show busy, then first disable the dummy0 interface & then try again.
I am answering this post After one year but may be helpful for someone ;-)
Rahul Panwar