Editing Ifconfig
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 7: | Line 7: | ||
<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>. | ||
− | == | + | == Configuring an alias IP == |
+ | === Linux alias === | ||
+ | ifconfig [[eth]]0''':0''' 192.168.1.6 up | ||
+ | |||
+ | ifconfig eth0:0 | ||
+ | eth0:0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 | ||
+ | inet 192.168.1.6 netmask 255.255.255.0 broadcast 192.168.1.255 | ||
+ | ether 33:54:00:7d:35:22 txqueuelen 1000 (Ethernet) | ||
+ | |||
+ | === [[macOS]] [[alias]] === | ||
+ | Configure 3 alias in <code>en1</code> interface, https://ss64.com/osx/ifconfig.html: | ||
+ | <pre> | ||
+ | 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 | ||
+ | </pre> | ||
+ | or | ||
+ | <pre> | ||
+ | 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 | ||
+ | </pre> | ||
+ | |||
+ | |||
+ | Remove/delete alias: | ||
+ | sudo ifconfig en1 inet 192.168.10.2/24 delete | ||
+ | |||
+ | |||
+ | |||
+ | ifconfig eth# up or [[ip link]] set eth0 up | ||
== Activities == | == Activities == |
Advertising: