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.

I have two Linux hosts HOST1 and HOST2 connected by cross cable. How I can break the network between then without breaking the physical wire (I don't have access).

If i do:

HOST1# ifconfig eth0 down

Then NIC card will down. I just want to down link. Is any other way we can make network link down?

share|improve this question
    
What is the end goal here. Once the machines are separated do you still need access to them? –  tkrabec Aug 17 '11 at 23:55
    
You say that they are connected by a cross cable, so I assume that it's a direct connection between the two hosts. What is the problem with bringing the interface(s) down? –  pferate Aug 18 '11 at 0:31
add comment

5 Answers

If the cards are supported, you could probably use mii-tool -F or ethtool to force both ends into incompatible speeds.

Be sure to get the correct setting first so you can set them back to normal.

share|improve this answer
    
thanks for inputs, i am not sure how to set eth0 in incompatible speeds, Please provide the commands . –  Vijay Aug 16 '11 at 13:54
    
wouldn't this be equivalent to shutting down the interface? –  Silverfire Aug 18 '11 at 2:11
add comment

You can setup a reject route in the routing table.

# route add -net X.X.X.X netmask 255.255.255.255 reject

If you want it persistent, you can add it to rc.local or something similar.

share|improve this answer
    
i was going to say the exact same thing :) –  Silverfire Aug 18 '11 at 2:08
add comment

Depending on the exact outcome you want, you could implement subinterfaces and VLANs. This page has some configuration info: http://nixcraft.com/networking-firewalls-security/10447-linux-vlan-configuration.html

share|improve this answer
    
, Please provide the example in detail –  Vijay Aug 16 '11 at 15:37
add comment

(install the iproute2 tool) and use this:

ip link set eth0 down

This will disable the link, bit keep the config.

share|improve this answer
    
"ip link set eth0 down" is equal to "ifconfig eth0 down" –  Vijay Aug 16 '11 at 13:45
    
You asked for "any other way we can make network link down?", which i answered... –  Silent-Bob Aug 16 '11 at 14:02
add comment

What's the current configuration? What are you trying to accomplish?

Short of turning down NICs or pulling the cable, you could ensure those interfaces are in different IP networks (or remove IPs) so they can no longer communicate.

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.