Title: Linux
1Linux
2Basic Approaches
- Configure during installation
- Disadvantage -gt not able to redo easily
- Advantage-gt holds your hand
- Configure after installation
- Disadvantage -gt collision with other config tools
- Advantage-gt fairly easy to use (99.5 coverage)
- Access files directly
- Disadvantage -gt more details to know
- Advantage-gt access to everything and a deeper
understanding
3Access Files Directly
- Most of the files are in /etc
- Use installation to recognize NIC cards
- /etc/sysconfig to specify setup
- /etc/modules.conf to recognize cards
- /etc/rc.d/init.d to restart network after
configuring - Add manual routes to static-routes
4/etc
- Tons of configuration information
- Very small amount related to the configuration of
the network - Focus on /etc/sysconfig first
- Use the installation process to recognize the NIC
cards. - Edit sysconfig files afterwards if errors occur.
5Recognizing cards
- Installation is reasonably sophisticated.
- Most cards will be recognized either with a
generic driver or the real one. - Use ifconfig to determine if card is recognized.
(see next overhead) - For older cards use /etc/modules.conf
6ifconfig-gt eth0 Link encapEthernet HWaddr
00E07D7AAE2C inet
addr192.168.1.77 Bcast192.168.1.255
Mask255.255.255.0 UP BROADCAST RUNNING
MULTICAST MTU1500 Metric1 RX
packets107551 errors0 dropped0 overruns0
frame0 TX packets146864 errors0
dropped0 overruns0 carrier0
collisions6947 txqueuelen100 RX
bytes12906086 (12.3 Mb) TX bytes27598982 (26.3
Mb) Interrupt5 Base address0xe000
lo Link encapLocal Loopback
inet addr127.0.0.1 Mask255.0.0.0 UP
LOOPBACK RUNNING MTU16436 Metric1
RX packets1269 errors0 dropped0 overruns0
frame0 TX packets1269 errors0
dropped0 overruns0 carrier0
collisions0 txqueuelen0 RX
bytes111800 (109.1 Kb) TX bytes111800 (109.1
Kb)
7Cards Recognized .. Next?
- Check the configuration of the network
- Use netstat to check the routing tables
- Be sure the cards are connected to the right
network if multiple cards (router) - Use ping to check for connectivity.
8netstat -nr
root_at_testmachinenetstat -nr Kernel IP routing
table Destination Gateway Genmask
Flags MSS Window irtt Iface 192.168.1.0
0.0.0.0 255.255.255.0 U 40 0
0 eth0 127.0.0.0 0.0.0.0
255.0.0.0 U 40 0 0
lo 0.0.0.0 192.168.1.1 0.0.0.0
UG 40 0 0 eth0
9Problems? General Networking
- Examine the network configuration files
/
prompt cat network NETWORKINGyes FORWARD_IPV4
false HOSTNAMEtestserver DOMAINNAMElocaldomain G
ATEWAY192.168.1.1 prompt
etc
sysconfig
network
10Red Hat Fedora exceptionto network file
- Format is same but
- FORWARD_IPV4 flag is overridden by an entry in a
kernel configuration file named /etc/sysctl.conf - net.ipv4.ip_forward 1
11Each Device
/
promptcat ifcfg-eth0 DEVICEeth0 BOOTPROTOstat
ic IPADDR192.168.1.77 NETMASK255.255.255.0 NETWO
RK192.168.1.0 BROADCAST192.168.1.255 ONBOOTyes
prompt
etc
sysconfig
network
network-scripts
ifcfg-eth0
12Recognizing a NIC
/etc/modules.conf
alias eth0 ne2k-pci alias eth1 3c5x9 options
ne2k-pci irq5
- Forces the boot programs to examine additional
modules for support in recognizing devices. - Modules do other things and generally add
functionality to the kernel. - Odd format, but says to probe for a device using
the ne2000 probe and name it eth0. - Lets you control naming and also deal with two
cards with - identical type (not plug and play)
- Lets you add other info to help the probe
software detect the device (specifying interrupt
and i/o settings)
13Other issues in recognizing
- Two cards of the same type are problematic if
using older ISA cards - Most plug and play work fine
- Is same and older
- May need to use separate software to set I/O
- And to set INTERRUPT
- Then use modules.conf to convey setting to boot.
- Look online for details for setting modules for
specific network card types.
14Restarting the network
/
- This is a script used during the boot process to
start up the network. - Dont change it!
- Restart the network by
- cding to the /etc/rc.d/init.d directory
- ./network restart
etc
rc.d
init.d
network
15ping
- Dont forget to use ping to test connectivity
- Use the lights to be sure interfaces are
connected - Use ifconfig to track the progress of
communications - through each interface
- inch your way out (pinging) if outside
connection fails - Be sure to configure forwarding on your router in
the /etc/sysconfig/network file