Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
share|improve this question
add comment

8 Answers

up vote 5 down vote accepted

Flush the ip:

root@foo:~# ifconfig dummy0 192.168.55.1 netmask 255.255.255.0
root@foo:~# ifconfig dummy0 
dummy0    Link encap:Ethernet  HWaddr 5b:72:32:4f:92:c8  
          inet addr:192.168.55.1  Bcast:192.168.55.255  Mask:255.255.255.0
          UP BROADCAST RUNNING NOARP  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

root@foo:~# ip address flush dev dummy0
root@foo:~# ifconfig dummy0 down
root@foo:~# ifconfig dummy0 
dummy0    Link encap:Ethernet  HWaddr 5b:72:32:4f:92:c8
          BROADCAST NOARP  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
share|improve this answer
    
Just what I needed, thank you. –  Karolis T. Jul 2 '09 at 8:53
1  
"ifconfig", although still available in most distributions, has been considered deprecated for some time in favour of the "ip" tool. –  Jon Topper Jul 6 '09 at 17:11
add comment

there is usually a ifdown script on the root shell.

/sbin/ifdown

Throw away IP addresses are out of question.
Unused interfaces should be shutdown.

share|improve this answer
add comment

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.

share|improve this answer
add comment
$ ifconfig dummy0 127.0.0.4 down

sets it to a loopback address

share|improve this answer
add comment

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.

share|improve this answer
add comment

Whats wrong with this?

root@moppel:~# ifconfig dummy0 192.168.3.124 up
root@moppel:~# ifconfig dummy0
dummy0    Link encap:Ethernet  Hardware Adresse 1a:36:a4:38:b1:d1
          inet Adresse:192.168.3.124  Bcast:192.168.3.255  Maske:255.255.255.0
          inet6-Adresse: fe80::1836:a4ff:fe38:b1d1/64 Gültigkeitsbereich:Verbindung
          UP BROADCAST RUNNING NOARP  MTU:1500  Metrik:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:48 errors:0 dropped:0 overruns:0 carrier:0
          Kollisionen:0 Sendewarteschlangenlänge:0
          RX bytes:0 (0.0 B)  TX bytes:11465 (11.1 KiB)

root@moppel:~# ifconfig dummy0 0.0.0.0 down
root@moppel:~# ifconfig dummy0
dummy0    Link encap:Ethernet  Hardware Adresse 1a:36:a4:38:b1:d1
          BROADCAST NOARP  MTU:1500  Metrik:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:49 errors:0 dropped:0 overruns:0 carrier:0
          Kollisionen:0 Sendewarteschlangenlänge:0
          RX bytes:0 (0.0 B)  TX bytes:11535 (11.2 KiB)
share|improve this answer
add comment

ifdown is the way to do it eg ifdown dummy down

share|improve this answer
    
Doesn't remove it from ifconfig -a and ifconfig dummy0 still shows old IP address. The correct solution was to flush it, as per answer above. –  Karolis T. Jul 2 '09 at 13:31
add comment

You can also use following command to completely remove the dummy interface.

rmmod dummy

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.