Unix Power ToolsUnix Power ToolsSearch this book

44.8. Network Devices -- ifconfig

ifconfig is used to configure network devices such as Ethernet cards. While booting, the kernel will find a device driver for the actual device, but it will still need to be assigned an IP address, and any protocol options need to be configured. Various platforms have different ways to store this configuration information, but most use ifconfig somewhere in the startup scripts to do the actual work.

The primary use of ifconfig is to set up a network device to use a particular IP address. ifconfig can also be used to set network options and aliases. To bring up an interface (in this case, rl0) on 192.168.1.1 with normal settings for a /24 network:

# ifconfig rl0 inet 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255 up

To temporarily bring a network interface down and then back up later, something that can be useful for maintenance:

# ifconfig rl0 down
# ...maintenance operations...
# ifconfig rl0 up

-- DJPH



Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.