# USB Ethernet: Specifying MAC address



## dgauze (Dec 7, 2009)

Hello to all. Glad to be a part of these forums. I have just installed FreeBSD 8, and am currently using the ue0 driver for USB ethernet.

I have the line ifconfig_ue0="DHCP" in my rc.conf file. 

I'm wondering if there's a way to specify a MAC address instead of having the system fake one at every startup?

The reason I ask is that every time I reboot the system, I lose my internet connection. If I reset my modem and reboot again, I regain a conection most of the time. I'm guessing it's because of the MAC address. Any suggestions?

Thanks.


----------



## malexe (Dec 14, 2009)

You usb device should already have it is own mac address. Is there a reason you want to fake your mac address ?


----------



## dgauze (Dec 16, 2009)

Hello malexe. The modem I use is a generic one, and I can see during boot that the MAC address is slightly different each time I start up. My device is a cable modem, and it has a MAC address specified on the label. However, the Mac address listed for the driver ue0 on boot is different.


----------



## dgauze (Dec 16, 2009)

And I believe that the different MAC addresses at each boot are the reason the connection to the internet does not work properly. Maybe ebcause the ip address provided by the ISP is tied to a certain mac address? Any ideas?


----------



## mk (Dec 16, 2009)

change from command line
`# ifconfig ue0 ether _your_mac_address_`
in /etc/rc.conf

```
ifconfig_ue0="DHCP"
ifconfig_ue0_alias0="ether _your_mac_address_"
```


----------



## dgauze (Dec 16, 2009)

mk said:
			
		

> change from command line
> 
> ```
> ifconfig_ue0="DHCP"
> ...



I tried this, and although I can now change the MAC address, after booting I don't have an IP. I have to manually run dhclient to get an address, even though I have ifconfig_ue0="DHCP" in rc.conf.

I believe it says waiting for defaul route .... and times out.

Any ideas?


----------



## crsd (Dec 16, 2009)

What about:

```
ifconfig_ue0="ether xx:xx:xx:xx:xx:xx DHCP"
```


----------



## dgauze (Dec 16, 2009)

crsd said:
			
		

> What about:
> 
> ```
> ifconfig_ue0="ether xx:xx:xx:xx:xx:xx DHCP"
> ```



Nope, didn't work. Here is the device:

```
ugen3.3: <vendor 0x0bb2> at usbus3
cdce0: <vendor 0x0bb2 product 0x6098, class 2/0, rev 1.10/1.01, addr 3> on usbus3
cdce0: no valid alternate setting found!
device_attach: cdce0 attach returned 6
cdce0: <vendor 0x0bb2 product 0x6098, class 2/0, rev 1.10/1.01, addr 3> on usbus3
cdce0: faking MAC address
ue0: <USB Ethernet> on cdce0
ue0: Ethernet address: 2a:82:17:00:00:00
```

Then there is a timeout waiting for route interface. DHCP works, but only using dhclient after boot.


----------

