Showing posts with label udev. Show all posts
Showing posts with label udev. Show all posts

Monday, March 21, 2016

Network Setup in Linux


In Redhat and CentOS
Network interface cards are auto-discovered, they can be seen here; /etc/udev/rules.d/ in the file 70-persistent-net.rules
View the File:
cat /etc/udev/rules.d/70-persistent-net.rules
Output:
# This file was automatically generated by the /lib/udev/write_net_rules
# program, run by the persistent-net-generator.rules rules file.
#
# You can modify it, as long as you keep each rule on a single
# line, and change only the value of the NAME= key.
# net device () (custom name provided by external tool)
SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, ATTR{address}==”00:15:5d:xx:xx:xx”, ATTR{type}==”1″, KERNEL==”eth*”, NAME=”eth1″
# net device () (custom name provided by external tool)
SUBSYSTEM==”net”, ACTION==”add”, DRIVERS==”?*”, ATTR{address}==”00:15:5d:xx:xx:xx”, ATTR{type}==”1″, KERNEL==”eth*”, NAME=”eth0″

Note: In Linux 2.6 and above UDEV is the auto-discovery device manager and replaces the functionality of both hotplug and hwdetect. See: udev-ArchWiki and udev-Wikipedia
The network configuration files may also be auto created here: /etc/sysconfig/network-scripts/ in the file ifcfg-ethXX