# Setting a static IP

## 0x001A4

I'm using a router at home and it blocks ports when I try to seed torrents. I have set it up for port forwarding but I need to set a static IP in Gentoo. I can't find out how to do that. 

I think I need to edit the /etc/conf.d/net but I'm not sure what to put in there.

I've tried searching google and the forums but nothing I'm looking for comes up.

----------

## think4urs11

```
less /etc/conf.d/net.example
```

HTH

T.

----------

## brims

In /etc/conf.d/net

```
config_eth0=( "<ip address> netmask <netmask>" )
```

----------

## 0x001A4

Ok I thought I was just doing something wrong. Thats what I tried after I first read the example file. But when I specicy the correct IP address and netmask, it stops working. I cant connect to anything anymore.

Is there something else I have to do?

On second thought, all I'm trying to do is port forwarding through my router. In my router I can setup which ports to be forwarded for which IP address. So I put my IP and the ports I wanted forwarded. (This all works in Windows so I know my IPs are correct). 

When Gentoo boots it does the dhcp automatically but I'm pretty sure it gets the same IP address that I'm trying to make static. Shouldn't the port forwarding work then without having to set static IPs?

----------

## snis

How about a default gateway?

```
routes_eth0=( "default via x.x.x.x" )

```

And don't forget to check that your /etc/resolv.conf has the right nameservers.

----------

