# [solved] Post-boot problems with Internet access

## Proz0r

Hello! With plenty of help from some good people here as well as from a forum of a local Linux community I have managed to boot my new Gentoo environment. But the Internet connection doesn't work. It connects OK and the OS acts like everything is cool but it simply doesn't work (ping or emerge, for example). First I've tried running net-setup eth0 which worked and I have absolutely no problem with setting up the connection on the LiveCD (I use a static IP) and copying /etc/conf.d/net and /etc/init.d/net.lo from the LiveCD environment to the installed HDD environment (from the LiveCD, of course), but it didn't work which is particularly interesting because the values in net file newly made via the LiveCD env. were exactly the same as the ones on the HDD. Internet also suddenly stops working when I chroot. As soon as I enter exit, everything works ok. Then I thought it was something I've missed while configuring the kernel, but then I figured out that the kernel was OK because it worked before the first boot while chrooting. I've booted from the HDD and since then it doesn't even work while chrooting. Help?

 :Question: Last edited by Proz0r on Sun Jun 27, 2010 1:19 pm; edited 1 time in total

----------

## bendeguz

What kind of network do you have? Are you behind a router?

what is the output of

```

# ifconfig

# route

```

Did you set up the correct dns server?

Do you have iptables running, or some firewall?[/code]

----------

## mokia

look in /etc/init.d/

You must have a symlink file with lokal interface name pointing to net.lo. (example: net.eth0) 

If not, create, and start/restart it.

edit

Additional to above: 

What is the output of 

```

cat /etc/conf.d/net

```

----------

## Hu

On vanilla kernels, calling chroot should have no effect on your ability to use network calls.  It will change the apparent /etc/resolv.conf, which could affect DNS.  Some people mistake DNS problems caused by the alternate /etc/resolv.conf for more fundamental network problems, since fundamental network problems can sometimes manifest as DNS failures.

----------

## Proz0r

Thanks for the quick reply and I'm sorry for my late response, but I wasn't home yesterday. So. The IP address should be 192.168.1.2 (because I'm behind a router), the gateway and DNS should be 192.168.1.1 (the IP address of the router) and I have no idea what the broadcast should be, but 192.168.1.255 worked for me on Fedora, so I put that. By the way, yes, I have the symlink to net.lo called net.eth0

route pops up something like this:

```
Destination       Gateway        Genmask        Flags Metric Ref   Use Iface

192.168.1.0       *              255.255.255.0  U     0      0       0 eth0

loopback          *              255.0.0.0      U     0      0       0 lo

default           192.168.1.1    0.0.0.0        UG    0      0       0 eth0
```

ifconfig (I'm typing this over so these are only a few lines I thought were important, if you need more, I shall type over the rest):

```
eth0:

inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0

UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

Interrupt:21 Base address:0x8000
```

/etc/conf.d/net:

```
config_eth0=( "192.168.1.2 brd 192.168.1.255 netmask 255.255.255.0" )

routes_eth0=( "default via 192.168.1.1" )
```

EDIT:

SOLVED!

It appears the solution was to simply add the line

```
nameserver 192.168.1.1
```

to the /etc/resolv.conf file.

Thanks  :Very Happy: 

----------

## Hu

 *Proz0r wrote:*   

> /etc/conf.d/net:
> 
> ```
> config_eth0=( "192.168.1.2 brd 192.168.1.255 netmask 255.255.255.0" )
> 
> ...

 As I suspected, your network connection was working the whole time.  However, you could not resolve names until you added that line.  That line will probably be removed on next reboot, since /etc/resolv.conf is normally managed for you.  You should instead set the nameserver via /etc/conf.d/net, or switch to DHCP and let your NAT device do the right thing for you.  See /etc/conf.d/net.example for details on how to set nameservers, as well as many other features.

----------

