Mês: dezembro 2015

Setup DHCP Server on Ubuntu

Sometimes you need to connect a device (Raspberry, IP Cam) directly to the PC. As these devices are mostly configured with dynamic IP, you need to setup a dhcp server.

sudo apt-get install dhcp3-server

Set to start manually if you do not want this service on your PC

sudo /etc/init.d/isc-dhcp-server stop
sudo sh -c "echo 'manual' > /etc/init/isc-dhcp-server.override"

Configure the INTERFACES setting to include eth0
Edit file: /etc/default/isc-dhcp-server , and change


Configure DHCP to assign network addresses in the range to
Edit File: /etc/dhcp/dhcpd.conf , add apppend.
> sudo nano /etc/dhcp/dhcpd.conf

subnet netmask { #network
 range; # Range
 option domain-name-servers,; #Pri DNS , Sec DNS
 option routers; #Gateway
 option broadcast-address; #Broadcast
 default-lease-time 600;
 max-lease-time 7200;


Configure Network (new Ethernet)

1. Open:


2. Add new Ethernet


3. Configure Static IP


4. Connecte in the newly created network

Start DHCP Server

# start DHCP service
sudo service isc-dhcp-server start

# enable forwarding from the ethernet to wireless router
sudo /sbin/iptables --table nat -A POSTROUTING -o wlan0 -j MASQUERADE

Testing the connection

tail /var/log/syslog

Testing the connection



Bluetooth audio from Phone to Ubuntu

This is a short guide to how to send audio from your phone (tested on Android) to your PC (tested on Ubuntu).

I have not found how to enable the functionality in the system settings (PC side)

Support is already implemented in PulseAudio

Now you’ll have to pair the computer with the phone as per normal.

Method 1 – Using GUI (D-FEET)

Use a tool called d-feet, which is available in the Ubuntu repos.

$> sudo apt-get install d-feet

Open d-feet  and find your phone device


Click in Connect on org.bluez.AudioSource , and then click Execute in the dialog that will open

Method 2 – Using Script / Command Line

export BTADAPTER=`dbus-send --system --dest=org.bluez --print-reply / org.bluez.Manager.DefaultAdapter | tail -1 | sed 's/^.*"\(.*\)".*$/\1/'`

dbus-send --system --dest=org.bluez --type=method_call --print-reply \
$BTADAPTER/dev_1C_56_FE_A3_EC_0C org.bluez.AudioSource.Connect

Now all audio from your phone should be streaming through your computer

If this method did not work, check the complete guide in reference: