Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
02-28-2017, 06:45 AM
|
#1
|
Member
Registered: Mar 2010
Posts: 458
Rep:
|
how to enable eth1 by default on centos 7
Hi Guys,
I have provisioned a Centos 7 machine with vagrant and eth1 inteface is always down when I start the machine.
I bring it up by issuing command
ifup eth1
Is there anyway to bring it up by default? I want eth1 to be up and eth0 to be down when machine boots up.
Thanks
|
|
|
02-28-2017, 07:20 AM
|
#2
|
Senior Member
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375
|
What tools are you using for setting up the device? That would help but The most likely surefire method is to edit onboot to yes in /etc/sysconfig/network-scripts/ifcfg-eth1
|
|
|
03-01-2017, 04:13 AM
|
#4
|
Member
Registered: Mar 2010
Posts: 458
Original Poster
Rep:
|
Code:
[root@192-168-1-51 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
#VAGRANT-BEGIN
# The contents below are automatically generated by Vagrant. Do not modify.
NM_CONTROLLED=no
BOOTPROTO=none
ONBOOT=yes
IPADDR=192.168.1.51
NETMASK=255.255.255.0
DEVICE=eth1
PEERDNS=no
#VAGRANT-END
[root@192-168-1-51 ~]#
No I did not changed anything I just enabled two network interfaces when I saw the machine in Virtual box. The machine was provisioned with vagrant
Still the puzzle is not resolved...
|
|
|
03-01-2017, 03:24 PM
|
#5
|
Moderator
Registered: Mar 2008
Posts: 22,361
|
|
|
|
03-01-2017, 03:29 PM
|
#6
|
Senior Member
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278
|
What does your vagrant file look like?
paste here if it is huge: https://paste.fedoraproject.org/
|
|
|
03-05-2017, 03:51 AM
|
#7
|
Member
Registered: Mar 2010
Posts: 458
Original Poster
Rep:
|
@jefro
ONBOOT=yes for both interfaces.
Vagrantfile
Code:
Vagrant.configure("2") do |o|
o.vm.box="centos/7"
o.vm.network "public_network", ip: "192.168.1.51"
o.vm.provision "shell", :path=>"setup.sh"
end
setup.sh
Code:
yum -y upgrade --exclude kernel*
yum -y install vim git gedit nmap unzip httpd
yum -y install httpd
systemctl restart httpd
Code:
[root@192-168-1-51 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
#VAGRANT-BEGIN
# The contents below are automatically generated by Vagrant. Do not modify.
NM_CONTROLLED=no
BOOTPROTO=none
ONBOOT=yes
IPADDR=192.168.1.51
NETMASK=255.255.255.0
DEVICE=eth1
PEERDNS=no
#VAGRANT-END
[root@192-168-1-51 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
BOOTPROTO="dhcp"
ONBOOT="yes"
TYPE="Ethernet"
PERSISTENT_DHCLIENT="yes"
[root@192-168-1-51 ~]#
|
|
|
03-07-2017, 04:44 PM
|
#8
|
Member
Registered: Mar 2010
Posts: 458
Original Poster
Rep:
|
@ALL,
This is resolved. Supposed to be a bug in Vagrant 1.9.1. Upgraded to 1.9.2 and issue is resolved.
Thank you all for your guidance.
|
|
|
03-07-2017, 05:34 PM
|
#9
|
Moderator
Registered: Mar 2008
Posts: 22,361
|
Thanks for the update and solution.
Wonder what the bug was and the update did?
|
|
1 members found this post helpful.
|
03-22-2017, 04:19 PM
|
#10
|
Member
Registered: Mar 2010
Posts: 458
Original Poster
Rep:
|
@jefro,
Not sure about it.
|
|
|
All times are GMT -5. The time now is 09:13 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|