LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   Adding Network Interface alias from command line (https://www.linuxquestions.org/questions/fedora-35/adding-network-interface-alias-from-command-line-331643/)

WireLine 06-08-2005 03:57 PM

Adding Network Interface alias from command line
 
How do I add a network alias interface from the command line? With system-config-network I can just click new and have a virtual interface added but how can I do it from the command line? This is a fedora core 3 box.

mhallbiai 06-08-2005 10:49 PM

Code:

ifconfig eth0:2 192.168.0.1 netmask 255.255.255.0 broadcast 192.168.0.255 up
ifconfig eth0:3 192.168.12.1 netmask 255.255.255.0 broadcast 192.168.12.255 up
ifconfig eth0:254 10.0.0.1 netmask 255.0.0.0 broadcast 10.255.255.255 up

i am sure you can get the idea from that.

if you want them to be permanent (persist through reboots, network service restarts, etc) you can create the file with appropriate information
located in /etc/sysconfig/network-scripts

to get a start use the ifcfg-eth0 file. cp ifcfg-eth0 ifcfg-eth0:1 and then edit it appropriately being sure to change DEVICE=eth0 to DEVICE=eth0:1



hope this helps

WireLine 06-08-2005 11:08 PM

I got it figured out. Thanks!


All times are GMT -5. The time now is 10:03 AM.