Marius van Witzenburg We fight for our survival, we fight!

26Jun/110

How to configure a automatically native IPv6 connection on FreeBSD

Posted by mariusvw

First you need to install a DHCP client

cd /usr/ports/net/dhcp6
make install clean

Setup config for dhcp6c

cp /usr/local/etc/dhcp6c.conf.sample /usr/local/etc/dhcp6c.conf
vi /usr/local/etc/dhcp6c.conf

Add the following

interface em0 {
    send ia-pd 0;
};
 
id-assoc pd {
    prefix-interface em0 {
        sla-id 1;
    };
};

Add the following to /etc/rc.conf

ipv6_enable="YES"
ipv6_network_interfaces="em0"
ipv6_defaultrouter="fe80::%em0"
dhcp6c_enable="YES"
dhcp6c_interfaces="em0"

Run the IPv6 startup script.

/etc/rc.d/network_ipv6 restart

Now startup the client

/usr/local/etc/rc.d/dhcp6c start

To test the connection you should be able to ping XS4ALL.

ping6 xs4all.nl

You also might want to check out these posts for some more information:
How to use a PPPoE or PPPoA connection of XS4ALL on FreeBSD

How to configure IPv6 DHCP client for XS4ALL on FreeBSD

How to configure a IPv6 gateway for XS4ALL on FreeBSD

14Jun/110

How to configure DHCP for IPv4 on FreeBSD

Posted by mariusvw

First install the required ports from the ports directory

cd /usr/ports/net/isc-dhcp41-server
make install clean

Then lets start configuring :-)

Copy the sample config to its location or directly create a new file named dhcpd.conf.

cd /usr/local/etc/
cp dhcpd.conf.sample dhcpd.conf

Edit the config to your needs or use my example below

# dhcpd.conf
 
# option definitions common to all supported networks...
option domain-name-servers 192.168.1.1;
 
default-lease-time 600;
max-lease-time 7200;
 
# Use this to enble / disable dynamic dns updates globally.
ddns-update-style none;
 
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
authoritative;
 
# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7; 
 
# Prevent duplicates!
deny duplicates;
 
 
subnet 192.168.1.0 netmask 255.255.255.0 {
    range 192.168.1.40 192.168.1.49;
    option routers 192.168.1.254;
#option domain-name-servers 192.168.1.2;
    option subnet-mask 255.255.255.0; 
    option broadcast-address 192.168.1.255;
    option nntp-server 192.168.1.64;
}

Now add the right boot values to /etc/rc.conf.

# DHCPD
dhcpd_enable="YES"                          # dhcpd enabled?
dhcpd_flags="-q"                            # command option(s)
dhcpd_ifaces="em0"                          # ethernet interface(s)
# If compiled with paranoia support (the default), the following lines are also supported:
dhcpd_chuser_enable="YES"                   # runs w/o privileges?
#dhcpd_chroot_enable="YES"                  # runs chrooted?

This should do the trick, now lets fire up!

/usr/local/etc/rc.d/isc-dhcpd start

If everything went fine you should be able to use your DHCP service now :-)

Tagged as: , , No Comments
13Jun/110

How to configure a IPv6 gateway for XS4ALL on FreeBSD

Posted by mariusvw

You might first need these two manuals.

How to use a PPPoE or PPPoA connection of XS4ALL on FreeBSD

How to configure IPv6 DHCP client for XS4ALL on FreeBSD

Configuring your server as a router is quite simple.

First edit /etc/rc.conf and add the following

ipv6_ifconfig_em0="2001:980:5E29::1 prefixlen 64"
ipv6_defaultrouter="-interface tun0"
ipv6_gateway_enable="YES"
rtadvd_enable="YES"
rtadvd_interfaces="em0"

This configures IPv6 for your interface and tells it to function as a gateway.

Now setup the config for rtadvd so it will give out the right IP range. Edit /etc/rtadvd.conf

em0: \
:addr="2001:980:5E29::":prefixlen#64:

Now fire up a client connected to the LAN side on em0 and visit the following page to check if you are using IPv6:

http://www.xs4all.nl/klant/veiligheid/mijnip.php

Another useful page with information how to configure IPv6 on your server is in the FreeBSD handbook.

12Jun/110

How to configure IPv6 DHCP client for XS4ALL on FreeBSD

Posted by mariusvw

For this installation you might be required to first establish the connection, check: How to use a PPPoE or PPPoA connection of XS4ALL on FreeBSD.

First you need to install a DHCP client

cd /usr/ports/net/dhcp6
make install clean

Setup config for dhcp6c

cp /usr/local/etc/dhcp6c.conf.sample /usr/local/etc/dhcp6c.conf
vi /usr/local/etc/dhcp6c.conf

Add the following

interface tun0 {
    send ia-pd 0;
};
 
id-assoc pd {
    prefix-interface em1 {
        sla-id 1;
    };
};

Add the following to /etc/rc.conf

dhcp6c_enable="YES"
dhcp6c_interfaces="tun0"
ipv6_enable="YES"
ipv6_defaultrouter="fe80::%tun0"

Now startup the client

/usr/local/etc/rc.d/dhcp6c start

As last set the default route

route add -inet6 default -interface tun0

To test the connection you should be able to ping XS4ALL.

ping6 xs6.xs4all.nl
11Jun/110

How to install a IPv4 DHCP server on FreeBSD

Posted by mariusvw

This manual describes how to install a DHCP daemon for IPv4 usage.

First install the required port.

cd /usr/ports/net/isc-dhcp41-server/
make install clean

Build dhcpd config

# dhcpd.conf
 
# option definitions common to all supported networks...
#option domain-name "server.domain.tld";
option domain-name-servers 172.22.21.1;
 
default-lease-time 300;
max-lease-time 3600;
 
# Use this to enble / disable dynamic dns updates globally.
ddns-update-style none;
 
# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
authoritative;
 
# Use this to send dhcp log messages to a different log file (you also
# have to hack syslog.conf to complete the redirection).
log-facility local7; 
 
# Prevent duplicates!
deny duplicates;
 
### LAN 1 ###
subnet 172.22.21.0 netmask 255.255.255.0 {
    range 172.22.21.40 172.22.21.49;
    option routers 172.22.21.254;
#option domain-name-servers 172.22.21.1;
    option subnet-mask 255.255.255.0; 
    option broadcast-address 172.22.21.255;
    option nntp-server 172.22.21.1;
}
 
### 
# Fixed-address
###
 
# Servers
host iserver {
    hardware ethernet 10:9c:dd:4f:91:27;
    fixed-address 172.22.21.9;
}
host nature {
    hardware ethernet 00:27:bb:6b:c8:4b;
    fixed-address 172.22.21.253;
}

Configure boot settings for dhcpd

# DHCPD
dhcpd_enable="YES"                          # dhcpd enabled?
dhcpd_flags="-q"                            # command option(s)
dhcpd_ifaces="em0"                          # ethernet interface(s)
# If compiled with paranoia support (the default), the following lines are also supported:
dhcpd_chuser_enable="YES"                   # runs w/o privileges?
#dhcpd_chroot_enable="YES"                  # runs chrooted?

Now you should be able to startup your DHCP service

/usr/local/etc/rc.d/isc-dhcpd start
Tagged as: , , , No Comments
23Jul/105

iMac or Macbook (Pro), Self Assigned IP Address problem with Wifi Airport connections

Posted by mariusvw

I was having an issue with my Macbook Pro lately that the DHCP client couldn't get an IP from the DHCP server. This happened on different networks and it didn't happened every time. The message in the network settings was: "Self Assigned IP Address". After a while I really wanted to have a solution for this so I started spitting in the logs first...

I ended with no result at all, but suddenly I remembered that other programs might behave weird when their preference files are corrupted or if there are mistakes in them.

Then I found the following file:

/Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist

I first turned off my airport before doing any action to this file.

I opened the file to sniff around and there it was, a missing close tag in the XML. I first fixed this, without no result as expected. Then I moved the file to my desktop, compressed it, trashed the original file and cleared my trash. Then I turned back on the Airport and clicked my network... It connected, since then my wireless problems are solved :-)

The error you see in the network preferences reads as follows: AirPort has the self-assigned IP address 169.254.67.44 and will not be able to connect to the internet.. But I'm sure you will notice that as soon you have this problem ;-)