# Problem with ifconfig duplicate broadcasts



## Alita (May 9, 2020)

When I type in  code: ifconfig

( I only want one of the ip address not both)
(I want to assign it **and not from rc.conf** , I do not want DHCP)

Results:

```
ne0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    options=8210b<RXCSUM,TXCSUM,VLAN_MTU,TSO4,WOL_MAGIC,LINKSTATE>
    ether 00:26:18:a1:45:6d
    inet 192.168.0.120 netmask 0xffffff00 broadcast 192.168.0.255
    inet 192.168.0.168 netmask 0xffffff00 broadcast 192.168.0.255
    media: Ethernet autoselect (1000baseT <full-duplex,master>)
    status: active
```
How to get rid of the one ending in 168


Thank You


----------



## Emrion (May 9, 2020)

The question should be: why do you have an inet alias in the first place?
It would be cool if we can see the whole output of `ifconfig` and the content of rc.conf. Do you have any jail in this system?

Normaly to remove an inet: `ifconfig ne0 inet 192.168.0.168 -alias`.
See ifconfig(8).

You can use rc.conf to define a static ip. I don't know if it is what you want or not.


----------



## Alita (May 9, 2020)

Emrion said:


> The question should be: why do you have an inet alias in the first place?
> It would be cool if we can see the whole output of `ifconfig` and the content of rc.conf. Do you have any jail in this system?
> 
> Normaly to remove an inet: `ifconfig ne0 inet 192.168.0.168 -alias`.
> ...



This had happen to be because i notice i had an ip addres i don not not like to use normally so i decided o ad the new ip 
with that command You show and that is how i got the both showing


----------



## Emrion (May 10, 2020)

Alita said:


> This had happen to be because i notice i had an ip addres i don not not like to use normally so i decided o ad the new ip
> with that command You show and that is how i got the both showing


The command I gave you remove the alias. Notice the '-' before `alias`. Without '-', it actually adds an alias.
This command is equivalent to: `ifconfig ne0 inet 192.168.0.168 remove`.
Once again, take the time to read ifconfig(8).


----------



## Alita (May 11, 2020)

Emrion said:


> The command I gave you remove the alias. Notice the '-' before `alias`. Without '-', it actually adds an alias.
> This command is equivalent to: `ifconfig ne0 inet 192.168.0.168 remove`.
> Once again, take the time to read ifconfig(8).



Thank you again for your very kind and helpful reply.


----------



## Alita (May 11, 2020)

Emrion said:


> The question should be: why do you have an inet alias in the first place?
> It would be cool if we can see the whole output of `ifconfig` and the content of rc.conf. Do you have any jail in this system?
> 
> Normaly to remove an inet: `ifconfig ne0 inet 192.168.0.168 -alias`.
> ...


*I* usually do that but weather it be in the command terminal or in rc.conf it just won*'*t connect unless *I* leave it as DHCP.
*I* know *I* have it correct.
But not sure what is wrong so for now *I* leave it as DHCP.


----------



## Emrion (May 11, 2020)

It's because, without DHCP, you don't set a default router. 

/etc/rc.conf

```
ifconfig_ne0="inet 192.168.0.120 netmask 255.255.255.0"                             
defaultrouter="192.168.0.1"
```
The IP address of your default router may be different than 192.168.0.1. It must be the IP address of your internet box.

You can also have a problem with the name server. It should be again the IP address of your internet box.

/etc/resolv.conf

```
nameserver 192.168.0.1
```

During the DHCP protocol, you get not only your IP address but also the default router and a name server. If one of these three things lacks, you can't access to the internet.


----------



## Alita (May 12, 2020)

Emrion said:


> It's because, without DHCP, you don't set a default router.
> 
> /etc/rc.conf
> 
> ...



This is very useful information and makes sense 

Thank You so much


----------



## Alita (May 12, 2020)

Emrion said:


> It's because, without DHCP, you don't set a default router.
> 
> /etc/rc.conf
> 
> ...



Finally for me this working in rc.conf
Biggest problems I'm having was using ' instead of double quote ", most of the time or it would not boot up at all and I have to get into the rc.conf, so thereI  was missing only that one line for the default router and I turned off DHCP
and all is good now 
funny how most simple thing can make all to seem broken

Thank You


----------

