When an NIC configured manually then how can I plug and unplug it? "ifdown" command not worked:
Code: Select all
$ sudo ifdown eht1
ifdown: interface eht1 not configured
Code: Select all
$ sudo ifdown eht1
ifdown: interface eht1 not configured
How exactly did you do this?hack3rcon wrote:an NIC configured manually
^ This indicates that eth1 is not listed in /etc/network/interfaceshack3rcon wrote:Code: Select all
ifdown: interface eht1 not configured
What do you mean ?hack3rcon wrote:When an NIC configured manually
What do you mean ?hack3rcon wrote:plug and unplug it
No, it means that eth1 was not configured with ifup.Head_on_a_Stick wrote:This indicates that eth1 is not listed in /etc/network/interfaces
And ifup is configured via /etc/network/interfaces, no?p.H wrote:No, it means that eth1 was not configured with ifup.Head_on_a_Stick wrote:This indicates that eth1 is not listed in /etc/network/interfaces
Code: Select all
/sbin/ifquery eth1
cat /etc/network/interfaces
ip link
Yes, and other files sourced by it.Head_on_a_Stick wrote:And ifup is configured via /etc/network/interfaces, no?
Output are:Head_on_a_Stick wrote:And ifup is configured via /etc/network/interfaces, no?p.H wrote:No, it means that eth1 was not configured with ifup.Head_on_a_Stick wrote:This indicates that eth1 is not listed in /etc/network/interfaces
@OP: what is the output ofEDIT: no, wait, you are right about ifup, thanks for the correction.Code: Select all
/sbin/ifquery eth1 cat /etc/network/interfaces ip link
Code: Select all
$ sudo /sbin/ifquery eth1
Unknown interface eth1
$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN mode DEFAULT group default qlen 1000
link/ether 94:de:80:b8:1a:54 brd ff:ff:ff:ff:ff:ff
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
link/ether 00:11:3b:15:4a:32 brd ff:ff:ff:ff:ff:ff
Pro tip: don't use `sudo` unless you really have to.hack3rcon wrote:Code: Select all
$ sudo /sbin/ifquery eth1
with ifconfig you can:hack3rcon wrote:I want to connect and disconnect the NIC.
Thank you, but why "ifdown" command can't do it?reinob wrote:with ifconfig you can:hack3rcon wrote:I want to connect and disconnect the NIC.
# ifconfig eth1 up <your-ip-address>
and then
# ifconfig eth1 down
I'll leave it as an exercise to do the above using the more modern "ip" command (ifconfig is deprecated).
ifup and ifdown work with definitions from /etc/network/interfaces, so they require that you configure your networking using that system (which has been told to you already in this very thread by a number of knowledgeable people), but you said you want to do it manually, so I've told you how to do it manually.hack3rcon wrote:Thank you, but why "ifdown" command can't do it?reinob wrote:with ifconfig you can:hack3rcon wrote:I want to connect and disconnect the NIC.
# ifconfig eth1 up <your-ip-address>
and then
# ifconfig eth1 down
I'll leave it as an exercise to do the above using the more modern "ip" command (ifconfig is deprecated).