Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Or you can at the command line type:
/sbin/ifconfig eth0 111.222.333.444
route add default gw 111.222.333.1 eth0
And then add the name servers with
echo -e "nameserver xx.xxx.xxx.xxx\nnameserver xxx.xxx.xxx.xx" > /etc/resolv.conf
Ok,all of the above will work,ons more way that is perhaps a bi more structured ..
All your interface configs lies in the folder /etc/sysconfig/network-scripts/
There you will c a file called ifcfg-eth0 ( ..eth1 , eth2 exc..)
In there you can change the ip,network address exc.. Then for gateway type route -n to c what your current gw is set up to,vi the file /etc/sysconfig/network to change gateway.. If there is no entry add line with GATEWAY=xxxxxxxxxx
Easy..then DNS you can change the /etc/resolv.conf file.
After this is done do a "service network restart" to view all your interfaces and configs.
Maybe silly question, but I always use a DCHP, so no trouble with that yet. Still I'm curious to know whether the config stays saved when a reboot occurs. Does it write this to the runlevels (except for the ones with network support of course) or do you have to place those parameters in a file so they get loaded each time you reboot the PC?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.