# staice ip setup

## sweetangelhsd

what is the best way to settup a stitic ip address in gentoo linux?

----------

## delta407

/etc/conf.d/net

----------

## Radar

ifconfig eth[x] [ip-addr] netmask [netmask]

man ifconfig

---------------------------------------------------

better to do what delta407 said

----------

## delta407

No, use /etc/conf.d/net and the init scripts (/etc/init.d/net.eth_) -- it's cleaner, and the boot-time functionality is there (service dependency tracking, etc.).

----------

## sweetangelhsd

i need to know where the dns number should be and how please

----------

## delta407

man resolv.conf

----------

## sweetangelhsd

here is what my /etc/resolv.conf looks like

nameserver 204.117.214.10 

nameserver 192.2.252.10

the first line is my first dns number

the second line is my second number

is this right

my /etc/conf.d/net file is

iface_eth0="xx.xx.xxx.xx"broadcast 64.45.237.95 netmask 255.xxx.xxx.xxx

where the x is i have my  numbers in

this is the only line uncomment 

ideas??

----------

## delta407

Here's my /etc/conf.d/net:

```
iface_eth0="10.0.0.2 broadcast 10.255.255.255 netmask 255.0.0.0"

gateway="eth0/10.0.0.1"
```

And /etc/resolv.conf:

```
nameserver 209.98.98.98

nameserver 208.42.42.42
```

You should be good, as long as you set your gateway.

----------

## sweetangelhsd

thanks that worked i found my problem i forget to but " at the end of the gateway line

next thing is to get the second network card working and setup internet sharing any ideas on how to setup enternet sharing

----------

## delta407

"Sharing" is a broad term, there's lots of different ways to do it. You might be able to route, you might want to run network address translation, it might be eaiser to run an HTTP proxy, etc.

Given no information, I would say you probably want to look into network address translation (NAT). Ask Google; it knows everything and can probably direct you to a good tutorial.

----------

## sweetangelhsd

i have a laptop with win98 and a wirless pcmia card

linksys 4 port router with wireless

gentoo system with one realtec have a second one to put in

need to make the gentoo system send the internet to the linksys router then to the laptop

 how would i do this

----------

## delta407

The Linksys router could probably be set to do network address translation for you, and might already be doing it. Try using DHCP and telling Windows to "Obtain an address automatically" and you should be good.

----------

## Beattie

 *delta407 wrote:*   

> No, use /etc/conf.d/net and the init scripts (/etc/init.d/net.eth_) -- it's cleaner, and the boot-time functionality is there (service dependency tracking, etc.).

 

So, all you have to do is change the iface_eth0 line in /etc/conf.d/net where the syntax is basically the same as ifconfig and that's it to change from DHCP to Static?  do you need to reboot? or do you have to run an ifconfig also?  what about the gateway, edit the gateway line also?

----------

## delta407

Right, edit the iface_eth0 line and the gateway line. Then, run "/etc/init.d/net.eth0 restart" and your changes will take effect.

----------

