Find the answer to your Linux question:
Results 1 to 6 of 6
Hi, today I tried to configure a network route to a host for testing my network interface. Code: route add 192.168.1.15 eth0 As I have to eth interfaces and both ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2010
    Posts
    10

    configuring network route


    Hi,

    today I tried to configure a network route to a host for testing my network interface.

    Code:
    route add 192.168.1.15 eth0
    As I have to eth interfaces and both interface got their IP from DHCP (192.168.1.11 and 192.168.1.12) and are in the same subnet, I shut the other interface down:

    Code:
    ifconfig eth1 down

    Then I tried to test the interface by doing a ping to 192.168.1.15.

    Problem:
    When I unplug the cable from eth0 (and eth1 is still plugged) the ping still works. Somehow my linux (it's debian) powers up again eth0 and pings over this port.

    How can I stop my linux doing this. I just want to have the route added only on the one interface - not the other.

    Is it maybe some case of a default-gateway?

    Thanks for your help.

  2. #2
    Linux Engineer Kloschüssel's Avatar
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    773
    eth1 may has the option auto, which automatically powers it on when a connection can be established. You can look this up here: /etc/network/interfaces

  3. #3
    Just Joined!
    Join Date
    Jul 2010
    Posts
    10
    My /etc/network/interfaces has (only for eth0)
    allow-hotplug eth0
    iface eth0 inet dhcp

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Engineer Kloschüssel's Avatar
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    773
    Code:
    #man 5 interfaces
    Lines beginning with "allow-" are used to identify interfaces that
    should be brought up automatically by various subsytems. This
    may be done using a command such as "ifup --allow=hotplug eth0 eth1",
    which will only bring up eth0 or eth1 if it is listed in an
    "allow-hotplug" line. Note that "allow-auto" and "auto" are synonyms.
    Please READ the manual pages if there are some. They are there just for this purpose!

  6. #5
    Just Joined!
    Join Date
    Jul 2010
    Posts
    10
    Thanks for this hint. That was actually the problem!

    Yes, I know, RTFM!

  7. #6
    Linux Engineer Kloschüssel's Avatar
    Join Date
    Oct 2005
    Location
    Italy
    Posts
    773
    True, RTFM and finally SOLVE answered questions. It makes it easier and safes time to everybody.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •