• Network Configuration Files • Interface control command and scripts • Basic routing using route command... Network configuration files important network configuration files in the /etc
Trang 1Fedora Linux Network Services
Trang 2In this part
• Network Interface (naming, type )
• Network Configuration Files
• Interface control command and scripts
• Basic routing using route command
Trang 3Network interface
• The first Ethernet NIC is given the alias eth0, the second Ethernet NIC is given the alias eth1, and so on
• Loopback lo
Trang 4Network configuration files
important network configuration files in the /etc/sysconfig directory
• Set up the IP addresses of your network interfaces Make changes to:
• /etc/sysconfig/network-scripts/ifcfg-eth0
• /etc/sysconfig/network-scripts/ifcfg-eth1
Trang 5Network configuration Files
• Make a local file of hostname to IP address mappings Make changes to:
• /etc/hosts
• Set up the device order from which hostnames are looked up Make changes to:
• /etc/nsswitch.conf
Trang 6SETTING UP THE IP
ADDRESS
• If you haven’t set the IP address already in the installation process, you need to edit the configuration files by hand
• To set the IP address on your first Ethernet interface eth0, edit the
/etc/syscon-fig/network-scripts/ifcfg-eth0 file
Trang 7• The /etc/sysconfig/network-scripts/ifcfg-eth0 file
• DEVICE=”eth0”
• BOOTPROTO=”none”
• BROADCAST=192.168.1.255
• IPADDR=”192.168.1.10”
• NETMASK=”255.255.255.0”
• NETWORK=192.168.1.0
• ONBOOT=”yes”
• USERCTL=no
• IPXNETNUM_802_2=””
• IPXPRIMARY_802_2=”no”
• IPXACTIVE_802_2=”no”
• IPXNETNUM_802_3=””
• IPXPRIMARY_802_3=”no”
• IPXACTIVE_802_3=”no”
• IPXNETNUM_ETHERII=””
• IPXPRIMARY_ETHERII=”no”
• IPXACTIVE_ETHERII=”no”
Trang 8SETTING UP A DEFAULT
GATEWAY
• Change the /etc/sysconfig/network file
to contain just the IP address of the gateway, like this:
• 192.168.1.1
Trang 9SETTING UP THE DNS
SERVERS
• Edit /etc/resolv.conf to contain a list of nameservers, like so:
• nameserver 192.168.1.1
• nameserver 203.14.1.3
Trang 10SETTING UP THE DEVICE ORDER FROM
WHICH HOSTNAMES ARE LOOKED UP
• The place to set up this configuration is in the
/etc/nsswitch.conf file Edit
• the following line: hosts:files nisplus dns
• The order of the words files, nisplus, and dns determines which method is checked first Files refers to the /etc/hosts file, nisplus refers to any nisplus
• servers you may have on your network, and dns refers to any DNS servers you have set
up your machine to reference.
Trang 11Starting up network services from xinetd
• /etc/xinetd.conf
• At the end of the xinetd.conf file is a line that indicates that all the files in the
• /etc/xinetd.d
• are also included in the configuration
This means that you need to go through the files in that directory as well in order
Trang 12Other important network configuration files
in the /etc/sysconfig directory
• Network configuration files in
/etc/sysconfig/network-scripts
• IFCFG-NETWORKINTERFACENAME
• IFUP AND IFDOWN
Trang 13Interface control command and scripts
Trang 14Configuring the network
card
• ifconfig eth0 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255
• A file is created in
ifcfg-eth0
Trang 15Gateways and Routers
• route add -net 192.168.1.0
• route add default gw 192.168.1.1