Difference between revisions of "Configuring an alias IP"

From wikieduonline
Jump to navigation Jump to search
(Created page with "=== Linux alias === ifconfig eth0''':0''' 192.168.1.6 up ifconfig eth0:0 eth0:0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.1.6 netmas...")
 
Line 1: Line 1:
=== Linux alias ===
+
== Linux alias ==
 
  ifconfig [[eth]]0''':0''' 192.168.1.6 up
 
  ifconfig [[eth]]0''':0''' 192.168.1.6 up
  

Revision as of 13:06, 10 March 2021

Linux alias

ifconfig eth0: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 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


ifconfig eth# up or ip link set eth0 up


See also

Advertising: