Showing posts with label networking. Show all posts
Showing posts with label networking. Show all posts

Tuesday, August 19, 2014

Remmina - Unable to connect RDP Server

Have you ever encountered sudden failure to RDP to your Windows desktop using Remmina? There are two known reasons to me:

  1. your RDP plugin for Reminna is missing. In Fedora, type sudo yum install remmina-plugins-rdp, or Ubuntu sudo apt-get install remmina-plugin-rdp. You may require to reboot after install in order to load the RDP plugin. Sometimes Import simply won't work.
  2. your remote desktop's fingerprint has changed. It is impossible to reset the fingerprint within Remmina's interface. What you can do is fire up terminal, go to ~/.freerdp/ and delete known_hosts.
Now try again and voila! Your remote desktop is back!

Thursday, January 16, 2014

Problem connecting Xrdp

If the error appeared as "problem connecting" when connecting to remote desktop using xrdp, it is most likely the remote Linux does not have VNC server installed.

(1) To verify this, you can type:
sudo tail /var/log/xrdp-sesman.log

(2) If you see the error message below, then it means you don't have VNC server installed.
[ERROR] another Xserver is already active on display xx 

(3) To fix this, simply run this command:
sudo apt-get install tightvncserver

(4) After that, restart xrdp service by running:
sudo service xrdp restart

Here's why:
xrdp is the daemon that handles RDP remote desktop access from Windows machines to your Linux Mint PC. But it's not enough to install only xrdp - you need a VNC server. Unfortunately it's not automatically installed with the xrdp package.

The error message "error - problem connecting" after a successful login message isn't very helpful either. Searching the Internet can drive you in circles - I wasted at least 2 hours on finding out that I forgot to install the VNC server - ouch.

Thanks powerhouse from Linux Mint forum who shared this useful information.

Wednesday, August 7, 2013

Fast apt-get with apt-fast

Ever experience slow download even with 10Mbps++ internet? The author has written a very useful article to share how to speed everything up with apt-fast:

Saturday, August 3, 2013

[Ubuntu] Can access samba network share by IP but not Netbios name from Windows

After whole long day of troubleshooting why we cannot resolve samba shared folders using the NetBIOS Name defined in smb.conf.. finally I have figured out the root of the problem:
Hostname CANNOT equal to NetBIOS name!!!
A bit of background...

  1. our server hostname is server1
  2. our NetBIOS name is server1 (defined in smb.conf)
  3. IP-address is 10.0.0.2

From Windows 7 / OSX we can access the samba shares using \\10.0.0.2\share, as well as \\server1.local\share (the .local is a result of running avahi-daemon). We can also ping 10.0.0.2 or server1 or server1.local, but we simply cannot access with \\server1\share

By changing the Hostname in /etc/hosts & /etc/hostname to any name other than "server1", or change the NetBIOS name in smb.conf to any other name, we can now get it work.

This is rather weird for a Windows user like me, where only hostname need to be set and we can access directly from other PC in the network without bothering what is NetBIOS. Linux is indeed too tricky!

Anyway, kind of fun when able to figure out what's wrong. It makes me love and hate Linux at the same moment!

Monday, April 29, 2013

[Ubuntu] Wireless stop working after upgrade

If wireless fail to work after upgrade, be sure to use lspci | grep network to look for your wireless device and include this info when you post online for help.

If you're using Broadcom BCM4312 (full name: "Broadcom Corporation BCM4312 802.11b/g LP-PHY (rev 01)") same as mine, then you probably could easily fix by installing the following:
sudo apt-get install firmware-b43-installer b43-fwcutter
or try another one if the above doesn't work:
sudo apt-get install broadcom-sta-common
You're adviced to reboot your system, but before that you may try:

  1. off & on your wireless device, it may work straight away without system reboot.
  2. run command modprobe b43

If you choose to reboot and the wireless device doesn't start, try modprobe b43. To autoload the device at startup, edit /etc/modules, add "b43" to the list. That should load it during startup.

Good luck!

Thursday, February 28, 2013

[Ubuntu] Xrdp password failed after user password changed

If the password of users has been changed, Xrdp service must be restarted to reflect the changes made. Else, it would give an error of either "password failed" or "login error".

To restart xrdp service, simply type this command in terminal:
/etc/init.d/xrdp restart


After that you should be able to login from remote connection.

Saturday, February 23, 2013

[Ubuntu] Temporarily / Permanently Mount Cifs Network Shares

It is strange that Ubuntu 12.10 doesn't come with cifs-utils installed. Whenever you try to mount a network folder via mount -t cifs -o username=user,password=pass //server-name/shared /mnt/shared, it will give you the following error message:

1:  mount: wrong fs type, bad option, bad superblock on //192.168.0.11/Dropbox,  
2:      missing codepage or helper program, or other error  
3:      (for several filesystems (e.g. nfs, cifs) you might  
4:      need a /sbin/mount.<type> helper program)  
5:      In some cases useful info is found in syslog - try  
6:      dmesg | tail or so  

Execute dmesg | tail will return the following result:

1:  [ 5537.959706] CIFS VFS: Connecting to DFS root not implemented yet  
2:  [ 5537.959815] CIFS VFS: cifs_mount failed w/return code = -22  

To solve this, simply apt-get install cifs-utils. After that run the same command again and you should be able to mount the network shared folder.

To permanently mount the shared folders, go to /etc/fstab, and add the following line:

1:  //server-name/shared     /mnt/shared     cifs     defaults,_netdev,credentials=/home/user/.smbcredentials     0     0  

_netdev parameter is being explained at the last section of this documentation, which in general mean connect only when network is available:
https://help.ubuntu.com/community/MountWindowsSharesPermanently

credentials and /home/user/.smbcredentials is a file created to store the username and password for the remote login, so that we don't put these sensitive info at risk because the /etc/fstab can be viewed by every users on the system. DO NOT forget to set the file permission for the .smbcredentials:

1:  chmod 600 /home/user/.smbcredentials  

Now enjoy working with your network shares!

If you would like to read on, the following articles is good to go:
  1. https://help.ubuntu.com/community/Samba/SambaClientGuide
  2. https://wiki.ubuntu.com/MountWindowsSharesPermanently
  3. https://help.ubuntu.com/community/MountWindowsSharesPermanently




Sunday, February 17, 2013

How to deal with space in file path?

In modern computing, we are not restricted to use file/folder name with space between each words. This tends to create trouble if we want to mount the path in /etc/fstab

The solution to this is to add "\040" where the space is. For example:
//192.168.0.2/Shared Folder
has to be written as
//192.168.0.2/Shared\040Folder

Monday, February 4, 2013

[Ubuntu] After upgrade cannot access internet despite connection is up

I upgraded our server last night via apt-get update & apt-get upgrade, when the server reboot it cannot connect to internet and other network segment. It can access only all the resources in the same subnet.

There are a few solutions worth to try:

  • ifdown the network interface and ifup it again
  • when perform upgrade of Ubuntu, the system might modified /etc/resolv.conf to include 127.0.0.1 as nameserver. Sometimes this will mess thing up and you can't get online. You can either delete everything inside, or use google DNS: nameserver 8.8.8.8
  • if you have bonding, you might want to add dns-nameserver 8.8.8.8 8.8.4.4 under your bond0
  • restart your networking: restart networking (this could be different from reboot Ubuntu. Because my connection got fix by restarting the network, while reboot doesn't help at all
If you do not wish to tackle with all this stupid problem, my advice is only upgrade when you need it. As long as your server is running fine and the upgrade is not going to fix any issues, just keep it as it is.

[Ubuntu] Wireless not working when on battery

If you have read my previous post How to release/renew IP when dhclient doesn't work, but you still unable to use your wireless when running your laptop on battery mode, then it could have something to do with the power management in Ubuntu.

The symptom you might get is:
  1. the wireless IP cannot be renew/release
  2. the wireless connection is up, but you can ping local or internet
  3. the wireless takes forever to get an IP from your router
The reason behind is when you're on battery, Ubuntu will activate power saving on your wireless device. This made the device cannot function properly. In this case my wireless device is:
"Broadcom Corporation" "BCM4312 802.11b/g LP-PHY" -r01 "Foxconn International, Inc." "T77H030.00 Wireless Mini PCIe Card"
If you are asking for help, you can identify your network controller by enter this command in terminal (special thanks to Serendah Linux from Ubuntu Malaysia LoCo Team to provide this command):
lspci -mm | grep Network | sed 's/.*"Network controller" //'
There are some solution that propose to deal with the 'wireless' file in the following location
  • /etc/pm/power.d
  • /usr/lib/pm-utils/power.d
but those doesn't work for me, and it might happen to you as well. If that is the case, you can still solve it by manual enter the following command into terminal:
  • iwconfig eth1 power off
Please note that the "eth1" has to be your wireless interface. Some might name after "wlan1". You have to enter the command every time you reboot a new session. I have not found any working method to execute this command during start up, if you do found it, please share with me.

Friday, February 1, 2013

[Ubuntu] How to release/renew IP when dhclient doesn't work.

I have encountered a very weird issue with Ubuntu 12.10 wireless networking where dhclient -r and dhclient cannot work as expected. The wireless device lock to the same IP, and unable to connect to internet or any other shared resources in the network.

Any other methods such as:
  1. Delete the profile in network manager
  2. restart networking service
  3. ifdown and ifup the interface
  4. Manually set IP address & DNS server
  5. Restart the router
Do not work as well. So what's the real fix for this problem? If you ever encounter the same problem as I did, you might try delete all the DHCP lease file located in /var/lib/dhcp/. New one will be generated automatically. Here's how my DHCP folder look alike:


If delete doesn't work for you, give me five because we are having the same issue. When I open the folder, there are multiple files inside, I deleted all (make sure you have turn off you wireless device before doing so) and let the system generates a new one.

After that, open up the new files with root privilege leafpad (or any other text editor), you will see the following:
 lease {  
  interface "eth1";  
  fixed-address 192.168.1.122;  
  option subnet-mask 255.255.255.0;  
  option routers 192.168.1.1;  
  option dhcp-lease-time 50400;  
  option dhcp-message-type 5;  
  option domain-name-servers 202.188.0.133,202.188.1.5;  
  option dhcp-server-identifier 192.168.1.1;  
  option dhcp-renewal-time 25200;  
  option dhcp-rebinding-time 44100;  
  renew 5 2013/02/01 22:24:39;  
  rebind 6 2013/02/02 04:55:53;  
  expire 6 2013/02/02 06:40:53;  
 }  
It's very simple here, modify the 10.0.0.122 192.168.1.122 (Updated: 25 Nov 2014) to some other available IP address, save it and turn on your wireless device. Wait for a few seconds and voila!

Most probably you are now able to online and start surfing. And if this does help, please leave me a comment so at least I know my blog help others. Cheers~!

Thursday, January 31, 2013

[Fedora] Laptop Broadcom Wireless not working?

The downside of Fedora compared to Ubuntu on my laptop is the Broadcom BCM4312 wireless device doesn't install automatically, that mean I'm unable to turn on my wireless for net browsing.

Luckily, how-to instruction is well documented in FedoraForum.org:
http://forums.fedoraforum.org/showthread.php?t=239922

Thursday, January 3, 2013

[CentOS] Installing CentOS 6.3 Minimal Edition: Part 1

In this post I would list down the steps & tasks I performed after during and after successful installation of CentOS minimal edition.

During Installation
I install CentOS 6.3 in a VM via Oracle VirtualBox. The initial graphic RAM given was 12mb, that has caused CentOS setup fail to boot into a GUI installation. Installing from the old DOS-like environment is headache because somehow it does not show up any available drive for me to select to hold the CentOS.


After a few trials, I decided to re-configured and install in GUI environment. The installation went smooth and very quickly it is done and CentOS is up.

* One thing to take note during the installation is to setup the LAN connection otherwise you would not get connection once boot into CentOS. (Special thanks to Sharuzzaman Ahmat Raslan from Facebook General Linux Discussion M'sia for his advice and screenshot)

To setup the LAN, simply click on the "Configure Network" button on the bottom left.

 


After installation
Once CentOS boot up I'm required to login. Key in root and password (set during installation) then we can start to install everything.

****** This step only required if you forgot to setup LAN during installation ******
Before that I would need to bring up the network interface. I used NAT for the VM. The network interface is not up by default, I did ifconfig and only can see "lo". To bring up the network interface simply type:

# ifup eth0

Run ifconfig to check again and now eth0 has already up and running with DHCP.
****** End of network interface section ******

First thing to do is to perform update to overall system.

# yum update

It is easier and more straight forward to work under GUI than terminal mode. So I decided to install the Gnome Desktop Environment & KDE. The reason I install both because there are some KDE tools & programs are useful to me. Before we can install Gnome/KDE, we must first install the "X Windows System". Yum has an option to do groupinstall. It will help you resolve all dependencies, for novice users this come in very handy. Execute the following:

# yum groupinstall -y 'X Window System'

So what is mean by "-y" in the command line above? It means "answer yes to all", so the system will perform every resolved dependencies without getting further permission from me.

To install Gnome, execute:

# yum groupinstall -y 'Desktop'

* A reminder here: Restart is not required after install "X Window System". If one restarts the system, remember to bring up eth0 again.

Once the installation done, execute:

# startx

I'm now in the Gnome Desktop environment. To make sure it run every time we restart the system, simply go /etc/inittab and change the id:3:initdefault: to id:5:initdefault:.

* To change and save the inittab file, we can use:

# vi innittab

press "Insert" on keyboard to enter editing mode. Once done, press ESC and type ":wq".

Reboot with command init 6 and I can now work in desktop environment.

===============================
There are some issue with minimal edition of CentOS that is it comes with very limited tools we can use to configure the OS. The most critical stuff that are missing is text editor such as gEdit / Kedit / Leafpad. Personally I prefer Leafpad, but to install Leafpad it is not as straight forward.

Some other issue:

  1. the network interface is not configure to load automatically when OS starts
  2. Mozilla Firefox is not pre-install
I will cover in Part 2 how to install those missing stuff as well as configure the network interface so it loads with the system.

Until then, have fun with your newly installed CentOS!

===============================
Some useful links for reference:

Tuesday, December 25, 2012

Scanning whole network range with Nmap

To scan the whole network IP range, we can use Nmap. It can be installed yum install nmap.x86_64

After installation, run nmap 192.168.0.1/24
* /24 mean scanning the whole range

Monday, December 24, 2012

[Fedora] Samba File Sharing Revisit

Update 25/12/12 17:40
Alright, I have much better idea what happen now. The pcmanfm file explorer that come with LXDE does not auto mount network folder, but Dolphin will do the trick.

As for the cifs-utils, that is needed to mount network folder from within the terminal.

So what about samba stuffs? I haven't dig into that, but if you have problem, no harm to install that.

I hope this update will make things clearer.

=======================================

Network file sharing is not easy in Linux. Despite my Xfce works fine with Samba network, but I have no luck on newly installed LXDE.

So what's the problem with it? To be very honest, I did not analyse the problem, initially I work around with mount & umount discussed in previous post. But today I have installed a few stuff from the package manager and it seems to work now directly from within Dolphin.

Below are packages that you may try to install to get it works:

  1. cifs-utils
  2. autofs (I guess this one is to deal with USB stick, cd/dvd, rather than network. But if you haven't install, you may try this.)
  3. samba-common
  4. samba Server and Client software to interoperate with Windows machine
Somehow, I feel it is the cifs-utils which do the trick. I would not dig to the root of this issue, perhaps next time. Until then, I hope this will help.

And one last thing, Merry Christmas and Happy New Year 2013!!


Friday, December 21, 2012

[Fedora] Mounting a network shared folder

The command to mount a network shared folder is:
mount -t cifs server:/folder-name /localpath -o username=userid,password=userpass
To unmount it, execute the following:
umount /localpath
It is so funny that the unmount command is 'umount', which is without "n". Wasted my half an hour to figure out this. Might be I really should read fundamental of Linux from scratch, not good to be "plug and play". :(

[Ubuntu] Bonding - ALB and 802.3ad

Update 31/07/13: Be sure to install ifenslave before configuring the bonding.

Office network switch was upgraded to layer 3 switch recently, play around with bonding to create link aggregation. This can be done easily under Windows, but in Linux it is really big headache. Not because the steps are complicated and redundant, but you simply can't proof whether the configuration is working or not because Linux doesn't have a friendly way for user to check whether the bonding is up and running fine.

We can check under /proc/net/bonding/bonding, but even if it is up and running, it doesn't mean the networking is actually well connected.

By the time I write this article, I still unable to get it run fine, probably due to the switch is not well configured yet, waiting for technician to do a check on that. Meanwhile, I would like to share my /etc/networking/interfaces configuration here, so whoever encountered Linux bonding problem can refer to here, without the need to search for thousand solutions online but none of those are beginner friendly or prove working.

I would say the configuration below "should be working", due to the fact that such configuration appear working when we do "netstat -i" or "ifconfig". There are a lot of solutions online, some help you to understand the concept but can never get the "bond0" interface up.

Without more words, here we go:

Adaptive Load Balancing, bonding mode=6
 auto lo  
 iface lo inet loopback  
 auto bond0  
 iface bond0 inet static  
      slaves none  
      address 192.168.0.2  
      gateway 192.168.0.1  
      netmask 255.255.255.0  
      dns-nameservers 8.8.8.8  
      bond-mode 6  
      bond-miimon 100  
 auto eth0  
 iface eth0 inet manual  
      bond-master bond0  
      bond-primary eth0 eth1 eth2 eth3  
 auto eth1  
 iface eth1 inet manual  
      bond-master bond0  
      bond-primary eth0 eth1 eth2 eth3  
 auto eth2  
 iface eth2 inet manual  
      bond-master bond0  
      bond-primary eth0 eth1 eth2 eth3  
 auto eth3  
 iface eth3 inet manual  
      bond-master bond0  
      bond-primary eth0 eth1 eth2 eth3  
802.3ad Link Aggregation, bonding mode=4
 auto lo  
 iface lo inet loopback  
 auto bond0  
 iface bond0 inet static  
      slaves none  
      address 192.168.0.2  
      gateway 192.168.0.1  
      netmask 255.255.255.0  
      dns-nameservers 8.8.8.8  
      bond-mode 4  
      bond-lacp-rate 1  
      bond-miimon 100  
 auto eth0  
 iface eth0 inet manual  
      bond-master bond0  
      bond-primary eth0 eth1 eth2 eth3  
 auto eth1  
 iface eth1 inet manual  
      bond-master bond0  
      bond-primary eth0 eth1 eth2 eth3  
 auto eth2  
 iface eth2 inet manual  
      bond-master bond0  
      bond-primary eth0 eth1 eth2 eth3  
 auto eth3  
 iface eth3 inet manual  
      bond-master bond0  
      bond-primary eth0 eth1 eth2 eth3  

I hope the above will help one who stuck with bonding. If this doesn't work properly and better solution is found, I would greatly welcome feedback and input.

Enjoy bonding!

========================================

Update 24/12/12:
The bonding configuration above is proven working, the issue I encountered was caused by the Dell PowerConnect layer 3 switch, which has some unknown issue that made the ports reserved for LACP not working properly. Re-configure and restart has get it up and running.

One more matter to take note is that you can actually remove the "bond-primary" under each eth. As for the dns-nameservers, it is advisable to specify that. Without that we have encountered some strange issue with VMs:

  1. the host and guest OS cannot ping and see each others.
  2. there is a "ghost" IP address, 192.168.0.222 appeared and tie with one of the ethernet. Bring up/down the bonding as well as each ethernet cannot get rid of it. Not even after restart.
Issues above being solved once the dns-nameservers is specified.

Now my server is running @ 4 Gbps and the HDDs has now become the bottleneck. Sigh... it's time to upgrade!