Difference between revisions of "Ifconfig"
(→See also: * <code>docker inspect CONTAINER_NAME | grep IPAddress</code>) |
|||
Line 2: | Line 2: | ||
− | In [[macOS]], the <code>ifconfig</code> command functions as a [[Wrapper pattern|wrapper]] to the IPConfiguration agent, and can control the [[BootP]] and DHCP clients from the command-line. Use of <code>ifconfig</code> to modify network settings in Mac OS X is discouraged, because <code>ifconfig</code> operates below the level of the system frameworks which help manage network configuration. To change network settings in Mac OS X from the command line, use <code>/usr/sbin/ipconfig</code> or <code>/usr/sbin/[[macOS/networksetup|networksetup]]</code>. | + | In [[macOS]], the <code>ifconfig</code> command functions as a [[Wrapper pattern|wrapper]] to the IPConfiguration agent, and can control the [[BootP]] and [[DHCP]] clients from the command-line. Use of <code>ifconfig</code> to modify network settings in Mac OS X is discouraged, because <code>ifconfig</code> operates below the level of the system frameworks which help manage network configuration. To change network settings in Mac OS X from the command line, use <code>/usr/sbin/ipconfig</code> or <code>/usr/sbin/[[macOS/networksetup|networksetup]]</code>. |
<code>ifconfig</code> command is included in the <code>[[net-tools]]</code> package but not installed by default in RHEL since version 7<ref>https://lwn.net/Articles/710533</ref>. | <code>ifconfig</code> command is included in the <code>[[net-tools]]</code> package but not installed by default in RHEL since version 7<ref>https://lwn.net/Articles/710533</ref>. |
Revision as of 08:23, 12 August 2020
ifconfig
is a command in Unix-like operating systems like Linux[1], FreeBSD, OpenBSD, macOS for Ethernet network interface configuration.
In macOS, the ifconfig
command functions as a wrapper to the IPConfiguration agent, and can control the BootP and DHCP clients from the command-line. Use of ifconfig
to modify network settings in Mac OS X is discouraged, because ifconfig
operates below the level of the system frameworks which help manage network configuration. To change network settings in Mac OS X from the command line, use /usr/sbin/ipconfig
or /usr/sbin/networksetup
.
ifconfig
command is included in the net-tools
package but not installed by default in RHEL since version 7[2].
Contents
Configuring an alias IP
Linux alias
ifconfig eth0:0 192.168.1.6 up
macOS alias
Configure 3 alias in en1
interface, https://ss64.com/osx/ifconfig.html:
sudo ifconfig en1 inet 192.168.10.2/24 add sudo ifconfig en1 inet 192.168.20.2/24 add sudo ifconfig en1 inet 192.168.30.2/24 add
or
sudo ifconfig en1 inet 192.168.10.2/24 alias sudo ifconfig en1 inet 192.168.20.2/24 alias sudo ifconfig en1 inet 192.168.30.2/24 alias
Remove/Delete alias:
sudo ifconfig en1 inet 192.168.10.2/24 delete
Activities
- Show interface configuration in Linux including ip addresses:
ifconfig -a
orip a
- Show interface Ethernet network capabilities of your interface, such as speed, with:
mii-tool -v YOUR_INTERFACE_NAME
,mii-tool -v eth0
- Show all network inferfaces in Linux:[3]
- Learn about Linux Naming Schemes Hierarchy.
- Change your MAC address:
ifconfig {eth0|wlan0} hw ether CA:CA:CA:CA:CA:CA
Related terms
docker inspect CONTAINER_NAME | grep IPAddress
See also
ip
[link, route]
,ifconfig
netstat
ss
lsof
ping
ethtool
mii-tool
arping
nmcli
(RHEL)route
networkctl
,netplan
,tc
ipconfig
Windows command- macOS:
networksetup
,ifconfig
,ipconfig [ getifaddr ]
,scutil
- bonding
References
Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy.
Advertising: