LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-02-2016, 03:04 PM   #1
end
Member
 
Registered: Aug 2016
Posts: 266

Rep: Reputation: Disabled
how to create virtual interface centos7


hy

i try create another interface in centos7 like this but after restart network or pc nothing appiers in ip addr config.

cd /etc/sysconfig/network-scripts
cp ifcfg-enp2s0 ifcfg-enp2s0:1
nano ifcfg-enp2s0:1

Code:
DEVICE="enp2s0:1"
ONBOOT="yes"
TYPE="Ethernet"
BOOTPROTO=static
BROADCAST=192.168.2.255
IPADDR=192.168.28.2
NETMASK=255.255.255.0
NETWORK=192.168.2.0
ONBOOT=yes
TYPE=Ethernet
nano-ifcfg-enp2s0

Code:
TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
PEERDNS=yes
PEERROUTES=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=enp2s0
UUID=8cadca8d-9d24-4f63-940d-1b9819009aaa
DEVICE=enp2s0
ONBOOT=no
ifup enp2s0:1

Could not load file /etc/sysconfig/network/scripts/ifcfg-enp2s0:1

Last edited by end; 10-03-2016 at 08:59 AM. Reason: update
 
Old 10-03-2016, 08:57 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,481

Rep: Reputation: 5838Reputation: 5838Reputation: 5838Reputation: 5838Reputation: 5838Reputation: 5838Reputation: 5838Reputation: 5838Reputation: 5838Reputation: 5838Reputation: 5838
Adding an alias does not work the same as version 6. The easiest way to add an alias is via the network manager text user interface nmtui. Check out the following link to add an IP address. Be sure to restart the interface by using ipdown / ifup enp2s0.

https://ma.ttias.be/how-to-add-secon...rhel-centos-7/

Be sure to delete the ifcfg-enp2s0:1 configuration previously create. It does not work with network manager.
 
1 members found this post helpful.
Old 10-03-2016, 09:03 AM   #3
end
Member
 
Registered: Aug 2016
Posts: 266

Original Poster
Rep: Reputation: Disabled
re

thanks for replay.

if i remove network manager can this config works
 
Old 10-03-2016, 09:10 AM   #4
end
Member
 
Registered: Aug 2016
Posts: 266

Original Poster
Rep: Reputation: Disabled
re

i read a link you post. thanks everything is explained.
 
Old 10-03-2016, 09:14 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,481

Rep: Reputation: 5838Reputation: 5838Reputation: 5838Reputation: 5838Reputation: 5838Reputation: 5838Reputation: 5838Reputation: 5838Reputation: 5838Reputation: 5838Reputation: 5838
It should work if you add NM_CONTROLLED="no"
 
1 members found this post helpful.
Old 10-03-2016, 09:18 AM   #6
end
Member
 
Registered: Aug 2016
Posts: 266

Original Poster
Rep: Reputation: Disabled
re

tray add NM_CONTROLLED="no" worked
try removed networkmanager worked

very thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you wake up CentOS7 from suspend mode in Virtual Box? fanoflq Linux - Newbie 9 05-03-2016 03:57 PM
[SOLVED] Create a Switched Virtual Interface in debian jimbo1954 Linux - Networking 3 07-14-2014 08:43 AM
Cannot create an IPv6 virtual IP (alias interface) using ioctl(SIOCSIFADDR) the_rock Linux - Newbie 2 08-20-2010 05:14 PM
Create routing between virtual interface in linux attojung Linux - Networking 2 03-13-2009 02:06 PM
How to create a virtual interface? Whyte Linux - Networking 2 03-27-2007 02:07 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 01:03 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration