# [SOLVED] Getting static ip but can't connect on internet

## netpumber

Hi!

im trying to put static ip on my computer. This is the /etc/conf.d/net file

```
#Static IP

config_eth0=( "192.168.1.3 netmask 255.255.255.0" )

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

After change it i run /etc/init.d/net.eth0 restart

```
* Caching service dependencies ...                                       [ ok ]

 * Stopping sshd ...                                                      [ ok ]

 * samba -> stop: smbd ...                                                [ ok ]

 * samba -> stop: nmbd ...                                                [ ok ]

 * Unmounting network filesystems ...                                     [ ok ]

 * Bringing down interface eth0

 *   Stopping dhcpcd on eth0 ...                                          [ ok ]

 *   Removing addresses

 * Bringing up interface eth0

 *   192.168.1.3 ...                                                      [ ok ]

 *   Adding routes

 *     default via 192.168.1.1 ...                                        [ ok ]

tux n3t #  * samba -> start: smbd ...

 * Starting sshd ...

 * Mounting network filesystems ...                                       [ ok ]

 * samba -> start: nmbd ...        
```

All went ok... but if i try to connect to the internet or ping www.google.com nothing happens..

What i forgot to change ? Does anyone an idea. 

I have internet if only i use DHCP.

Thanks in advance.Last edited by netpumber on Wed May 25, 2011 4:26 pm; edited 1 time in total

----------

## Anon-E-moose

If "ping 8.8.8.8" works then your problem is dns resolution, check the /etc/resolv.conf file

----------

## dmpogo

Is 192.168.1.1  indeed address of  your gateway ?   Is it a router  you connect to internet though ? If it is, they have some specific adress configured. Mine, for example is 192.168.1.254, go figure.

If still you have a problem, could you post output of  "route -n" when addresses configured by dhcp ?

----------

## netpumber

Indeed .. the problem was in /etc/resolv.conf . I just add two namservers..

Thanks a lot  guyz...

----------

