# Getting wrong IP in my ping command



## RedErick (Aug 14, 2013)

Hello!

I'm new in FreeBSD, and I have a problem with the ping command. Part of which commands I have in my /etc/rc.conf, where Iâ€™m initializing my network cards:


```
ifconfig_re0="DHCP"
ifconfig_em0="inet 192.168.1.1 netmask 255.255.255.0"
```

And in /etc/start_if.re0:


```
#!/bin/sh
ifconfig re0 ether XX:XX:XX:XX:XX:XX
```

After this everything is fine, but then Iâ€™m making a ping to my re0 or em0 network cards. Iâ€™m getting the same strange IP in response, which is not mine. E.g., ping to my re0 network card should return 192.168.1.1 and ping to my re0 card should return my global IP (as I think ). I donâ€™t know from where my problem is coming. Please, help.


----------



## SirDice (Aug 14, 2013)

Can you post the output of `# ping -c 4 192.168.1.1` and [cmd=]arp -an[/cmd]?


----------



## RedErick (Aug 14, 2013)

Yes , output of commands:

`ping -c 4 192.168.1.1:`

```
64 bytes from 192.168.1.1: icmp_seq=0 ttl=255 time=0.180 ms
64 bytes from 192.168.1.1: icmp_seq=1 ttl=255 time=0.131 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=255 time=0.147 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=255 time=0.127 ms
```

`arp -an:`

```
? (192.168.1.74) at xx:xx:xx:xx:xx:xx on em0 expires in 1169 seconds [ethernet]
? (192.168.1.2) at xx:xx:xx:xx:xx:xx on em0 expires in 1188 seconds [ethernet]
? (192.168.1.33) at xx:xx:xx:xx:xx:xx on em0 expires in 1061 seconds [ethernet]
? (192.168.1.1) at xx:xx:xx:xx:xx:xx on em0 permanent [ethernet]
? (192.168.1.102) at xx:xx:xx:xx:xx:xx on em0 expires in 838 seconds [ethernet]
? (192.168.1.51) at xx:xx:xx:xx:xx:xx on em0 expires in 1174 seconds [ethernet]
? (192.168.1.16) at xx:xx:xx:xx:xx:xx on em0 expires in 1128 seconds [ethernet]
? (192.168.1.17) at xx:xx:xx:xx:xx:xx on em0 expires in 1193 seconds [ethernet]
? (192.168.1.87) at xx:xx:xx:xx:xx:xx on em0 expires in 1193 seconds [ethernet]
? (10.xx.xx.xx at xx:xx:xx:xx:xx:xx on re0 expires in 1199 seconds [ethernet]
? (212.xx.xx.xx) at xx:xx:xx:xx:xx:xx on re0 expires in 601 seconds [ethernet]
? (212.xx.xx.xx) at xx:xx:xx:xx:xx:xx on re0 permanent [ethernet]
```


----------



## RedErick (Aug 14, 2013)

And what I'm getting when performing my `ping` command:
`ping -c 4 re0`

```
PING re0.bla.bla.com (66.114.xxx.xxx): 56 data bytes
64 bytes from 66.114.xxx.xxx: icmp_seq=0 ttl=46 time=177.545 ms
64 bytes from 66.114.xxx.xxx: icmp_seq=1 ttl=46 time=177.027 ms
64 bytes from 66.114.xxx.xxx: icmp_seq=2 ttl=46 time=178.979 ms
64 bytes from 66.114.xxx.xxx: icmp_seq=3 ttl=46 time=176.609 ms
```

I don't know from where is this 66.114.xxx.xxx IP address*.*


----------



## SirDice (Aug 14, 2013)

Haha.. Ok, your newbieness really shines through now. You're pinging the _hostname_ re0, not the interface.


----------



## RedErick (Aug 14, 2013)

Thank you! My "problem" is solved.


----------

