# add ip in server



## free-man20101 (Mar 22, 2010)

hello

i have multi ip and i want this ip in server 
how this

freebsd 7


thanks


----------



## DutchDaemon (Mar 22, 2010)

ifconfig(8)


----------



## free-man20101 (Mar 22, 2010)

how this


----------



## DutchDaemon (Mar 22, 2010)

like that


----------



## free-man20101 (Mar 22, 2010)

can you give me example


----------



## DutchDaemon (Mar 22, 2010)

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/config-network-setup.html


----------



## free-man20101 (Mar 22, 2010)

edit file /etc/rc.conf 
and add this line

```
ifconfig_em1="inet 192.168.0.2  netmask 255.255.255.248"
ifconfig_em2="inet 192.168.0.3  netmask 255.255.255.248"
```

and edit /etc/hosts

and reboot server 
is this true ?


----------



## DutchDaemon (Mar 22, 2010)

It is not advisable to put two IP addresses from the same network on two different interfaces. You can however put two IP addresses from the same network on one interface, using the 'alias' option from ifconfig(8) (using a 255.255.255.255 netmask for the aliased IP).


----------



## free-man20101 (Mar 22, 2010)

ok i have used another different ip
but not reply ping why


----------



## SirDice (Mar 22, 2010)

Until you tell us what happens we won't have a clue.

Seriously, you are going to have to put some effort into it. You need to read (at least parts of) the handbook. If English isn't your first language, or you have trouble understanding it, the handbook is also available in other languages.

FreeBSD isn't for people that need to be spoon fed every command.


----------



## jailed (Mar 22, 2010)

First, are em1 or em2 really your interfaces?

To be sure,

```
pciconf -lv
```
Find the ethernet devices

e.g:

```
rl0@pci0:1:0:0: class=0x020000 card=0x10451043 chip=0x813910ec rev=0x10 hdr=0x00
    vendor     = 'Realtek Semiconductor'
    device     = 'Realtek RTL8139 Family PCI Fast Ethernet NIC (RTL-8139/8139C/8139C)'
    class      = network
    subclass   = ethernet
```

In this example rl0 on the first line is the interface. Then configure it.

You can also use [CMD=""]sysinstall[/CMD] to configure your network.

sysinstall > Configure > Networking > Interfaces

If you set your config manually, don't forget to set your nameserver in /etc/resolv.conf


----------



## free-man20101 (Mar 22, 2010)

thanks
i have add now
but i have 100 ip how add this one time ?
or can not


----------



## jailed (Mar 23, 2010)

To add another IP

```
ifconfig_[B]xx0[/B]_alias[B]0[/B]="inet IP netmask NETMASK"
```

If you will use this machine for gateway/rooter/nat you won't add all the addresses. You will use nat to redirect ip addresses.


----------

