Networking

From ZENotes
Revision as of 23:59, 14 October 2011 by Admin (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

As of Fedora 7, 8 and 9, Networking under Linux has made huge progresses.

Contents

On the Move

These progresses are obviously always one step backward, for sure, since while Ubuntu 8.04 is still unable to roam WiFi with a WPA encryption, Fedora does and that is when I stop using it and start HSDPA (aka 3G) technology. These modems are becoming available, signal carriers often offer quite good package around their sim-based, smartphone contracts, so throw the phone away, stack the sim card in your modem and there you go, mobile and quick (up to 7.5Mbps down, 385kbs up as they say).

Well, not quite for me yet, given the fact that I live in Phnom Penh, but it's pretty possible and ubuntuforums got tons of info on how to hook your Huawei e220 HSDPA modem to your linux box. As of Kernel 2.6.20 it was supposedly supported built-in, but there is a trick: when you plug the modem in your computer, the modem itself switches to CDROM mode since it carries its own drivers: clever for a hassle-free insecure install under Windows, but of no use for a Linux user: you need a Switch software to tick the modem back to, well, modem mode.

That a shame; brand new "supported" stuff never quite is, you have to be patient.

Look in http://groups.google.com/group/pplug for keyword wvdial for up-to-date working solutions to use 3G with a Huawei modem in Cambodia trough the QB operator

In House

One obvious thing all of us wants to do when they come to the point of owning several computers in one home, is for sure to network them. Fear not the HowTo NTF here, I can't quite get along with, never have, probably never will. If that's what you are looking for, pass your way: I am going straight to the point here.

Targets

It's important to know what you wanna do, here I decided I wanted:

-A common access point for the 2 computers in the office + wifi for the guests using my facilities; that access point has to be OS-agnostic since the people I work most with have macs. A side effect is, thanks to wifi, I have a network at home too since it's right upstairs; wife and laptop covered, we are good.

-A way to share files between the Production Heavyweight (dualCore266), Uncle Fattie (P4, 8yo) and the missus' laptop; no streaming involved, just backup stuff, upload last holidays pics, this kind of things

-As a bonus, build a Lan that is around the same standards and OSes, with the same profiles, so it is possible and easy to remotely help, manage, peek, assist whatever any computer from any other. That's when I started hearing about SSH and VNC

Hardware

You need a Router, and that's where it comes confusing with all the Security Advices, enforced or not, by the several devices involved in a simple LAN that, as we'll see later, is also the internet access point (this is where it becomes complicated)

Let's tackle LAN first, yes, stop being obsessed with internet and keep focus! For a classic setup, you can buy one of those Linksys (WRT54 anyone?) that will link your computers and offer them a gateway to internet, with an extra Firewall added for good measure over the Linux-Based operating system - yes, your router is all that stashed together. But don't mind that: Vis-A-Vis your internal LAN, your router will be neutral, passing the info between all 192.168.1.2>255 address range. So forget the Router for this step, and focus on the computers.

- Sorry, actually, we have to tweak a detail on the router: Go to its admin panel, usually 192.168.1.1 from any browser, locate the LOCAL DHCP settings, leave it On for friends with wifi devices, and find the Range, or Start IP address, which is usually expressed as the last three digits of the 192.168.1.xxx address: There do as you like, I suggest you set the range from 200 and determine how many guest you may have at any single time as the "number of Addresses" field.

If this router box is wifi-capable, be sure to enforce some kind of encryption for it's wireless transmitter, otherwise the full neighbourhood will enjoy Free Internet on your account

Now power up all computers, after having wired them all to the router (wifi later)

Software

Best to work with Fixed IP! If you use NetworkManager in F9, you can decide which machine is called what in a moment. Go to System, Administration, Services and check out that "NetworkManager" is ticked - or not!

I don't use it for fixed machines that I want to work with fixed IP, look into system-config-network, all that you may need is there!

Manage your router, tidy up your ports

Your router is usually a firewall too; sometimes softwares like peer2peer networks, or online gaming applications will need specific ports to be opened in your system; don't forget your linux box has it's own firewall too when starting to pull your hairs with blocked ports and non-functional links.

One control way is to setup your system and your router to accept ssh connections; then go to

www.canyouseeme.org

to check if your port nr 22 seems to be available; there are other reasons besides your lack of skills for it not ot be available, including your ISP doing strange things with their IP addressing or Proxies settings.

OpenDNS.org

208.67.222.222

Manual Network Setup

(Probably applies solely to the likes of Slackware, Gentoo, LFS & al)

you will need the following information before continuing:

the following comes from the gentoo docs, and is protected by Creative Commons - Attribution / Share Alike license.

  Network Item    Example                        
  Your IP address 192.168.0.2                    
  Netmask         255.255.255.0                  
  Broadcast       192.168.0.255                  
  Gateway         192.168.0.1                    
  Nameserver(s)   195.130.130.5, 195.130.130.133 

Using ifconfig and route

Setting up your network consists of three steps. First we assign ourselves an IP address using ifconfig. Then we set up routing to the gateway using route. Then we finish up by placing the nameserver IPs in

  /etc/resolv.conf.

To assign an IP address, you will need your IP address, broadcast address and netmask. Then execute the following command, substituting ${IP_ADDR} with your IP address, ${BROADCAST} with your broadcast address and ${NETMASK} with your netmask:

  Code Listing 24: Using ifconfig                                            
  # ifconfig eth0 ${IP_ADDR} broadcast ${BROADCAST} netmask ${NETMASK} up    

Now set up routing using route. Substitute ${GATEWAY} with your gateway IP address:

  Code Listing 25: Using route                                               
  # route add default gw ${GATEWAY}                                          

Now open /etc/resolv.conf with your favorite editor (in our example, we use nano):

  Code Listing 26: Creating /etc/resolv.conf                                 
  # nano -w /etc/resolv.conf                                                 

Now fill in your nameserver(s) using the following as a template. Make sure you substitute ${NAMESERVER1} and ${NAMESERVER2} with the appropriate nameserver addresses:

  Code Listing 27: /etc/resolv.conf template                                 
  nameserver ${NAMESERVER1}                                                  
  nameserver ${NAMESERVER2}                                                  

(See opendns above for public dns servers)

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox