Find the answer to your Linux question:
Results 1 to 3 of 3
hi, 1.How does Linux automatically configure the network interface with the appropriate networking parameters? 2.What is the function of ‘/etc/hosts’ file 3.What is the function of ‘/etc/resolv.conf’? 4.What is the ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Sep 2003
    Posts
    6

    Linux-Networking questions


    hi,

    1.How does Linux automatically configure the network interface with the appropriate networking parameters?

    2.What is the function of ‘/etc/hosts’ file

    3.What is the function of ‘/etc/resolv.conf’?

    4.What is the command line for starting up and bringing down the network
    interface using the script(s) available
    in ‘/etc/sysconfig/networking/devices’.

    5. How to display the routing table in numeric format using 'netstat'. What is the command line?Also what is the default route?

    regards
    pongsu

  2. #2
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796
    The /etc/hosts file are using for namelooking and hostlookup things. The host first looks at its /etc/hostsfile before asking DNS-servers.

    The /etc/resolv.conf containing the DNS-servers to ask if not the answer exists in /etc/hosts Also which domain to search on/expand question on.

    To start and stop nic:s use /etc/init.d/network stop/start/restart every nic with onboot=yes set will be started. The configfiles are located under /etc/sysconfig/network-scripts/ifcfg-eth* (On redhat) can differ depending on which dist you are running.

    With the
    Code:
    route
    command you can se which routes you have enabled, also which ip that is your df gateway, entry tagged with default.

    Try
    Code:
    netstat -anp
    and see if you like that format.
    Regards

    Andutt

  3. #3
    Linux Newbie
    Join Date
    Aug 2003
    Posts
    113
    To bring up an interface that has already be configured previously you can issue:

    Code:
    ifup eth0
    or to bring it down:
    Code:
    ifdown eth0
    Thats assuming your nic is eth0. or say you have a modem. Classic example. When I first started using linux...(seems like yesterday ), I was issued a work laptop. This had a pcmcia nic and an builtin modem. When I would come home and try to use the modem the modem would initialize but would always try and route out through the pcmcia nic.

    Ofcourse unplugging the pcm/cia nic before powering up would solve the issue but all that was needed before dialing up was bringing down eth0 first via (ifdown eth0), then everything would route properly through ppp0 (modem).
    JB

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •