0

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?

2
  • What is the end goal here. Once the machines are separated do you still need access to them?
    – tkrabec
    Aug 17, 2011 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, 2011 at 0:31

5 Answers 5

1

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.

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

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.

1
  • i was going to say the exact same thing :)
    – Silverfire
    Aug 18, 2011 at 2:08
0

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

1
  • , Please provide the example in detail
    – Vijay
    Aug 16, 2011 at 15:37
0

(install the iproute2 tool) and use this:

ip link set eth0 down

This will disable the link, bit keep the config.

2
  • "ip link set eth0 down" is equal to "ifconfig eth0 down"
    – Vijay
    Aug 16, 2011 at 13:45
  • You asked for "any other way we can make network link down?", which i answered...
    – Silent-Bob
    Aug 16, 2011 at 14:02
0

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .