Find the answer to your Linux question:
Results 1 to 6 of 6
pretty new to linux, but have recently set up a server and (intentionally) haven't installed graphical components 'cos i won't need them. The server hasn't got a network card yet, ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Nov 2006
    Posts
    123

    network setup from command line


    pretty new to linux, but have recently set up a server and (intentionally) haven't installed graphical components 'cos i won't need them.
    The server hasn't got a network card yet, so if I just whack a cheap one in will it recognise it automatically?

    And when I've done this, how do I then do all that business of telling it what it's ip address is, what the default gateway is etc from the command line?

  2. #2
    Just Joined! Smither's Avatar
    Join Date
    Feb 2006
    Location
    Scotland
    Posts
    58
    Quote Originally Posted by bentaylor View Post
    pretty new to linux, but have recently set up a server and (intentionally) haven't installed graphical components 'cos i won't need them.
    The server hasn't got a network card yet, so if I just whack a cheap one in will it recognise it automatically?
    Depends on your system. Probably.

    Quote Originally Posted by bentaylor View Post
    And when I've done this, how do I then do all that business of telling it what it's ip address is, what the default gateway is etc from the command line?
    Code:
    ifconfig eth0 192.168.0.2 netmask 255.255.255.0 up
    route add default gw 192.168.0.1
    Or similar.

  3. #3
    Linux Newbie
    Join Date
    Nov 2006
    Posts
    123
    great, that works... how do I now set the default DNS server ?

  4. #4
    Just Joined! Smither's Avatar
    Join Date
    Feb 2006
    Location
    Scotland
    Posts
    58
    Add them to /etc/resolve.conf and restart networking.
    Mine is:
    Code:
    # Generated by dhcpcd for interface br0
    nameserver 208.67.222.222
    nameserver 208.67.220.220

  5. #5
    Linux Newbie
    Join Date
    Nov 2006
    Posts
    123
    i don't think it's saved it permanently as I just had to reboot and it didn't save...was back to 'network unreachable' when i booted up again.
    How can I get it to permanently set the network settings, like do I need to store them in a file somewhere?
    Cheers

  6. #6
    Just Joined! Smither's Avatar
    Join Date
    Feb 2006
    Location
    Scotland
    Posts
    58
    On gentoo it's in /etc/conf.d/net:
    Code:
    config_eth0=( "192.168.0.3 netmask 255.255.255.0 brd 192.168.0.255" )
    routes_eth0=( "default via 192.168.0.1" )

Posting Permissions

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