1

i am trying to execute

echo "ens6f1" > /sys/class/net/bond0/bonding/slaves

but getting error:

bond0: Interface ns6f1 does not exist!

is this an "echo" issue or some issue with the file which i am trying to write.

ubuntu 14.04.4

ip l l ens6f1
25: ens6f1: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN mode DEFAULT group default qlen 1000
link/ether 14:02:ec:67:fd:95 brd ff:ff:ff:ff:ff:ff
ananthan
  • 1,510
  • 1
  • 18
  • 28
  • 1
    You probably got a non-printing character in there somewhere. Type it in again, and don't copy and paste it. – Michael Hampton Mar 07 '17 at 08:34
  • i tried that,but unfortunatley it doesnt work. but works for regular file. echo ens6f1 > hi root@node-2:/root/# cat hi ens6f1 – ananthan Mar 07 '17 at 09:45

1 Answers1

2

You have to echo '+ens6f1' to add an interface, note the plus sign. The error message you see comes from the kernel code, which strips the first character (operation sign, plus or minus, in your case a letter e) and treats the rest as an interface name. Before any operation is considered, interface name validity is checked, so you get that error..

Peter Zhabin
  • 2,696
  • 9
  • 10