Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
After install the network not work
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
fakebear
n00b
n00b


Joined: 17 Oct 2012
Posts: 5

PostPosted: Wed Oct 17, 2012 2:33 am    Post subject: After install the network not work Reply with quote

I install the version 3.3.8 Gentoo. And follow exactly with the handbook.
While installing, with no DHCP, so I use:
Code:
ifconfig eth0 192.168.31.112 broadcast 192.168.31.255 netmask 255.255.255.0
route add default gw 192.168.31.1
ifconfig eth0 down
ifconfig eth0 up
to set my network. And it works fine.

And I set the /etc/resolv.conf with correct DNS.

I modified the file /etc/conf.d/hostname to change computer name.
Modified the file /etc/conf.d/net with add the following lines:
Code:
config_eth0=( "192.168.31.112 netmask 255.255.255.0 brd 192.168.31.255" )
routes_eth0=( "default via 192.168.31.1" )

And run the cmd line:
Code:
cd /etc/init.d
ln -s net.lo net.eth0
rc-update add net.eth0 default


After the reboot, the network can ping itself with ip 192.168.31.112, but it cannot ping the gateway and any other address anymore.

when i run route, it displayed:
Code:

loopback         localhost    255.0.0.0            UG    0    0    0    lo
192.168.31.0  *                255.255.255.0    U      0    0    0    eth0


I use cmd "route add default gw 192.168.31.1", but it still not work.
And I tried to modify the file "/etc/conf.d/net", change the route part to "routes_eth0=( "default gw 192.168.31.1" )", it still not work.

Please, Please give me some advice. I am not a so good linuxer.
Back to top
View user's profile Send private message
BillWho
Veteran
Veteran


Joined: 03 Mar 2012
Posts: 1600
Location: US

PostPosted: Wed Oct 17, 2012 3:02 am    Post subject: Reply with quote

fakebear,

Check the content of /etc/resolv.conf. If there are no servers listed then add them in /etc/conf.d/net with dns_servers_eth0="8.8.8.8 8.8.4.4"

The above are google's dns servers - you can use them or just replace them with your providers.
_________________
Good luck :wink:

Since installing gentoo, my life has become one long emerge :)
Back to top
View user's profile Send private message
fakebear
n00b
n00b


Joined: 17 Oct 2012
Posts: 5

PostPosted: Wed Oct 17, 2012 3:18 am    Post subject: Reply with quote

Thank you for your answer anyway.
But it is not the problem. Now I cannot ping the gateway with the ip address 192.168.31.1, not associate with the DNS at all.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Wed Oct 17, 2012 3:20 am    Post subject: Reply with quote

Quote:
config_eth0="192.168.31.112 netmask 255.255.255.0 brd 192.168.31.255"
routes_eth0="default via 192.168.31.1"
dns_servers="8.8.8.8 8.8.4.4"
parens do not work with openrc and baselayout2
_________________
Defund the FCC.
Back to top
View user's profile Send private message
fakebear
n00b
n00b


Joined: 17 Oct 2012
Posts: 5

PostPosted: Wed Oct 17, 2012 4:24 am    Post subject: Reply with quote

Thank you DONAHUE!

After I remove the parens in file "/etc/conf.d/net" and reboot, problem solved.

But after I reboot again, it cannot ping the gateway again. What's the problem?
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Wed Oct 17, 2012 4:49 am    Post subject: Reply with quote

what does
Code:
ifconfig
produce?
Code:
/etc/init.d/net.eth0 restart
ping -c2 192.168.31.1
ping -c2 8.8.8.8
ping -c2 google.com
dmesg | grep -i eth
What happens?
_________________
Defund the FCC.
Back to top
View user's profile Send private message
fakebear
n00b
n00b


Joined: 17 Oct 2012
Posts: 5

PostPosted: Wed Oct 17, 2012 5:56 am    Post subject: Reply with quote

ifconfig:
Code:

eth0  Link encap:Ethernet HWaddr 90:fb:xx:xx:xx:xx
         inet addr:192.168.31.112 Bcast:192.168.31.255 Mask 255.255.255.0
         UP BROADCAST MULTICAST MTU:1500 Metric:1
         RX packets:0 errors:0 dropped:0 overruns:0 frame:0
         TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
         collisions:0 txqueuelen:1000
         RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
         Interrupt:17


/etc/init.d/net.eth0 restart
Code:

Unmounting network filesystems ....  [OK]
Bringing down interface eth0
    Removing addresses
        192.168.31.112/24
Bringing up interface eth0
    192.168.31.112 ...                          [OK]
    Adding routes
        default via 192.168.31.1 ...        [OK]
Mounting network filesystems ...       [OK]


ping -c2 192.168.31.1
Code:

PING 192.168.31.1 (192.168.31.1) 56(84) bytes of data.
From 192.168.31.112: icmp_seq=1 Destination Host Unreachable
From 192.168.31.112: icmp_seq=2 Destination Host Unreachable

--- 192.168.31.1 ping statistics ---
2 packets transmitted, 0 received, +2 errors, 100% packet loss, time 999ms pipe 2


And the same result with the other pings.

dmesg | grep -i eth
Code:

[    0.449475] sky2 0000:02:00.0: eth0: addr 90:fb:xx:xx:xx:xx
[    4.605861] sky2 0000:02:00.0: eth0: enabling interface
[    4.606033] ADDRCONF(NETDEV_UP): eth0: link is not ready
[202.184881] sky2 0000:02:00.0: eth0: disabling interface
[202.233962] sky2 0000:02:00.0: eth0: enabling interface
[202.234133] ADDRCONF(NETDEV_UP): eth0: link is not ready
Back to top
View user's profile Send private message
fakebear
n00b
n00b


Joined: 17 Oct 2012
Posts: 5

PostPosted: Wed Oct 17, 2012 6:10 am    Post subject: Reply with quote

Is there any difference between:
Code:

routes_eth0="default via 192.168.31.1"

and
Code:

routes_eth0="default gw 192.168.31.1"
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7651
Location: Goose Creek SC

PostPosted: Wed Oct 17, 2012 6:25 am    Post subject: Reply with quote

IIRC, I have used both with success. Currently I'm using
Quote:
routes_eth0="default gw 192.168.1.1"

You may have a loose connection or intermittent problem.
What does
Code:
lspci -k
say about the nic? manufacturer, model, driver in use?
Code:
rm /etc/udev/rules.d/70-persistent-net.rules
reboot
the rule will regenerate on the reboot.
check that /etc/conf.d/net is as you left it.
could there be another 192.168.31.112 on your subnet?
_________________
Defund the FCC.
Back to top
View user's profile Send private message
fhaddad78
n00b
n00b


Joined: 21 May 2012
Posts: 68

PostPosted: Wed Oct 17, 2012 3:53 pm    Post subject: Reply with quote

Having properly configured /etc/resolve.conf, /etc/hosts, and /etc/conf.d/net files is a necessary step towards having a working network.
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