LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 03-17-2015, 08:42 PM   #1
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,157

Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Cool CentOS DHCP Interface


hi guys, i got centos on a VM and I set the VM to have two NICs.

1ST NIC static - ifcfg-eth0

2ND NIC DHCP - ifcfg-eth4

My question is why i'm not able to find ifcfg-eth4 on /etc/sysconfig/network-scripts/ directory?

ifcfg-eth4 works fine and it has an IP Address.

If i type ifconfig-a it is shown but just can't find the configuration file on /etc/sysconfig/network-scripts/

only ifcfg-eth0 is there.

Does it mean that I need to create the file manually on /etc/sysconfig/network-scripts/ ?

Thank you.
 
Old 03-17-2015, 08:48 PM   #2
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
Which version on CentOS you are running on. Also, do you have NetworkManager running. Files under /etc/sysconfig/network-scripts/<files> are usually used for manual / expert configuration. NetworkManager is legacy. If you don't have a file you can create one. Or, I would suggest just launch NetworkManager and see if you are able to see settings for eth4 and what is the name NetworkManager showing there? Just toggle something in network manager and save. See if it creates the file.

Incase it does not create the file yes create the file manually.
 
1 members found this post helpful.
Old 03-17-2015, 09:24 PM   #3
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,157

Original Poster
Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
hi T3RMINVTOR, thanks for your reply. I'm just trying to understand more this Linux stuff since i'm busy with it.

If this project is over then don't have time anymore to mess up with it.

It's CentOS 6.5, Network Manager also not showing there.

Anyway it is working fine, I'm just wandering why it's not showing in sysconfig/network-scripts directory.

But on /sys/class/net it shows up there.


Thanks.
 
Old 03-17-2015, 09:38 PM   #4
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
You're welcome. Yes, it is good to play around before the things goes in production ;-)

What do you mean when you say you cannot see it in NetworkManager. Are you trying to say that the device itself doesn't showup in NetworkManager?
 
Old 03-17-2015, 09:50 PM   #5
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,157

Original Poster
Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Yes it doesn't showup in NetworkManager.

In NetworkManager it shows System Eth0 - which corresponds to ifcfg-eth0

There is another one: Auto Ethernet but Last Used shows "never", so I guess that's not referring to Eth4 (ifcfg-eth4)

by right the Eth4 should shows up in NetworkManager?

Eth4 is a wired connection.
 
Old 03-17-2015, 09:54 PM   #6
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
Quite interesting and it appears to be that Auto Eth is the one pointing to eth4 it is just that the name is not correct it is not able to reflect the status / state.

Alright, as you said eth4 is a wired connection and assuming that you are logged in GUI you will see network icon for your ethernet somewhere in the system tray. Right click on it and click on edit connection and see where does it take you to.
 
Old 03-18-2015, 01:17 AM   #7
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,157

Original Poster
Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Cool

Quote:
Originally Posted by T3RM1NVT0R View Post
Quite interesting and it appears to be that Auto Eth is the one pointing to eth4 it is just that the name is not correct it is not able to reflect the status / state.

Alright, as you said eth4 is a wired connection and assuming that you are logged in GUI you will see network icon for your ethernet somewhere in the system tray. Right click on it and click on edit connection and see where does it take you to.
If I do it takes me to the screen where I can see System Eth0 and Auto Eth. Where i can set the interface to static or dhcp.
 
Old 03-18-2015, 01:25 AM   #8
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
On that screen itself, if you will select eth0 and click on edit / configure it will allow you to edit that. Same goes for Auto eth which I still suspect is pointing to eth4.
 
Old 03-18-2015, 01:35 AM   #9
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,157

Original Poster
Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Quote:
Originally Posted by T3RM1NVT0R View Post
On that screen itself, if you will select eth0 and click on edit / configure it will allow you to edit that. Same goes for Auto eth which I still suspect is pointing to eth4.
I agree with you Auto Eth could be pointing to Eth4 but what is interesting is that it shows "Last Used" "never".

Eth4 is currently used and is holding a DHCP IP and able to ping or browse on that subnet.
 
Old 03-18-2015, 01:45 AM   #10
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
Did you try changing Auto Eth to eth4 and see if it still shows as not in use? Did you try toggling the settings in NetworkManager? Did you see any file getting created?

What is the output of route -n, interested in the device name it shows in the output.
 
Old 03-18-2015, 02:28 AM   #11
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,157

Original Poster
Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
route -n shows

eth3 and eth4

I think eth3 is being used by eth0

If i run system-config-network it only shows eth0 (no other device)

Toggling Settings in Network Manager will have some file created on sys-config/network-scripts directory

=============

I'm actually messing up also with /etc/rc.d/rc.local

because eth0 is static IP(192.168.1.x subnet) and eth4 is DHCP with 192.168.2.x subnet.

I notice that when the system boots up it only connects to the eth0 or the static IP network

but when I run dhclient -v from a terminal line eth4 shows up and able to receive DHCP IP

so I give a shot to edit rc.local and put in the command dhclient -v and there it goes both networks are fine every time I login

But I guess its not connected at boot time or during some initialization process .

I don't know at what stage is rc.local being processed.

But what I want is to get the network ready when I login to the VM.

Thanks...

Last edited by JJJCR; 03-18-2015 at 02:32 AM. Reason: edit
 
Old 03-18-2015, 02:42 AM   #12
T3RM1NVT0R
Senior Member
 
Registered: Dec 2010
Location: Internet
Distribution: Linux Mint, SLES, CentOS, Red Hat
Posts: 2,385

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
Instead of putting dhclient in /etc/rc.d/rc.local you can create the ifcfg-eth4 file as follows:

Code:
DEVICE=eth4
BOOTPROTO=dhcp
ONBOOT=yes
IPV6INIT=no
USERCTL=yes
 
1 members found this post helpful.
Old 03-18-2015, 03:01 AM   #13
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,157

Original Poster
Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
Cool

Quote:
Originally Posted by T3RM1NVT0R View Post
Instead of putting dhclient in /etc/rc.d/rc.local you can create the ifcfg-eth4 file as follows:

Code:
DEVICE=eth4
BOOTPROTO=dhcp
ONBOOT=yes
IPV6INIT=no
USERCTL=yes
Thanks i'll give it a shot.
 
Old 03-18-2015, 03:28 AM   #14
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,157

Original Poster
Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
i had try manually creating ifcfg-eth4 and set the settings but eth4 doesn't show up unless i type dhclient -v

Thanks.
 
Old 03-18-2015, 03:50 AM   #15
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 2,157

Original Poster
Rep: Reputation: 449Reputation: 449Reputation: 449Reputation: 449Reputation: 449
this is the ip addr show configuration:

[vmx@xvmm01 ~]$ ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:17:5c:7d:13:ee brd ff:ff:ff:ff:ff:ff
inet 192.168.1.24/24 brd 192.168.1.255 scope global eth3
valid_lft forever preferred_lft forever
3: eth4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 00:17:7d:7d:1a:21 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.24/24 brd 192.168.1.255 scope global eth4
inet 192.168.2.120/24 brd 192.168.2.255 scope global eth4
valid_lft forever preferred_lft forever

why eth4 shows two IPs?

Thanks.
 
  


Reply

Tags
centos, networking



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
DHCP on wired interface only sometimes working, always working on wireless interface PasBern Linux - Networking 5 06-26-2014 02:36 PM
Create a sub interface with dhcp custangro Linux - Networking 9 04-26-2010 05:06 PM
ATT Uverse DHCP Not Assigning to Red Interface Interface on Smoothwall barleykorn Linux - Networking 2 02-14-2010 05:12 PM
DHCP on CentOS 4.7 - /var/lib/dhcp/dhcpd.leases: Permission denied Latitude Linux - Networking 1 06-05-2009 02:08 AM
interface ok, dhcp ok, routing gw not ok- help sokar Linux - Wireless Networking 4 02-04-2004 10:39 AM

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

All times are GMT -5. The time now is 09:07 AM.

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