Docs/SysAdmin/Networking
From Mandriva Community Wiki
Contents |
[edit] Networking Hardware
What's the difference between a Hub, a Switch and a Router?
- http://www.sotmesc.org/gcms/hware/messages/272.html A nice little definition, easy to understand!
- http://ask-leo.com/whats_the_difference_between_a_hub_a_switch_and_a_router.html More technically detailled definition. see discussion here: http://ask-leo.com/c000120.html
[edit] Networking Software
You can get more information about controling network settings by reading /usr/share/doc/initscripts-<version>/sysconfig.txt. You will have to scroll down the file a bit until you get to "Files in /etc/sysconfig/network-scripts/" section.
[edit] DNS and DHCP
The setting in /etc/resolv.conf are overwritten by the dhcp client. To prevent this behaviour, edit /etc/sysconfig/network-scripts/ifcfg-eth0 and add PEERDNS=no.
[edit] Static Routes
Mandriva Linux uses a script /etc/syconfig/network-scripts/ifup-routes to parse the file for static routes for each interface. This doesn't seem to be very well documented, so I'll do it here.
The files used to configure the routes are /etc/syconfig/network-scripts/<dev>.route (e.g. /etc/syconfig/network-scripts/eth0.route) and they contain the variables:
ADDRESS0=<network address for route 0> NETMASK0=<netmask for route 0> GATEWAY0=<gateway address for route 0> ADDRESS1=<network address for route 1> NETMASK1=<netmask for route 1> GATEWAY1=<gateway address for route 1>
example: (eth0.route for eth0)
ADDRESS0=10.0.1.0 NETMASK0=255.255.255.0 GATEWAY0=192.168.1.4 ADDRESS1=10.0.2.128 NETMASK1=255.255.255.128 GATEWAY1=192.168.1.5
Note the number after each variable name, they start at 0 and go up for each route you add.
[edit] Changing / Setting Your System's Hostname
Edit the /etc/sysconfig/network file. Add a line resembling the following:
HOSTNAME=<your.fully.qualified.hostname>
Be sure to include the domain portion, even if it's a made-up one. The "short hostname" (what you see at the bash prompt) will be the leftmost segment thereof; in the above example, it'd be "your". Then edit your /etc/hosts file, adding both the long & short names to the 127.0.0.1 line, like so:
127.0.0.1 localhost your.fully.qualified.hostname your
If you are configured for a static IP address on your network interface, leave the 127.0.0.1 line alone, and instead create a new line in the hosts file that links the names to that static IP address, like so:
127.0.0.1 localhost 192.168.0.2 your.fully.qualified.hostname your
(One side benefit of this latter method is that you can put every system on your static-IP-based LAN into the file in this fashion, and then use a copy of that same /etc/hosts file on every one of them).
Assuming that the interface to your LAN and/or broadband modem and/or router is eth0, next edit the /etc/sysconfig/network-scripts/ifcfg-eth0 file, editing/adding this line:
NEEDHOSTNAME=no
Lastly, restart the following services, in this order:
# service network restart # service xfs restart # service dm restart
(restart xfs and dm only if they were already running)
That last one will end any running X sessions that were launched from the display manager, so bear that in mind. You should also manually end & relaunch any X sessions that were manually started (e.g., startx). Also worth restarting are any services that determine the hostname of the system on which they run at launch time, and use it thereafter; Samba and CUPS (the smb and cups services, respectively) come to mind here, to name two.
[edit] Network Monitoring Links
- http://www.marko.net/cheops/ - Open Source Network User Interface.
- http://diffserv.sourceforge.net/ - Differentiated Services on Linux
- http://etherape.sourceforge.net/ - a graphical network monitor
- http://web.wt.net/%7Ebillw/gkrellm/gkrellm.html - GKrellM, themed gui graphs
- http://www.aplawrence.com/Reviews/NTSyslog.html - How to Monitor Windows NT from Unix
- http://www.hping.org/ - a command-line oriented TCP/IP packet assembler/analyzer
- http://www.ipsentry.com/ - IPSentry Network Monitor and Server Monitoring Software - IP
- http://wwwhome.cs.utwente.nl/%7Eschoenw/scotty/ - Scotty - Tcl Extensions for Network Management
[edit] Useful Links
- http://www.siliconvalleyccie.com/#Linux - a collection of HOW-TOs aimed at SOHO and small network users
- http://lartc.org/ - Linux 2.4 Advanced Routing & Traffic Control HOWTO
- http://www.tldp.org/HOWTO/Net-HOWTO/index.html - Linux Networking HOWTO
- http://www.linuxvoodoo.com/resources/howtos/ - all things network related, (includes ssh and mysql)
- http://www.rfc-editor.org/rfc/rfc3168.txt - Explicit Congestion Notification (ECN) to IP
- http://gtf.org/garzik/ecn/ - ECN-under-Linux Unofficial Vendor Support Page
- http://www.candelatech.com/%7Egreear/vlan.html - 802.1Q VLAN implementation for Linux
- http://www.tweakhound.com/mdk9/mdk9net.htm - How To Network Mandriva Linux 9.0 to Windows XP
- http://www1.mandrivalinux.com/en/demos/tutorials/webwizard/ Tutorial: Server Wizards -- Enable Your Mandriva Linux Web Server
[edit] Creating a new network connection
[edit] Wireless Networking
To configure a new wireless networking interface open the Mandriva Control Center from Star menu->System->Configuration->Configure Your System and enter the root/administrator's password when prompted. Select Networking and Internet->Set up a new network interface.
The next screen you see will ask what type of connection you would like to configure, select wireless connection and click next to continue. Here it will ask what interface to configure, there are two methods;
- DrakConnect has detected your card and you can therefore select the device and click next.
- More likely your card is not currently supported and it will display unknown, select Use a windows driver (ndiswrapper). DrakConnect will the ask you to manually locate the driver file, insert the driver CD and navigate to the directory that contains the applicable driver. This varies from manufacturors but you are looking for a file that ends with .inf (e.g. bcmw15.inf). You will then be asked to insert the install CD's to install the necessary software, this is all automatic.
From here on in you can simply follow the steps and generally accept the defaults unless you have made any changes to your local network.