Ubuntu:Feisty/Networking

From

Jump to: navigation, search

Contents

Networking


How to activate/deactivate network connections

  • Read #General Notes
  • System -> Administration -> Network
  • Network settings
Connections Tab -> Select "Ethernet connection" -> Activate/Deactivate

Note: in Feisty, the network names have changed. Instead of "Ethernet connection", you may have "Wireless connection", "Wired connection" and "Modem connection". Also, they don't have an Activate/Deactivate option. Instead, go to "Properties", and activate or deactivate from there.

How to configure network connections

  • Read #General Notes
  • System -> Administration -> Networking
  • Network settings
Connections Tab -> Select "Ethernet connection" -> Properties
Connection -> Enable this connection (Checked)
Connection Settings -> Configuration: Select "DHCP/Static IP address"
DNS Tab -> DNS Servers -> Add/Delete

How to configure dialup connections

sudo pppconfig
  • To connect dialup
pon provider_name
  • To disconnect dialup
poff

How to configure broadband connections

sudo pppoeconf

How to change computer name

  • Read #General Notes
  • System -> Administration -> Networking
  • Network settings
General Tab -> Host Settings -> Hostname: Specify the computer name 
  • Save and close all opened applications, Reboot computer

Alternatively

gksudo gedit /etc/hostname

Change your hostname Also take a look at /etc/hosts. And change your old name to your new one too.

How to change computer descriptions

sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
gksudo gedit /etc/samba/smb.conf
  • Find this line
...
  server string = %h server (Samba, Ubuntu)
...
  • Replace with the following line
  server string = new_computer_descriptions
  • Save the edited file
sudo testparm
sudo /etc/init.d/samba restart

How to change computer Domain/Workgroup

sudo cp /etc/samba/smb.conf /etc/samba/smb.conf_backup
gksudo gedit /etc/samba/smb.conf
  • Find this line
...
  workgroup = MSHOME
...
  • Replace with the following line
  workgroup = new_domain_or_workgroup
  • Save the edited file
sudo testparm
sudo /etc/init.d/samba restart

How to use dynamic IP addressing for your host using the free DynDNS service

Maintain Dynamic IP address with IPcheck utility
sudo apt-get install ipcheck
gksudo gedit /etc/ppp/ip-up.d/dyndns_update
  • Insert the following lines into the new file, replacing "myusername" and "mypassword" with your unique username and password.
 #!/bin/sh

 USERNAME=myusername
 PASSWORD=mypassword
 HOSTNAME=myhostname.dyndns.org

 cd /root/
 if [ -f /root/ipcheck.dat ]; then
  ipcheck -r checkip.dyndns.org:8245 $USERNAME $PASSWORD $HOSTNAME
 else
  ipcheck --makedat -r checkip.dyndns.org:8245 $USERNAME $PASSWORD $HOSTNAME
 fi
  • Save the edited file
sudo chmod 700 /etc/ppp/ip-up.d/dyndns_update
sudo sh /etc/ppp/ip-up.d/dyndns_update
Maintain Dynamic IP address with ddclient utility
  • Install ddclient from Synaptic Package manager or from the command line:
sudo apt-get install ddclient
  • Edit the ddclient configuration file:
sudo gedit /etc/ddclient.conf
  • Place the following in the file:
protocol=dyndns2
use=web, web=checkip.dyndns.org
server=members.dyndns.org
#
login=my_dyndns_id # (Use the Account Login username you set up at DynDNS)
password='my_dyndns_password' # (Use the Account Login user password you set up at DynDNS)
# (include the quotation marks)
foobar1.dyndns.org # (Use the URL you selected at DynDNS)
# foobar2.dyndns.org # (Use the second URL you selected, if any)
# foobat3.dyndns.org # (Use the third URL you selected, if any)
# fooball4.dyndns.biz # (Use the fourth URL you selected, if any)
# toaster5.homelinux.org # (Use the fifth URL you selected, if any)
  • Restart ddclient:
sudo /etc/init.d/ddclient restart

How to share folders the easy way

Right click on folder -> Share folder
Shared folder -> Share with: Select "SMB"
Share properties -> Name: Specify the share name

How to browse network computers

Places -> Network Servers

How to access network folders without mounting

  • In this example:
Network computer's IP: 192.168.0.2
Shared folder's name: linux
  • Press 'Alt+F2' (Run Application...) and enter:
smb://192.168.0.2/linux

How to mount/unmount network folders manually, and allow all users to read

  • In this example:
Network computer's IP: 192.168.0.2
Network computer's Username: myusername
Network computer's Password: mypassword
Shared folder's name: linux
Local mount folder: /media/sharename
  • To mount network folder:
sudo mkdir /media/sharename
sudo mount //192.168.0.2/linux /media/sharename/ -o username=myusername,password=mypassword
  • To unmount network folder:
sudo umount /media/sharename/

How to mount/unmount network folders manually, and allow all users to read/write

  • In this example:
Network computer's IP: 192.168.0.2
Network computer's Username: myusername
Network computer's Password: mypassword
Shared folder's name: linux
Local mount folder: /media/sharename
  • To mount network folder:
sudo mkdir /media/sharename
sudo mount //192.168.0.2/linux /media/sharename/ -o username=myusername,password=mypassword,dmask=777,fmask=777
  • To unmount network folder:
sudo umount /media/sharename/

How to mount network folders on boot-up, and allow all users to read

apt-get install smbfs
  • In this example:
Network computer's IP: 192.168.0.2
Network computer's Username: myusername
Network computer's Password: mypassword
Shared folder's name: linux
Local mount folder: /media/sharename
sudo mkdir /media/sharename
gksudo gedit /root/.smbcredentials
  • Insert the following lines into the new file:
username=myusername
password=mypassword 
  • Change the privileges of the saved file:
sudo chmod 700 /root/.smbcredentials
  • Copy a backup of the fstab file then edit the fstab file with the mounting options:
sudo cp /etc/fstab /etc/fstab_backup
gksudo gedit /etc/fstab
  • Append the following line at the end of file:
//192.168.0.2/linux    /media/sharename smbfs  credentials=/root/.smbcredentials    0    0

How to mount network folders on boot-up, and allow all users to read/write

  • In this example:
Network computer's IP: 192.168.0.2
Network computer's Username: myusername
Network computer's Password: mypassword
Shared folder's name: linux
Local mount folder: /media/sharename
sudo mkdir /media/sharename
gksudo gedit /root/.smbcredentials
  • Insert the following lines into the new file:
username=myusername
password=mypassword
  • Change the rpivileges of the .smbcredentials file:
sudo chmod 700 /root/.smbcredentials
  • Make a backup copy and then edit the fstab file (which has the mounting options):
sudo cp /etc/fstab /etc/fstab_backup
gksudo gedit /etc/fstab
  • Append the following line at the end of file:
//192.168.0.2/linux    /media/sharename smbfs  credentials=/root/.smbcredentials,dmask=777,fmask=777  0    0

How to get ipw2200 and WPA to work

Under Feisty, WPA works right out of the box with network manager.

How to get ipw3945 and wep/wpa to work

Under Feisty, the driver for Intels ipw3945 is loaded by default, no configuration is needed.

How to get Broadcom BCM4318 wireless card to work

Install the driver::

sudo apt-get install bcm43xx-fwcutter

How to Configure and start PPTP tunnels (VPN)

You can use NetworkManager which comes with Feisty.

  • Configure VPN with Network Manager

In a terminal

sudo apt-get install network-manager-pptp

Restart after install.

To setup a VPN:

NetworkManager Icon in the tray-->VPN Connections->Configure VPN

Use the defaults and be sure to check the box:

Authentication: Refuse EAP

To get my connection to work I also had to check:

Compression & encryption: Require MPPE Encryption
 

Alternative programs:

OR
  • Install manually
wget -c http://linux.edu.lv/uploads/content/pptp.tar.gz
tar zxvf pptp.tar.gz
cd ./pptp/
sudo sh install
cd ..
  • Configure a PPTP Client:
gksudo gedit /usr/share/applications/pptpconfig.desktop
  • Replace content of this file with the following lines:
[Desktop Entry]
Name=PPTP Client
Comment=Configure and start PPTP tunnels (VPN)
Categories=Application;Network
Encoding=UTF-8
Exec=gksudo pptpconfig
Icon=gnome-remote-desktop.png
StartupNotify=true
Terminal=false
Type=Application
  • The above lines change the default file in three ways: the application is placed in the Application/Internet category, gksudo will make the application run as superuser and an icon appears in the menu.
  • Start the client:
Applications -> Internet -> PPTP Client

How to setup a PGP key with Seahorse and Evolution

  • Install:
apt-get install seahorse
Applications --> Accessories --> Passwords and Encryption Keys
Key --> Create New Key
  • Select "PGP Key", then fill out information. Ensure that you use your real email address.
  • Right-click on the key entry to export, sync or publish your key.
  • Evolution should now hopefully see the key transparently.

How to Setup BIND DNS Server

  • The BIND DNS Server is installed as a meta-package in Feisty.
System-->Administration-->Synaptic Package Manager-->Mark packages by task-->DNS server

This will install all dependencies and configuration files.

  • Alternatively, you can install from the command line (see this reference):
sudo apt-get install bind9
  • Configure the main Bind files. Usually, if you install Bind from the source code, you will have to edit the file named.conf. However, Ubuntu provides you with a pre-configured Bind, so we will edit another file:
gksudo gedit /etc/bind/named.conf.local

A zone is a domain name that is referenced in the DNS server. Insert the zones in the named.conf.local file:

# This is the zone definition. replace example.com with your domain name
zone "example.com" {
       type master;
       file "/etc/bind/zones/example.com.db";
};

# This is the zone definition for reverse DNS. replace 0.168.192 with your 
# network  address in reverse notation - e.g my network address is 192.168.0
zone "0.168.192.in-addr.arpa" {
    type master;
    file "/etc/bind/zones/rev.0.168.192.in-addr.arpa";
};
  • Ok, now, let's edit the options file:
sudo -e /etc/bind/named.conf.options
  • We need to modify the forwarder. This is the DNS server to which your own DNS will forward the requests he cannot process.
forwarders {
      # Replace the address below with the address of your provider's DNS server
      123.123.123.123;
};
  • Now, let's add the zone definition files (replace example.com with your domain name):
sudo mkdir /etc/bind/zones
sudo -e /etc/bind/zones/example.com.db
  • The zone definition file is where we will put all the addresses / machine names that our DNS server will know. You can take the following example:
; replace example.com with your domain name. do not forget the . after the domain name!
; Also, replace ns1 with the name of your DNS server
example.com.      IN      SOA     ns1.example.com. admin.example.com. (
; Do not modify the following lines!
                                                        2006081401
                                                        28800
                                                        3600
                                                        604800
                                                        38400
 )
;
; Replace the following line as necessary:
; ns1 = DNS Server name
; mta = mail server name
; example.com = domain name
example.com.      IN      NS              ns1.example.com.
example.com.      IN      MX     10       mta.example.com.
;
; Replace the IP address with the right IP addresses.
www              IN      A       192.168.0.2
mta              IN      A       192.168.0.3
ns1              IN      A       192.168.0.4
  • Create the reverse DNS zone file:
sudo -e /etc/bind/zones/rev.0.168.192.in-addr.arpa
  • Copy and paste the following text, modify as needed:
;replace example.com with yoour domain name, ns1 with your DNS server name.
; The number before IN PTR example.com is the machine address of the DNS server. in my case, it's 4, as my IP address is 192.168.0.4.
@ IN SOA ns1.example.com. admin.example.com. (
                        2006081401;
                        28800; 
                        604800;
                        604800;
                        86400 
)
;
                     IN    NS     ns1.example.com.
4                    IN    PTR    example.com
  • Restart bind:
sudo /etc/init.d/bind9 restart
  • Test the new DNS server...
  • Modify the file resolv.conf with the following settings:
sudo -e /etc/resolv.conf
  • Enter the following:
// replace example.com with your domain name, and 192.168.0.4 with the address of your new DNS server.
search example.com
nameserver 192.168.0.4
  • Test your DNS:
dig example.com

Connect to Internet using mobile phone/GPRS/EDGE

How to set up internet connection sharing

How to resolve Netbios hostnames

  • Read #General Notes
  • System -> Administration -> Network
  • Network settings
sudo gedit /etc/nsswitch.conf
  • Find this line
hosts:          files dns
  • Replace with the following line
hosts:          files dns wins
  • Save the edited file
sudo apt-get install winbind
Personal tools
Sponsor
LinuCity