Results 1 to 5 of 5

Thread: Configure Static Ip using the Terminal

  1. #1

    Default Configure Static Ip using the Terminal

    Hello,

    I was trying to configure a static Ip on openSUSE but didn't get very far...

    I even googled but I couldn't find anything.
    Oh yeah I would like to do it through the terminal.

    Would be cool if someone could tell me how this is done.

    Cheers and Greetings
    TempleClause

  2. #2

    Default Re: Configure Static Ip using the Terminal

    I found out that i have to change the seetings in

    /etc/sysconfig/network

    but with which parameters?

    I would like to set the following settings:

    IP: 192.168.2.77
    Subnet:255.255.2550
    DNS:192.168.2.1
    Gateway:192.168.2.1

    Thx for the answers

    TempleClause

  3. #3
    Join Date
    Jul 2008
    Location
    Voorhout, Netherlands
    Posts
    262

    Default Re: Configure Static Ip using the Terminal

    On 01/24/10 16:26, TempleClause wrote:
    >
    > I found out that i have to change the seetings in
    >
    > /etc/sysconfig/network
    >
    > but with which parameters?
    >
    > I would like to set the following settings:
    >
    > IP: 192.168.2.77
    > Subnet:255.255.2550
    > DNS:192.168.2.1
    > Gateway:192.168.2.1


    The file you need to make or edit is called ifcfg-<nic>, where <nic>
    could be e.g. eth0 or eth1.
    As example my ifcfg-eth0 file:

    BOOTPROTO='static'
    BROADCAST=''
    ETHTOOL_OPTIONS=''
    IPADDR='10.0.0.150/24'
    MTU=''
    NAME='3c940 10/100/1000Base-T [Marvell]'
    NETWORK=''
    REMOTE_IPADDR=''
    STARTMODE='auto'
    USERCONTROL='no'

    See 'man ifcfg' and /etc/sysconfig/network/ifcfg.template

    The DNS is configured in another file: /etc/resolv.conf
    The default gateway is configured in yet another place:
    /etc/sysconfig/network/routes
    See 'man routes' for an explanation of this file.

    Theo

  4. #4
    Join Date
    Jun 2008
    Location
    Moscow, Russia
    Posts
    2,973
    Blog Entries
    1

    Default Re: Configure Static Ip using the Terminal

    You need to edit three files:

    /etc/sysconfig/network/ifcfg-eth0
    BOOTPROTO='static'
    IPADDR='192.168.2.77'
    MTU='1500'
    NAME=''
    NETMASK='255.255.255.0'
    STARTMODE='auto'
    USERCONTROL='no'

    /etc/sysconfig/network/routes
    default 192.168.2.1 - -

    /etc/resolv.conf
    nameserver 192.168.2.1

  5. #5
    Join Date
    Oct 2008
    Location
    Birmingham. AL
    Posts
    851

    Default Re: Configure Static Ip using the Terminal

    Another idea, not nearly as geeky or sexy, would be to enter "yast" at that terminal prompt, then use the arrow and tab keys to get to Network Devices -> Network Settings.

    If you insist on knowing how to do it manually, just look at the contents of the files named above *after* you use Yast to see what it did.

    (My theory is, the Suse people went to a LOT of trouble to perfect both the GUI and NCurses versions of Yast; why not use them?)

Posting Permissions

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