Skip to content

Commit

Permalink
Using udev rule to change Netdev name
Browse files Browse the repository at this point in the history
  • Loading branch information
Mmduh-483 authored and ahalimx86 committed Aug 28, 2019
1 parent de334c5 commit b73fa50
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Additional documentation
This page contains supplimentary documention that users may find useful for various use-cases with SR-IOV network device plugin.

* [Running DPDK application in Kubernetes](dpdk/)
* [Running DPDK application in Kubernetes](dpdk/)
* [Using UDEV Rules for changing NIC's network device name](udev/)
23 changes: 23 additions & 0 deletions docs/udev/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Using UDEV Rules for changing NIC's network device name

To allow "pfNames" selector to consistently select a specific device across nodes it is required to define a fixed network device name. UDEV rules allow the user to change the NIC's network device name every time the node get rebooted:

1. Add a new rule:
```
# vi /etc/udev/rules.d/90-netnames.rules
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", KERNELS=="0000:02:00.0", NAME="pf0s0f1"
```

`SUBSYSTEM` Match against the subsystem of the device
`ACTION` Action to be done at the next reboot
`DRIVER` Match against the name of the driver backing the device
`KERNELS` Match against the kernel name for the device, here the pci address
`NAME` The new name for the NIC

2. Run udev commands
```
# udevadm control --reload
# udevadm trigger --action=add -attr-match=subsystem=net
```

3. Reboot the machine or reload the driver for the NIC

0 comments on commit b73fa50

Please sign in to comment.