Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Question about linux networking


  • Please log in to reply
24 replies to this topic

#1 TheJokerz

TheJokerz

  • Members
  • 286 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Ohio
  • Local time:06:33 PM

Posted 07 August 2015 - 02:57 PM

Hello,

 

My question is this.  I am currently in a class right now where I am setting up a Centos server, and they had me disable the internet mirriors by moving the config files with this command

 

mv /etc/yum.repos.d/*repo ~

 

Ever sense then I cannot connect to the internet, my "eth0" is no longer there when I check my connections to connect to.  Oh before I forget this is on a VMware.  Now my question is how exactly do I get the yum.repos.d back to its original location(assuming that is the file that I need in order to connect)?

 

I hope this all makes sense to someone because I am lost and need my connection back in order to be able to proceed in the class.  I have to download the NFS and configure that as well and cannot because I do not have a connection.  

 

Thanks in advance.

 

Stephen


utl8q0-5.png


BC AdBot (Login to Remove)

 


#2 DeimosChaos

DeimosChaos

  • BC Advisor
  • 1,420 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:United States, Delaware
  • Local time:06:33 PM

Posted 07 August 2015 - 03:02 PM

So it looks like you moved the repos to your home directory... You should just be able to do the reverse of what you did and put them back. Something like this possibly...

cp ~*repo /etc/yum.repos.d/

You can do a "mv" if you wish. I like to do a copy to cover the just in case.

Kind of weird that it killed your internet connection... that doesn't make any sense to me. If you moved the repos out then it should have just affected doing any yum install commands. I'll have to look in to that one.

 

*Edit

 

I feel like that is bad form to move those as well.. if you wanted to disable them I would have renamed them to a ".disabled" or something like that. Not sure why they wanted you to move them, seems weird to me.


Edited by DeimosChaos, 07 August 2015 - 03:05 PM.

OS - Ubuntu 14.04/16.04 & Windows 10
Custom Desktop PC / Lenovo Y580 / Sager NP8258 / Dell XPS 13 (9350)
_____________________________________________________
Bachelor of Science in Computing Security from Drexel University
Security +


#3 TheJokerz

TheJokerz
  • Topic Starter

  • Members
  • 286 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Ohio
  • Local time:06:33 PM

Posted 07 August 2015 - 03:09 PM

I do not get it either why they wanted me to do that, esp sense they did not instruct on how to reverse what I did...  But I will give that a try!

 

Thanks for the quick response!


utl8q0-5.png


#4 DeimosChaos

DeimosChaos

  • BC Advisor
  • 1,420 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:United States, Delaware
  • Local time:06:33 PM

Posted 07 August 2015 - 03:11 PM

What version of centOS are you running? I kind of want to see if I can recreate this problem. It is an interesting one.


OS - Ubuntu 14.04/16.04 & Windows 10
Custom Desktop PC / Lenovo Y580 / Sager NP8258 / Dell XPS 13 (9350)
_____________________________________________________
Bachelor of Science in Computing Security from Drexel University
Security +


#5 TheJokerz

TheJokerz
  • Topic Starter

  • Members
  • 286 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Ohio
  • Local time:06:33 PM

Posted 07 August 2015 - 03:12 PM

Version 6.6 (final)


Edited by TheJokerz, 07 August 2015 - 03:12 PM.

utl8q0-5.png


#6 DeimosChaos

DeimosChaos

  • BC Advisor
  • 1,420 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:United States, Delaware
  • Local time:06:33 PM

Posted 07 August 2015 - 03:12 PM

Also, if the "~*repo" doesn't work you may want to just put the full path to your home directory instead.

cp /home/thejokerz/*repo /etc/yum.repos.d/

OS - Ubuntu 14.04/16.04 & Windows 10
Custom Desktop PC / Lenovo Y580 / Sager NP8258 / Dell XPS 13 (9350)
_____________________________________________________
Bachelor of Science in Computing Security from Drexel University
Security +


#7 TheJokerz

TheJokerz
  • Topic Starter

  • Members
  • 286 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Ohio
  • Local time:06:33 PM

Posted 07 August 2015 - 03:18 PM

hmm maybe it is something different it is saying no such file or directory exists '*repo'


Is there a way to reconfigure eth0?


utl8q0-5.png


#8 DeimosChaos

DeimosChaos

  • BC Advisor
  • 1,420 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:United States, Delaware
  • Local time:06:33 PM

Posted 07 August 2015 - 03:24 PM

can you post the contents of your /home/thejokerz directory? 

ls /home/thejokerz

Obviously "thejokerz" would be your actual username.

 

If it isn't finding eth0 it may be kind of hard to reconfigure it. I'll look more into it when I get home from work,


OS - Ubuntu 14.04/16.04 & Windows 10
Custom Desktop PC / Lenovo Y580 / Sager NP8258 / Dell XPS 13 (9350)
_____________________________________________________
Bachelor of Science in Computing Security from Drexel University
Security +


#9 TheJokerz

TheJokerz
  • Topic Starter

  • Members
  • 286 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Ohio
  • Local time:06:33 PM

Posted 07 August 2015 - 03:29 PM

Sorry on two different computers here, I am also at work and the VM is on my personal laptop.

 

but all the files and folders are as follows in /home/swyant

Desktop,Documents, Downloads, memo.one, memo.two, memo.three, Music, Pictures, practice.txt, Public, report.feb, report.jan, report.mar, Templates, Unit2, Videos


utl8q0-5.png


#10 mremski

mremski

  • Members
  • 493 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:NH
  • Local time:06:33 PM

Posted 08 August 2015 - 03:55 AM

The construct "~*repo" is incorrect.  I'm guessing it gives an error along the lines of "unknown user *repo"

It should be "~/*repo"  the tilde is shorthand for "home directory for this user".

The original mv command, did you execute that as root?  if so, the files are in root's home directory and you should be su'd to root or logged in as root to cp them back to etc.

 

You say this is vmware, what is the host running?  Simply moving the yum repo files out of the way should not have any effect on eth0.   In the VM, what is the output of /sbin/ifconfig -a?  Then we'll be able to see if the link is physically up.

 

Don't forget that from the VM to the "internet" is not a straight road.  It is a maze of twisty passages all alike (apologies to the Wumpus).  The VM network connection is likely bridged to a NIC on the host, from the host NIC it hits say a router, a cable modem, the ISPs servers/gateways, etc.  All this leads one down the path of "routing tables".  Which leads us to ask:

What is the output of the command "netstat -rn"?

We are specifically looking for the default route.  It may be pointing to a gw that does not exist on your home network.


FreeBSD since 3.3, only time I touch Windows is to fix my wife's computer


#11 TheJokerz

TheJokerz
  • Topic Starter

  • Members
  • 286 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Ohio
  • Local time:06:33 PM

Posted 08 August 2015 - 08:51 AM

The construct "~*repo" is incorrect.  I'm guessing it gives an error along the lines of "unknown user *repo"

It should be "~/*repo"  the tilde is shorthand for "home directory for this user".

The original mv command, did you execute that as root?  if so, the files are in root's home directory and you should be su'd to root or logged in as root to cp them back to etc.

 

You say this is vmware, what is the host running?  Simply moving the yum repo files out of the way should not have any effect on eth0.   In the VM, what is the output of /sbin/ifconfig -a?  Then we'll be able to see if the link is physically up.

 

Don't forget that from the VM to the "internet" is not a straight road.  It is a maze of twisty passages all alike (apologies to the Wumpus).  The VM network connection is likely bridged to a NIC on the host, from the host NIC it hits say a router, a cable modem, the ISPs servers/gateways, etc.  All this leads one down the path of "routing tables".  Which leads us to ask:

What is the output of the command "netstat -rn"?

We are specifically looking for the default route.  It may be pointing to a gw that does not exist on your home network.

Here is the result of /sbin/ifconfig -a and netstat -rm

 

Centos_zpsvkkdl1hk.jpg

 

And I am running windows 10 on the host machine

 

Thanks

 

I also think this is work noting that when I set up this VM i was running windows 8


Edited by TheJokerz, 08 August 2015 - 08:57 AM.

utl8q0-5.png


#12 DeimosChaos

DeimosChaos

  • BC Advisor
  • 1,420 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:United States, Delaware
  • Local time:06:33 PM

Posted 08 August 2015 - 12:15 PM

The construct "~*repo" is incorrect.  I'm guessing it gives an error along the lines of "unknown user *repo"

It should be "~/*repo"  the tilde is shorthand for "home directory for this user".

The original mv command, did you execute that as root?  if so, the files are in root's home directory and you should be su'd to root or logged in as root to cp them back to etc.

 

You say this is vmware, what is the host running?  Simply moving the yum repo files out of the way should not have any effect on eth0.   In the VM, what is the output of /sbin/ifconfig -a?  Then we'll be able to see if the link is physically up.

 

Don't forget that from the VM to the "internet" is not a straight road.  It is a maze of twisty passages all alike (apologies to the Wumpus).  The VM network connection is likely bridged to a NIC on the host, from the host NIC it hits say a router, a cable modem, the ISPs servers/gateways, etc.  All this leads one down the path of "routing tables".  Which leads us to ask:

What is the output of the command "netstat -rn"?

We are specifically looking for the default route.  It may be pointing to a gw that does not exist on your home network.

Thanks for the correction mremski... I kind of thought that it needed the / in there... but wasn't entirely sure, that's why I suggested the full path after the fact. Good point on if he moved it via root though...

 

Looking at your ifconfig TheJokerz... it isn't giving any kind of IP address whatsoever, but your eth0 is there... so it isn't that it is not picking up the eth0. Look in your Network Configurations on W10 (sorry, no idea how to do this... I have 8.1, and currently am on Ubuntu) and make sure there is a vmware Ethernet adapter there. If there isn't that may be the problem. Also make sure it is configured properly to your gateway... etc etc. A reinstall of vmware may help solve the issue, reinstalling that shouldn't get rid of your Linux VM, or it may ask to keep those kind of things in the uninstall of VMware.


OS - Ubuntu 14.04/16.04 & Windows 10
Custom Desktop PC / Lenovo Y580 / Sager NP8258 / Dell XPS 13 (9350)
_____________________________________________________
Bachelor of Science in Computing Security from Drexel University
Security +


#13 mremski

mremski

  • Members
  • 493 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:NH
  • Local time:06:33 PM

Posted 08 August 2015 - 01:56 PM

Ok, so the ifconfig output shows that eth0 has no IP address or configuration.  Centos (going by memory), should have  network configuration in /etc/sysconfig/network-scripts (maybe no "-"), look for a file like "ifcfg-eth0".

 

A quick thing to try is do the following as root:

 

ifup eth0

 

let us see the output plus the contents of /etc/sysconfig/network-scripts/ifcfg.eth0  

 

If the config file says "dhcp" in it, and you don't have a DHCP server to give it an address, you will get exactly what you showed us in the ifconfig and netstat -rn commands.

 

I'm assuming that you can get to the internet from the host, just not the VM?

 

Are you sure that asking us for help here isn't "cheating" according to the class rules?  ;)

 

mike


FreeBSD since 3.3, only time I touch Windows is to fix my wife's computer


#14 TheJokerz

TheJokerz
  • Topic Starter

  • Members
  • 286 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:Ohio
  • Local time:06:33 PM

Posted 08 August 2015 - 02:21 PM

There does not seem to be any ifcfg.eth0 maybe that is part of the problem?

 

centos1_zpseisohjow.jpg


utl8q0-5.png


#15 mremski

mremski

  • Members
  • 493 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:NH
  • Local time:06:33 PM

Posted 08 August 2015 - 05:04 PM

That may be a clue.  I think there's a "network manager" type of thing somewhere that should allow you to define/setup interfaces.  Probably up under the System menu.


FreeBSD since 3.3, only time I touch Windows is to fix my wife's computer





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users