Config on /etc/network/interface

Discussion in 'Server Operation' started by satimis, Aug 20, 2007.

  1. satimis

    satimis Member

    Hi folks,


    Ubuntu 7.04 lamp server amd64
    only one NIC


    Connection
    Server --> Router --> DSL Modem --> ISP

    The router is supplied by ISP and password-locked by ISP. I suppose 192.168.0.1 is the gateway. How can I check it?


    Fixed IP
    220.232.213.178

    IP address reserved for server on Router
    192.168.0.10

    DNS
    202.14.67.4/14


    $ cat /etc/network/interfaces
    Code:
    # The loopback network interface
    auto lo
    iface lo inet loopback
    
    # The primary network interface
    auto eth0
    iface eth0 inet dhcp
    

    Now I'll change the second part after "auto eth0" as:
    Code:
    auto eth0
    iface eth0 init static
    	address 192.168.0.10
    	netmask 255.255.255.255
    	network ???
    	broadcast ???
    	gateway ???
    	# dns -* options are implemented by the resolvconf package, if installed
    	dns-nemserver 202.14.67.4 204.14.67.14
    
    Please advise what shall I enter for
    network ???
    broadcast ???
    gateway ???


    Shall I put the fix IP (202.232.213.178) here? It is for external only.


    TIA


    B.R.
    satimis
     
  2. falko

    falko Super Moderator Howtoforge Staff

    What's the output of
    Code:
    route -nee
    when you use DHCP?
     
  3. satimis

    satimis Member

    Hi falko,


    Tks for your advice. I got my problem sorted out already.

    Running DHCP
    $ route -n
    Code:
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
    0.0.0.0         192.168.0.1     0.0.0.0         UG    0      0        0 eth0
    

    Now /etc/network/interfaces
    Code:
    # The loopback network interface
    auto lo
    iface lo inet loopback
    
    # The primary network interface
    auto eth0
    iface eth0 inet static
            address 192.168.0.10
            netmask 255.255.255.0
            gateway 192.168.0.1
    
    I must have the line "iface eth0 inet static". W/o this line it can't work.

    What is the use of this line? Tks


    B.R.
    satimis
     

Share This Page