# Static IP issue [SOLVED]

## markisthejob

Hi All. I've recently come back to Gentoo after a long absence.Everything is exactly the way I want it except my static ip.When I set one, I have no internet connectivity.Im sure im just missing something small.After following the handbook and forum heres what i've got

my desired ip is 192.168.1.199 and my router is 192.168.1.254 (these are the settings I always use)

```
localhost / # cat /etc/conf.d/net

config_eth0=( "192.168.1.199 netmask 255.255.255.0" )

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

mabye im missing something?

```
cat /etc/resolv.conf

# Generated by dhcpcd from eth0

# /etc/resolv.conf.head can replace this line

domain WAG160N

nameserver 213.94.190.194

nameserver 213.94.190.236

# /etc/resolv.conf.tail can replace this line
```

I've checked and these are the correct nameservers for my provider.When I comment out the lines in /etc/conf.d/net, dhcp starts without any problems

Thanks for any help, this is driving me crazy as i've had a static ip on my previous gentoo install a few years ago which I set up with no problems

cheers,

MarkLast edited by markisthejob on Thu Feb 24, 2011 4:57 pm; edited 1 time in total

----------

## chiefbag

Just try the following.

config_eth0=( "192.168.1.199" )

routes_eth0=( "default via 192.168.1.254" )

----------

## Anon-E-moose

This 

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

 doesn't look right 

The router/gateway address is usually 192.168.1.1, unless you've manually changed it.

I see from a follow on post that that is your IP - so disregard this

When you uncomment the lines in net, can you "ping 192.168.1.254" and does it respond?

----------

## markisthejob

Hi and thanks for the reply, ive made the changes you suggested

```
localhost / # cat /etc/conf.d/net

config_eth0=( "192.168.1.199" ) 

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

unfortunately I still have no internet connectivity.

I dont know if its any help but when dhcp starts the output is:

```
/etc/init.d/net.eth0 restart

 * Caching service dependencies ...

 *  Cannot add provide 'net', as a service with the same name exists!     [ ok ]

 * Unmounting network filesystems ...                                     [ ok ]

 * Stopping eth0

 *   Bringing down eth0

 *     Shutting down eth0 ...                                             [ ok ]

 * Starting eth0

 *   Configuration not set for eth0 - assuming DHCP

 *   Bringing up eth0

 *     dhcp

 *       Running dhcpcd ...

dhcpcd[22834]: version 5.2.8 starting

dhcpcd[22834]: eth0: waiting for carrier

dhcpcd[22834]: eth0: carrier acquired

dhcpcd[22834]: eth0: rebinding lease of 192.168.1.104

dhcpcd[22834]: eth0: acknowledged 192.168.1.104 from 192.168.1.254

dhcpcd[22834]: eth0: checking for 192.168.1.104

dhcpcd[22834]: eth0: leased 192.168.1.104 for 86400 seconds

dhcpcd[22834]: forked to background, child pid 22863                      [ ok ]

 *       eth0 received address 192.168.1.104/24

 * Mounting network filesystems ...             
```

----------

## markisthejob

Yes I did manually change the router address as I had an older router with this address and It just seemed easier to keep it the same.Ive used these settings with arch and they worked fine.

```
ping 192.168.1.254ping 192.168.1.254

PING 192.168.1.254 (192.168.1.254) 56(84) bytes of data.

64 bytes from 192.168.1.254: icmp_req=1 ttl=64 time=0.745 ms

64 bytes from 192.168.1.254: icmp_req=2 ttl=64 time=0.670 ms

64 bytes from 192.168.1.254: icmp_req=3 ttl=64 time=0.628 ms

64 bytes from 192.168.1.254: icmp_req=4 ttl=64 time=0.665 ms

64 bytes from 192.168.1.254: icmp_req=5 ttl=64 time=0.678 ms

64 bytes from 192.168.1.254: icmp_req=6 ttl=64 time=0.674 ms

64 bytes from 192.168.1.254: icmp_req=7 ttl=64 time=0.673 ms

64 bytes from 192.168.1.254: icmp_req=8 ttl=64 time=0.656 ms

64 bytes from 192.168.1.254: icmp_req=9 ttl=64 time=0.679 ms

64 bytes from 192.168.1.254: icmp_req=10 ttl=64 time=0.648 ms

64 bytes from 192.168.1.254: icmp_req=11 ttl=64 time=0.672 ms

64 bytes from 192.168.1.254: icmp_req=12 ttl=64 time=0.670 ms

64 bytes from 192.168.1.254: icmp_req=13 ttl=64 time=0.667 ms

64 bytes from 192.168.1.254: icmp_req=14 ttl=64 time=0.649 ms

64 bytes from 192.168.1.254: icmp_req=15 ttl=64 time=0.665 ms

^X64 bytes from 192.168.1.254: icmp_req=16 ttl=64 time=0.657 ms

PING 192.168.1.254 (192.168.1.254) 56(84) bytes of data.

64 bytes from 192.168.1.254: icmp_req=1 ttl=64 time=0.745 ms

64 bytes from 192.168.1.254: icmp_req=2 ttl=64 time=0.670 ms

64 bytes from 192.168.1.254: icmp_req=3 ttl=64 time=0.628 ms

64 bytes from 192.168.1.254: icmp_req=4 ttl=64 time=0.665 ms

64 bytes from 192.168.1.254: icmp_req=5 ttl=64 time=0.678 ms

64 bytes from 192.168.1.254: icmp_req=6 ttl=64 time=0.674 ms

64 bytes from 192.168.1.254: icmp_req=7 ttl=64 time=0.673 ms

64 bytes from 192.168.1.254: icmp_req=8 ttl=64 time=0.656 ms

64 bytes from 192.168.1.254: icmp_req=9 ttl=64 time=0.679 ms

64 bytes from 192.168.1.254: icmp_req=10 ttl=64 time=0.648 ms

64 bytes from 192.168.1.254: icmp_req=11 ttl=64 time=0.672 ms

64 bytes from 192.168.1.254: icmp_req=12 ttl=64 time=0.670 ms

64 bytes from 192.168.1.254: icmp_req=13 ttl=64 time=0.667 ms

64 bytes from 192.168.1.254: icmp_req=14 ttl=64 time=0.649 ms

64 bytes from 192.168.1.254: icmp_req=15 ttl=64 time=0.665 ms

^X64 bytes from 192.168.1.254: icmp_req=16 ttl=64 time=0.657 ms
```

Last edited by markisthejob on Thu Feb 24, 2011 4:40 pm; edited 1 time in total

----------

## Anon-E-moose

Can you "ping 192.168.1.199"

with the config and route lines uncommented.

Edit to add: and what does "route -n" return

----------

## markisthejob

Yes, When I can ping the router @ 192.168.1.254 with the with the uncommented net file, yet I still can't browse the net.

I've just realised that transmission will download a torrent with these settings but opera and firefox "cannot connect to server"

----------

## chiefbag

If you can ping the 192.168.1.254 router as you have shown then I wonder is there may be a internet connectivity issue?

What happens when you ping google.com or try pinging this google ip address also

ping 209.85.143.99

----------

## markisthejob

I can't ping www.google.com but I can ping 209.85.143.99

----------

## chiefbag

DNS issue  :Wink: 

Change your resolf.conf  DNS settings to point to the router ip

----------

## markisthejob

Thats sorted it  :Very Happy: 

I didnt think to change it to the router address as dhcp was using the dns addresses

Thanks a million

----------

