Configure and view network interface conditions using the Ifconfig command
Example 1: Configure eth0 IP and activate the device at the same time:
# ifconfig eth0 192.168.4.1 netmask 255.255.255.0 up
Example 2: Configure IP for the eth0 alias device eth0:1 and add routes
# ifconfig Eth0:1 192.168.4.2
# route add–host 192.168.4.2 Dev eth0:1
Example 3: Activating (disabling) a device
# ifconfig eth0:1 up (down)
Example 4: View all (specified) network interface configurations
# ifconfig (eth0)
==================================================================================
Function Description: Displays or sets the network device.
Syntax: ifconfig [network device][down up-allmulti-arp-promisc][add< address >][del< address >][
Supplemental Note: Ifconfig can set the status of a network device, or display the current settings.
Parameters
add< address > Set the IP address of the network device IPV6.
del< address > Remove the IP address of the network device IPV6.
Down closes the specified network device.
IO_ADDR<I/O address > Set the I/O address of the network device.
IRQ<IRQ address > Set IRQ for network devices.
media< network Media type > Set the media type of the network device.
mem_start< memory address > Set the starting address that the network device occupies in the main memory.
Number of metric< > Specifies the number to be added when calculating the number of packets transferred.
mtu< bytes > Sets the MTU of the network device.
netmask< Subnet mask > Set subnet mask for network devices.
tunnel< address > Establish a tunnel communication address between IPV4 and IPV6.
Up starts the specified network device.
-broadcast< address > Packets that will be sent to the specified address are treated as broadcast packets.
-pointopoint< address > establishes a direct connection with the network device at the specified address, which has a confidential function.
-promisc to turn off or start the promiscuous mode for the specified network device.
[IP Address] Specifies the IP address of the network device.
[Network Device] Specifies the name of the network device.