# Problem with 4G modem (router)



## Kristian Nushev (Mar 24, 2015)

Hello you,
I have a problem with the configuration of the server Freebsd FreeBSD 10.1 with 4G modem. This modem accepts 4G Internet and attaches wireless internet to the server. Configured `ifconfig wlan0`, status: associated; ssid: 4G_MaxTelecom
When I type in shell: `ping 192.168.8.1`, the modem get the packets.
`cat /etc/rc.conf`

```
hostname="sKaFF"
wlans_ath0="wlan0"
ifconfig_wlan0="WPA SYNCDHCP"
local_unbound_enable="YES"
sshd_enable="YES"
moused_enable="YES"
ntpd_enable="YES"
powerd_enable="YES"
dumpdev="AUTO"
zfs_enable="YES"
ifconfig_wlan0="WPA inet 192.168.8.1 netmask 255.255.255.0"
defaultrouter="192.168.8.1"
```

`cat /etc/wpa_supplicant.conf`

```
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel

network={
ssid="4G_MaxTelecom"
proto=WPA
key_mgmt=WPA-PSK
psk=qweassqwe
}
```

When I write
`service netif restart`

```
sKaFF wpa_supplicant[328]: ioctl[SIOCS80211, op=16, val=1, arg_len=0]"Device not configured
Starting wpa_supplicant.
Starting network: lo0 re0 ath0
lo0: flags=8049<UP ,LOOPBACK ,RUNNING ,MULTICAST> metric 0 mtu 16384
options=600003<RXCSUM ,TXCSUM ,RXCSUM_IPV6 ,TXCSUM_IPV6>
inet6  ::1 prefixlen 128
inet6 fe80::1%:lo0 prefixlen 64 scopeid 0x3
inet 127.0.0.1 netmask 0xff000000
nd6 options=21<PERFORMNUD ,AUTO_LINKLOCAL>
re0: flags=8802<BROADCAST ,SIMPLEX ,MULTICAST> metric 0 mtu 1500
options=8209b<RXCSUM ,TXCSUM ,VLAN_MTU ,VLAN_HWTAGGING ,VLAN_HWCSUM ,,WOL_MAGIC ,LINKSTATE>
ether f0:92:1c:89:4a:ec
nd6 options=29<PERFORMNUD ,IFDISABLED ,AUTO_LINKLOCAL>
media: Ethernet autoselect (none)
status: no carrier
ath0: flags=8843<UP ,ROADCAST, RUNNING, SIMPLEX, MULTICAST> metric 0 mtu 2290
ether 40:f0:2f:92:d8:01
nd6 options=21<PERFORMNUD ,AUTO_LINKLOCAL>
media: IEEE 802.11 Wireless Ethernet autoselect mode 11g
status associated
```

My problem is that I can not start the server on the Internet.


----------



## getopt (Mar 24, 2015)

Hopefully you did not post your true PSK key here?
It is good practice to use something like xxxxxxxxx when posting on the internet


----------



## Kristian Nushev (Mar 24, 2015)

This is not my true PSK key


----------



## junovitch@ (Mar 24, 2015)

Does `ping 8.8.8.8` work?  I don't see any mention of a DNS server setting in /etc/resolv.conf so if all you testing so far is host names that would be an issue.


----------



## Kristian Nushev (Mar 24, 2015)

No ping to 8.8.8.8

`cat /etc/resolv.conf`

```
search maxtelecom.bg
nameserver 192.168.8.1
nameserver 91.191.208.40
```


----------



## junovitch@ (Mar 24, 2015)

Kristian Nushev said:


> Configured `ifconfig wlan0`, status: associated; ssid: 4G_MaxTelecom
> When I type in shell: `ping 192.168.8.1`, the modem get the packets.



Ok, well let's take a step back from DNS resolution.  Can you show the whole `ifconfig wlan0` vice the partial one and can you clarify what you mean by "the modem gets the packets"?  Does that mean the ping succeeds or does that mean the ping is one-way and the modem is registering incoming packets but not sending outgoing packets?


----------



## Kristian Nushev (Mar 24, 2015)

`ifconfig wlan0`

```
wlan0: flags=8843<up ,BROADCAST ,RUNNING ,SIMPLEX, MULTICAST> metric 0 mtu 1500
ether 40:f0:2f:92:d8:01
inet 192.168.8.1 netmask 0xffffff00 broadcast 192.168.8.255
nd6 optins=29<PERFORMNUD ,IFDISABLED ,AUTO_LINKLOCAL>
media: IEEE 802.11 Wireless Ethernet DS/1Mbps mode 11g
status: associated
ssid 4G_MaxTelecom channel 12 (2467 MHz 11g) bssid 00:1e:31:93:b9:db
regdomain 106 indoor ecm authmode WPA privacy ON deftxkey UNDEF
TKIP 2:128-bit TKIP 3:128-bit txpower 20 bmiss 7 scanvalid 60
protmode CTS wme burst roaming MANUAL
```

`ping 192.168.8.1`

```
PING 192.168.8.1 (192.168.8.1): 56 data bytes
64 bytes from 192.168.8.1: icmp_seq=0 ttl=64 time=0.755 ms
64 bytes from 192.168.8.1: icmp_seq=1 ttl=64 time=0.752 ms
64 bytes from 192.168.8.1: icmp_seq=2 ttl=64 time=0.260 ms
^C
--- 192.168.8.1 ping statistics ---
3 packets transmitted, 3 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 0.260/0.589/0.755/0.233 ms
```


----------



## Kristian Nushev (Mar 24, 2015)

`ping 91.191.212.80`

```
PING 91.191.212.80 (91.191.212.80): 56 data bytes
ping: sendto: No route to host
ping: sendto: No route to host
ping: sendto: No route to host
^C
--- 91.191.212.80 ping sstatistics ---
3 packets transmitted, 0 packets received, 100.0% packet loss
```


----------



## Kristian Nushev (Mar 24, 2015)

Now the system is notify me

```
wlan0: ieee80211_new_state_locked: pending RUN -> ASSOC transition lost
```


----------



## junovitch@ (Mar 24, 2015)

Ah, missed that earlier.  So 192.168.8.1 is both your IP address and your default gateway.  You are just pinging yourself.  Typically the .1 address is the router and the remaining addresses are for devices.  Try this:

/etc/rc.conf
Remove this or comment it out.  It's not an issue now because the entry below overrides it but it could be a cause for confusion in the future.

```
#ifconfig_wlan0="WPA SYNCDHCP"
```
Try .100 as your device assuming .1 is the router.

```
ifconfig_wlan0="WPA inet 192.168.8.100 netmask 255.255.255.0"
defaultrouter="192.168.8.1"
```


----------



## Kristian Nushev (Mar 24, 2015)

okey, now the `ping 192.168.8.1`

```
64 bytes from 192.168.8.1: icmp_seq=8 ttl=64 time=3.780 ms
64 bytes from 192.168.8.1: icmp_seq=8 ttl=64 time= 1019.857 ms
64 bytes from 192.168.8.1: icmp_seq=8 ttl=64 time= 4.014 ms
64 bytes from 192.168.8.1: icmp_seq=8 ttl=64 time= 4.272 ms
64 bytes from 192.168.8.1: icmp_seq=8 ttl=64 time= 5.291 ms

118 packets transmitted, 12 packts received, 89.8% packet loss
```


----------



## junovitch@ (Mar 24, 2015)

That looks better, does it ping to the WAN?  The 89% packet loss doesn't look good but one step at a time.


----------



## Kristian Nushev (Mar 24, 2015)

`dhclient wlan0`

```
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPREQUEST on wlan0 to 255.255.255.255 port 67
DHCPACK from 192.168.8.1
bound to 192.168.8.12 -- renewal in 43200 seconds.
```
`ping www.yahoo.com`

```
PING fd-fp3.wg1.b.yahoo.com (46.288.47.115): 56 ping bytes
64 btes from 46.288.47.115: icmp_seq=0 ttl=51 time=117.206 ms
64 btes from 46.288.47.115: icmp_seq=0 ttl=51 time= 128.777 ms
64 btes from 46.288.47.115: icmp_seq=0 ttl=51 time=130.305 ms
^C
--- fd-fp3.wg1.b.yahoo.com ping statistics ---
56 packets transmitted, 3 packets received, 94.6% packet loss
round-trip min/avg/max/stddev = 117.206/125.429/130.305/5.848 ms
```


----------



## Kristian Nushev (Mar 24, 2015)

too many lost packets


----------



## junovitch@ (Mar 24, 2015)

Way too many lost packets.  To start, what kind of card?  Show the lines around ath in the `dmesg` command.

I would attempt a bit of trial and error to see where the issue may be.  If you have some known good devices you can try some different combos like below.

FreeBSD -> 4G modem
FreeBSD -> known good wireless AP
Known good client -> 4G modem
Known good client -> known good wireless AP


----------



## Kristian Nushev (Mar 25, 2015)

`dmesg | grep ath`

```
ath0: <Qualcomm Atheros AR9565> mem 0x90900000-0x9097ffff irq 40 at device 0.0 on pci3
ath0: RX status length: 48
ath0: RX buffer size: 4096
ath0: TX descriptor lenght: 128
ath0: TX status lenght: 36
ath0: TX buffers per descriptor: 4
ath0 ath_edma_setup_rxfifo: type=0,, FIFA depth = 16 entries
ath0: ath_edma_setup_rxfifo: type=1, FIFO depth = 128 entries
ath0: [HT] enabling HT modes
ath0: [HT] enabling short-GI in 20MHz mode
ath0: [HT] 1 stream STBC receive enabled
ath0: [HT] 1 RX streams; 1 TX streams
ath0: AR9565 mac 704.1 RF5110 phy 2457.10
ath0: 2GHz radio 0x0000; 5GHz radio: 0x0000
ath0:ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping
ath0:ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping
ath0:ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping
ath0:ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping
ath0:ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping
ath0:ath_edma_recv_tasklet: sc_inreset_cnt > 0; skipping
```

According to me, the modem goes wrong somewhere and slows all traffic


----------



## junovitch@ (Mar 25, 2015)

OK, do a search for "FreeBSD AR9565" on your favorite search engine.  That is a newer card and there may be some rough edges.  It looks like there are some ideas out there that you may be able to try out.  A quick check may be dropping to a shell in an 11-CURRENT ISO and attempting to configure wireless temporarily that way.  There have been a ton of wireless improvements on 11 that haven't made it to 10 yet and that would be a good quick test to see if it's been fixed.  Otherwise, the search results may have some other ideas on what can be tried.  I'll check back in tomorrow, feel free to post up what you find out.


----------

