sábado, 20 de agosto de 2011

Tethering with Huawei u8110 in Ubuntu

Hi all,

the goal is to configure Ubuntu to be able to do tethering with Huawei u8110.

The first step is to create a new Network Connection, specifically a new Mobile Broadband connection. Go to System >> Preferences >> Network Connections >> Mobile Broadband.


Then click on Add. We will show a wizard that will guide us through the configuration.


In this wizard we have a lot of presets for almost all cell-phone companies around the globe. We will choose the correct one for us.

Finally we should add this two commands in the /etc/rc.local file to be executed when Ubuntu starts. They are to recognise the modem of the device (Huawei u8110) and to load the drivers.

#*****************************************************************
# Configure tethering for Huawei 8110u
sudo usb_modeswitch -W -v 12d1 -p 1031 -V 12d1 -P 1035 -M "5553424370ab71890600000080010a11060000000000000000000000000000" -s 20
sudo modprobe usbserial vendor=0x12d1 product=0x1035

exit 0


How to configure Host-only networking in VirtualBox 4. Ubuntu host and Windows guest.

Hi all,

after studying several manuals and howtos about VirtualBox and networking between the host machine and the guest machine I guess that I have find the short and easiest way to configure it using Host-only networking, for me the most complete option.

We will split the explanation in three parts: virtualbox, host and guest configuration.

If we follow all the steps we will be able to connect with the devices of the host's LAN and Internet.

By the way, you can find more information about VirtualBox networking information in http://www.virtualbox.org/manual/ch06.html.


First part. VirtualBox configuration.

It is the easiest step. We assume that when we have installed the VirtualBox packet the network virtual interface has been installed too. It is what usually happens. The name of this interface is vboxnet0.

To configure the interface in the program we must select the virtual machine target and press Settings >> Network. Then select Host-only adapter and select the name vboxnet0 for the adapter. It is not necessary to configure the advanced parameters.



Second part. Host configuration (in our case Ubuntu)


To configure the host basically we should activate the virtual interface assigning an IP and, configure the Iptables to perform NAT translation and enable the port forwarding to be able to communicate to the external machines (LAN or Internet). As we need to have it configured each time we switch on the host, we will put the required script in /etc/rc.local.

#*****************************************************************
# Configure virtual interface vboxnet0 for VirtualBox
echo "Setting up vboxnet0 interface..."
ifconfig vboxnet0 192.168.56.1 up

# *****************************************************************
# Enable NAT and fordwarding
echo "Enabling NAT and fordwarding..."
iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward

exit 0


Last part. Guest configuration (in our case Windows7)

Finally we power on the virtual machine and as it is Windows7 we configure the Local Area Connection as is shown in the following pic.




viernes, 19 de agosto de 2011

How to install a free VPN service in Ubuntu. PacketiX VPN.

Hi all,

this guide is to explain how to install and configure a free VPN service in Ubuntu or any Linux distribution. The free VPN service is PacketiX.NET which servers are located in Japan. You can find more information about this service in http://www.packetix.net.

I can say that if you follow all these steps the configuration will be easy and you will have a VPN service, very useful nowadays.

To be easiest and to save time you should do all operations being superuser:

sudo su


Installation

1. Located into your home directory "/home/userX/" download the vpnclient file from the web.

wget -c http://packetix.net/en/special/files/vpn2_5350_en/vpnclient-5350a-rtm-en-linux-x86.tar.gz

2. To compile the files zlib, openssl, readline and ncurses are nedeed.

apt-get install zlib1g-dev libreadline5-dev

3. Extract and compile.

tar -xzvf vpnclient-5350a-rtm-en-linux-x86.tar.gz
cd vpnclient*
make


4. Start the VPN service.

./vpnclient start

Configuration of the VPN service

1. Open the configuration service.

./vpncmd

You will see:

vpncmd command - PacketiX VPN Command Line Management Utility
PacketiX VPN Command Line Management Utility (vpncmd command)
Version 2.20 Build 5350 (English)
Compiled Oct 9 2007 01:27:58 by yagi at ILC308
Copyright (C) 2004-2007 SoftEther Corporation. All Rights Reserved.

By using vpncmd program, the following can be achieved.

1. Management of VPN Server or VPN Bridge
2. Management of VPN Clinet
3. Use of VPN Tools (certificate creation and communication speed measurement)

Select 1, 2 or 3:


2. Select option 2 Management of VPN Clinet.

You will see:

Specify the host name or IP address of the computer that the destination VPN Client is operating on.
If nothing is input and Enter is pressed, connection will be made to localhost (this computer).
Input destination:


Type 'localhost'.

Input destination: localhost
Connected to VPN Client “localhost“.
VPN Client>


3. Configure your connection.

VPN Client>niccreate
NicCreate command – Create New Virtual Network Adapter
Virtual Network Adapter Name: 0
The command terminated normally.


Now lets configure our account and connection

VPN Client>niclist
NicList command – Get List of Virtual Network Adapters
Item |Value
—————————-+———————————–
Virtual Network Adapter Name|0
Status |Enabled
MAC Address |00AC9D035CF6
Version |Version 2.20 Build 5350 (English)
The command terminated normally.

VPN Client>accountcreate
AccountCreate command – Create New VPN Connection Setting
Name of VPN Connection Setting: VPN
Destination VPN Server Host Name and Port Number: public.softether.com:443
Destination Virtual HUB Name: PUBLIC
Connecting User Name: PUBLIC
Used Virtual Network Adapter Name: 0
The command terminated normally.

VPN Client>accountlist
AccountList command – Get List of VPN Connection Settings
Item |Value
—————————-+———————————————–
VPN Connection Setting Name |VPN
Status |Offline
VPN Server Address |public.softether.com (Direct TCP/IP Connection)
Virtual Network Adapter Name|0
The command terminated normally.

VPN Client>accountconnect
AccountConnect command – Start Connection to VPN Server using VPN Connection Setting
Name of VPN Connection Setting: VPN
The command terminated normally.


Wait for a while and list the account again.

VPN Client>accountlist
AccountList command – Get List of VPN Connection Settings
Item |Value
—————————-+———————————————–
VPN Connection Setting Name |VPN
Status |Connected
VPN Server Address |public.softether.com (Direct TCP/IP Connection)
Virtual Network Adapter Name|0
The command terminated normally.


Set this as default connection everytime vpnclient started.

VPN Client>AccountStartupSet
AccountStartupSet command – Set VPN Connection Setting as Startup Connection
Name of VPN Connection Setting: VPN
VPN Client>quit


4. Check for the connection:

ifconfig vpn_0

vpn_0 Link encap:Ethernet HWaddr 00:ac:9d:03:5c:f6
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1603 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:463867 (463.8 KB) TX bytes:0 (0.0 B)


Configuration of the routing tables

This part is to route the connection to packetix server through your default gateway (usually wlan0 gateway).

Route connection to packetix vpn (130.158.6.0/24) through main gateway (192.168.1.1).

route add -net 130.158.6.0/24 gw 192.168.1.1

Adquire an IP adress from VPN server using DHCP.

dhclient vpn_0

Route all output connections to VPN gw

ip route del default via 192.168.1.1
ip route add default via 10.0.0.1 dev vpn_0


Or only route specific destinations through VPN gw

ip route del default via 10.0.0.1 dev vpn_0
route add -net 216.152.78.0/24 gw 10.0.0.1