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?

jscott
  • 24,484
  • 8
  • 79
  • 100
Vijay
  • 9
  • 1
  • 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 00:31

5 Answers5

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.

DerfK
  • 19,493
  • 2
  • 38
  • 54
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.

pferate
  • 463
  • 2
  • 9
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

unhappyCrackers1
  • 977
  • 1
  • 6
  • 18
0

(install the iproute2 tool) and use this:

ip link set eth0 down

This will disable the link, bit keep the config.

Silent-Bob
  • 1,066
  • 6
  • 9
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.

Bryan Redd
  • 36
  • 1