Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Bash not recognizing net-setup eth0
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
Tgentoo
n00b
n00b


Joined: 21 Sep 2013
Posts: 7
Location: Mauritius

PostPosted: Sun Oct 06, 2013 5:20 pm    Post subject: Bash not recognizing net-setup eth0 Reply with quote

Hi Gentoo community,

I have just installed Gentoo on Virtual Box and I am not able to connect to the Internet through bash.
When doing an ifconfig, it simply shows the description for lo and not eth0.
When I tried doing net-setup eth0, I get the error: net-setup: command not found.

My worry is how do I update portage now if I cannot setup connection to the Internet.
dhcp command does not work either. And the worse, I cannot use mouse inside the VM to highlight any text.

Please guide how can I get connected using eth0 to obtain connection.
Back to top
View user's profile Send private message
Jaglover
Advocate
Advocate


Joined: 29 May 2005
Posts: 4563
Location: Saint Amant, Acadiana

PostPosted: Sun Oct 06, 2013 5:51 pm    Post subject: Reply with quote

ifconfig -a will show all devices.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
Logicien
l33t
l33t


Joined: 16 Sep 2005
Posts: 742
Location: Montréal

PostPosted: Sun Oct 06, 2013 5:53 pm    Post subject: Reply with quote

Hi,
in the configuration of the in use VirtualBox machine, did you create and activate an Ethernet network card? What is the access mode of the card? Only NAT allow automatic DHCP client request.

If you do
Code:
ifconfig -a

or
Code:
ip link show

do you see something related to an Ethernet network card? The card must be up and running
Code:
ifconfig eth0 up

or
Code:
ip link set dev eth0 up

to do
Code:
dhclient -v eth0

or
Code:
dhcpcd eth0

or what else than eth0 the card name can be.
_________________
Paul
Back to top
View user's profile Send private message
Jaglover
Advocate
Advocate


Joined: 29 May 2005
Posts: 4563
Location: Saint Amant, Acadiana

PostPosted: Sun Oct 06, 2013 5:57 pm    Post subject: Reply with quote

Why DHCP won't work in bridge mode? :?
Anyway, to use a DHCP client it must be installed beforehand.
Otherwise set up your network manually, as described in Handbook.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
Logicien
l33t
l33t


Joined: 16 Sep 2005
Posts: 742
Location: Montréal

PostPosted: Sun Oct 06, 2013 6:09 pm    Post subject: Reply with quote

I think a DHCP client is include in the stage3. Gentoo could have done a DHCP request on a network device.

So have a look at the output of the
Code:
route -een

or
Code:
ip route show

after the boot is finish. If the card have an IP address and there's a default route, it should work without the administrator to do it.
_________________
Paul
Back to top
View user's profile Send private message
Tgentoo
n00b
n00b


Joined: 21 Sep 2013
Posts: 7
Location: Mauritius

PostPosted: Sun Oct 06, 2013 6:16 pm    Post subject: Reply with quote

Logicien wrote:
Hi,
in the configuration of the in use VirtualBox machine, did you create and activate an Ethernet network card? What is the access mode of the card? Only NAT allow automatic DHCP client request.

If you do
Code:
ifconfig -a

or
Code:
ip link show

do you see something related to an Ethernet network card? The card must be up and running
Code:
ifconfig eth0 up

or
Code:
ip link set dev eth0 up

to do
Code:
dhclient -v eth0

or
Code:
dhcpcd eth0

or what else than eth0 the card name can be.


I tried ifconfig -a
And it actually shows up enp0s3 with further description of the Ethernet.
But still, ping is not working, I get the following error:
ping: unknown host www.gentoo.org
Back to top
View user's profile Send private message
Logicien
l33t
l33t


Joined: 16 Sep 2005
Posts: 742
Location: Montréal

PostPosted: Sun Oct 06, 2013 8:40 pm    Post subject: Reply with quote

Before you try anything, check if the card have been configure properly, do
Code:
ip route list
cat /etc/resolv.conf

The first command should give you the IP address of enp0s3 and the default route. The second one should show the IP addresses of the DNS nameservers. If something is missing it's because no DHCP request have been done on the card or something fail.

From there you can check if some DHCP client are active in background
Code:
ps aux| grep -i -e dh -e pump -e wpa

Kill them and restart like this
Code:
ifconfig enp0s3 up
dhclient -v enp0s3
or dhcpcd enp0s3

Those commands will tel you if the DHCP request succeed or fail. Have a look again to
Code:
ip route list
cat /etc/resolv.conf

You can try to automate the process at boot time
Code:
cd /etc/init.d
ln -s net.lo net.enp0s3
rc-update add net.enp0s3 default

Is the DHCP server on the other side of the enp0s3 link work properly? So it's VirtualBox. I repeat that the access method must be NAT in the network card configuration of the machine.
_________________
Paul


Last edited by Logicien on Sun Oct 06, 2013 8:57 pm; edited 7 times in total
Back to top
View user's profile Send private message
Hu
Watchman
Watchman


Joined: 06 Mar 2007
Posts: 8600

PostPosted: Sun Oct 06, 2013 8:44 pm    Post subject: Reply with quote

Jaglover wrote:
Why DHCP won't work in bridge mode? :?
I suspect the point Logicien was trying to make is that VirtualBox will provide a DHCP server for you when using NAT mode, but that in bridged mode, you must have a separate DHCP server available to serve the virtual machine.
Tgentoo wrote:
I tried ifconfig -a
And it actually shows up enp0s3 with further description of the Ethernet.
But still, ping is not working, I get the following error:
ping: unknown host www.gentoo.org
You have been tripped up by a udev misfeature that automatically renames network interfaces by default, on the assumption you have enough of them that you cannot otherwise keep straight which card is eth0, eth1, etc. Either disable udev name mangling or adjust your net scripts to use the name udev picked for you.
Back to top
View user's profile Send private message
666threesixes666
Veteran
Veteran


Joined: 31 May 2011
Posts: 1223
Location: 42.68n 85.41w

PostPosted: Sun Oct 06, 2013 9:06 pm    Post subject: Reply with quote

file bug reports against handbook documentation. the commands should be changed around to find predictable names, and insert them into netsetup.
_________________
cat /etc/*-release
Funtoo Linux - baselayout 2.2.0
consider this warning no. 1
http://ecx.images-amazon.com/images/I/81Ku-vxIb3L._SL1500_.jpg
http://wiki.gentoo.org/wiki/Special:Contributions/666threesixes666
Back to top
View user's profile Send private message
Jaglover
Advocate
Advocate


Joined: 29 May 2005
Posts: 4563
Location: Saint Amant, Acadiana

PostPosted: Sun Oct 06, 2013 10:02 pm    Post subject: Reply with quote

I suspect net-setup is a script on Gentoo install media, it is not part of your install. (I've never used Gentoo install media's so can't tell for sure.)
Also I'm not sure if there is a DHCP client in stage-3 or not.
Anyway, if this is a typical home LAN then you can just grab an IP address (make sure it is not used by another node first if in bridge mode), set up routes and your network will be up to carry on with Gentoo install.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
Logicien
l33t
l33t


Joined: 16 Sep 2005
Posts: 742
Location: Montréal

PostPosted: Sun Oct 06, 2013 11:46 pm    Post subject: Reply with quote

Tgentoo,
after have read again your first message, I want to be sure of some things. Have you just boot a Gentoo livecd in a VirtualBox machine or you are in Gentoo after the installation and try to connect to Internet ? You said Gentoo is already installed in VirtualBox.

I just boot the install-amd64-minimal-20130816.iso (195,00 Mio) in VirtualBox. I have the net-setup command and the enp0s3 wire Ethernet card. The DHCP client is dhcpcd (and not dhcp).

I do not have the net-setup command in Gentoo after the installation. You need other means to connect to internet like I show you bebore.

For the mouse copy and paste in text mode, you need Gpm. If it is installed
Code:
rc-service gpm start

should give you a square as pointer that allow you to copy and paste. In the livecd, it is already started after you get the Bash prompt.
_________________
Paul


Last edited by Logicien on Sun Oct 06, 2013 11:53 pm; edited 1 time in total
Back to top
View user's profile Send private message
666threesixes666
Veteran
Veteran


Joined: 31 May 2011
Posts: 1223
Location: 42.68n 85.41w

PostPosted: Sun Oct 06, 2013 11:53 pm    Post subject: Reply with quote

net-setup pulls dhcp ip subnet mask default gateway & sets routes jaglover. it is install media only, later down the line handbook suggests installing a dhcp client before rebooting.
_________________
cat /etc/*-release
Funtoo Linux - baselayout 2.2.0
consider this warning no. 1
http://ecx.images-amazon.com/images/I/81Ku-vxIb3L._SL1500_.jpg
http://wiki.gentoo.org/wiki/Special:Contributions/666threesixes666
Back to top
View user's profile Send private message
Jaglover
Advocate
Advocate


Joined: 29 May 2005
Posts: 4563
Location: Saint Amant, Acadiana

PostPosted: Sun Oct 06, 2013 11:54 pm    Post subject: Reply with quote

You can boot with CD and do lots of other things but why?
Jaglover wrote:
Otherwise set up your network manually, as described in Handbook.


I think running two commands and setting nameserver is less trouble than booting from CD and chrooting?
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
666threesixes666
Veteran
Veteran


Joined: 31 May 2011
Posts: 1223
Location: 42.68n 85.41w

PostPosted: Mon Oct 07, 2013 12:24 am    Post subject: Reply with quote

heh i use alternate install to completely avoid all of this noise. if sysrescue uses network manager its as easy as booting and pointing @ your network, then entering wifi password... gentoo install media is pretty much wire only. networkmanager is less steps for wired. i use ubuntus, fedora live media would probably work also though i don't know the firmware support on it, where i know ubuntu live media firmware supports tons of cards.
_________________
cat /etc/*-release
Funtoo Linux - baselayout 2.2.0
consider this warning no. 1
http://ecx.images-amazon.com/images/I/81Ku-vxIb3L._SL1500_.jpg
http://wiki.gentoo.org/wiki/Special:Contributions/666threesixes666
Back to top
View user's profile Send private message
Tgentoo
n00b
n00b


Joined: 21 Sep 2013
Posts: 7
Location: Mauritius

PostPosted: Mon Oct 07, 2013 6:10 pm    Post subject: Reply with quote

Logicien wrote:
Before you try anything, check if the card have been configure properly, do
Code:
ip route list
cat /etc/resolv.conf

The first command should give you the IP address of enp0s3 and the default route. The second one should show the IP addresses of the DNS nameservers. If something is missing it's because no DHCP request have been done on the card or something fail.

From there you can check if some DHCP client are active in background
Code:
ps aux| grep -i -e dh -e pump -e wpa

Kill them and restart like this
Code:
ifconfig enp0s3 up
dhclient -v enp0s3
or dhcpcd enp0s3

Those commands will tel you if the DHCP request succeed or fail. Have a look again to
Code:
ip route list
cat /etc/resolv.conf

You can try to automate the process at boot time
Code:
cd /etc/init.d
ln -s net.lo net.enp0s3
rc-update add net.enp0s3 default

Is the DHCP server on the other side of the enp0s3 link work properly? So it's VirtualBox. I repeat that the access method must be NAT in the network card configuration of the machine.


First thing first.
I tried
Code:
ip route list
. And I get:
-bash: ip: command not found

Next:
Code:
cat /etc/resolv.conf


I do get the IP address of the default gateway and the subnet mask.

Next:
Code:
ps aux| grep -i -e dh -e pump -e wpa


Output: I do have tty1 ------------------->(Sorry cannot paste the output as the mouse is not detected inside the Virtual Box terminal)
Well I did choose for automatic network configuration (net-setup eth0) and not dhcpd. But the commands themselves are not being detected.

Well, I tried to kill and restart still;

Code:
ifconfig enp0s3 up
dhclient -v enp0s3
or dhcpcd enp0s3


The dhclient and the dhcpd command is " command not found" on bash.


Last edited by Tgentoo on Mon Oct 07, 2013 6:33 pm; edited 1 time in total
Back to top
View user's profile Send private message
py-ro
Veteran
Veteran


Joined: 24 Sep 2002
Posts: 1373
Location: St. Wendel

PostPosted: Mon Oct 07, 2013 6:24 pm    Post subject: Reply with quote

Just to point out, there is no dhcp-client in stage3.

The entry in resolv.conf is most probably from copying it from the livecd.

Two possibilities, configure your Network by hand or go back to chroot and install a dhcp client.

Bye
Py
Back to top
View user's profile Send private message
Tgentoo
n00b
n00b


Joined: 21 Sep 2013
Posts: 7
Location: Mauritius

PostPosted: Mon Oct 07, 2013 6:25 pm    Post subject: Reply with quote

Logicien wrote:
Tgentoo,
after have read again your first message, I want to be sure of some things. Have you just boot a Gentoo livecd in a VirtualBox machine or you are in Gentoo after the installation and try to connect to Internet ? You said Gentoo is already installed in VirtualBox.

I just boot the install-amd64-minimal-20130816.iso (195,00 Mio) in VirtualBox. I have the net-setup command and the enp0s3 wire Ethernet card. The DHCP client is dhcpcd (and not dhcp).

I do not have the net-setup command in Gentoo after the installation. You need other means to connect to internet like I show you bebore.

For the mouse copy and paste in text mode, you need Gpm. If it is installed
Code:
rc-service gpm start

should give you a square as pointer that allow you to copy and paste. In the livecd, it is already started after you get the Bash prompt.


No, I am not booting from LiveCD because I already installed Gentoo from the CD, now using Gentoo on Virtual Box machine and trying to connect to Internet.

Ok. I just tried
Code:
rc-service gpm start
and it worked. (Thanks for this one).

But why isn't ip command not found in bash as well as dhcpd command?
where do all the commands reside?
And what do I need to do to have the missing commands detected for use?
Back to top
View user's profile Send private message
py-ro
Veteran
Veteran


Joined: 24 Sep 2002
Posts: 1373
Location: St. Wendel

PostPosted: Mon Oct 07, 2013 6:32 pm    Post subject: Reply with quote

ip is in the package iproute2 and not installed in stage3 either.

You need to install them by yourself, either by configure your Connection with ifconfig and route or using the chroot from livecd.
Back to top
View user's profile Send private message
Tgentoo
n00b
n00b


Joined: 21 Sep 2013
Posts: 7
Location: Mauritius

PostPosted: Wed Oct 09, 2013 5:16 pm    Post subject: Reply with quote

666threesixes666 wrote:
net-setup pulls dhcp ip subnet mask default gateway & sets routes jaglover. it is install media only, later down the line handbook suggests installing a dhcp client before rebooting.


Thanks, I guess I missed that part completely. I changed it to enp0s3 and it now works.

I need to check for ip command to work now.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum