Tag Archives: windows

Windows 7 IPv6 auto-assignment fix

For some reason, Microsoft decided that Windows 7 would autoconfigure IPv6 using a random identifier (not the MAC address / EUI-64) – they went on to decide that it would randomly assign temporary addresses which change constantly.  This is an admin nightmare, not to mention *awful* when it comes to assigning DNS.

So, here’s how to make Windows 7 behave as per every other OS…

1. Open up a Command Prompt in Administrator mode (right-click, run as administrator)

2. Run the following commands.  Each one should respond “Ok”.  If you didn’t do step 1 correctly, it will say the command required elevation.

netsh interface ipv6 set privacy state=disabled store=active
netsh interface ipv6 set privacy state=disabled store=persistent
netsh interface ipv6 set global randomizeidentifiers=disabled store=active
netsh interface ipv6 set global randomizeidentifiers=disabled store=persistent

3. Exit the command prompt, and reboot.

When your computer has rebooted, it should auto-configure itself using EUI-64 (based on the MAC address of the interface) within the subnet given in the router advertisement.

Installing Samba (for windows file sharing) in FreeBSD

People keep telling me that they have trouble getting Samba to work properly.  I found it difficult to get working properly too, so here’s a guide that should make it a lot easier…

First of all, we need to install it!  Make sure you have updated your Ports tree (see other posts) and then, as root:

cd /usr/ports/net/samba34
make config

This will show the configuration dialog box for options for the port.  Using the space bar and cursor keys, deselect ALL the options, and then enable only these:


Press TAB to go to OK and press enter.  Now you can build and install the port with:

make install distclean

It will go off and install dependencies if it needs to.  If you see any other configuration boxes, just accept the defaults and move on.

This takes a while as it has to install quite a few packages/ports, mostly for the file alteration monitor support – but it’s worth it so be patient.  If you already have X/gnome2 installed, this process will be much quicker.

Once the port is installed, we need to make a few changes to the limits within FreeBSD to make samba a little happier…  edit /etc/sysctl.conf and add the following:


And we also need to add another kernel module.  edit /boot/loader.conf and add the following:


Now, we need to tell samba to start on bootup, edit /etc/rc.conf and add the following:


And finally, we need to make ourselves a config file.  Edit /usr/local/etc/smb.conf and remove its entire contents.  Replace with the following template:

server string = Server Name
interfaces = em0
bind interfaces only = Yes
map to guest = Bad User
passdb backend = tdbsam
log file = /var/log/samba34/log.%m
max log size = 500
name resolve order = wins lmhosts bcast host
load printers = No
os level = 10
preferred master = No
domain master = No
dns proxy = No
wins support = No
ldap ssl = no
hosts allow =,,
hosts deny =
case sensitive = Yes
level2 oplocks = Yes
oplocks = Yes

comment = Temp Folder
path = /tmp
guest only = Yes
guest ok = Yes
read only = No

Replace ‘interfaces’ with your network interface name (mine is em0)

Your windows netbios name, by default, will be the hostname of your FreeBSD server up to the first dot.  E.g. for test.dan.me.uk the netbios name is TEST.

Reboot to startup samba with all the relevant changes.  Browse to the server and you will see “tmp” share which is a user nobody access to /tmp.

Check the samba documentation on how to define other shares, such as per-user homedir shares.

NDIS WiFi Drivers in FreeBSD (Project Evil)

Sooo… if you have a WiFi card that doesn’t have native FreeBSD drivers, you might be able to use ‘Project Evil’ to wrap around the Windows driver for the card.  I had to do this on my new netbook…

First, you should install libiconv if you haven’t already.  The easiest way is to do:

pkg_add -r libiconv

Next, you need to obtain the Windows driver for the network card (I find that windows 2000 drivers are generally the most reliable).  You need the .INF and .SYS files from the driver package.  Place these somewhere on your FreeBSD computer (I put mine into /drv/)

Now we need to convert them into an NDIS kernel module…  In my case, the files are called net8192se.inf and rtl8192se.sys (RealTek 8191SE 802.11n wireless).  To convert them, type (as root):

ndisgen /drv/net8192se.inf /drv/rtl8192se.sys

Press enter until you’re returned to the command prompt, and you will now see a .ko file with the kernel module in.  This is named after the .sys file – so in my case, it is called rtl8192se_sys.ko.  Copy this file to the /boot/modules/ folder like so:

mv rtl8192se_sys.ko /boot/modules/

and you can activate it by adding the following line to /boot/loader.conf:


You can also load the driver without rebooting by typing:

kldload rtl8192se_sys

This will give you some output to the console – e.g. on my netbook:

ndis0: <Realtek RTL8191SE Wireless LAN 802.11n PCI-E NIC> port 0x3000-0x30ff mem 0xfa000000-0xfa003fff irq 17 at device 0.0 on pci3
ndis0: [ITHREAD]
ndis0: NDIS API version: 5.1

If you get this far, you should be ready to go.  Check my other posts for how to configure WiFi in FreeBSD.