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.
Hello,
I am running Fedora core 5 on my linux box. Usually it detected my network settings, or I would just run dhclient.
However, something went wrong with my router and it's no longer being picked up automatically as DNS and gateway. On my windows machines, I would usually go into TCP/IP settings and configure:
IP: 192.168.2.20 (IP address of my linux box)
Subnet...
Gateway: 192.168.2.2 (IP of my D-link router)
Default DNS server: 192.168.2.2
On my linux box:
I just run
ifconfig eth0 192.168.2.20
to set the IP, not sure how to set up DNS and Gateway
How do I do this in linux, is there a quick command do set these things: specify the gateway and the Default DNS so the internet works?
Your DHCP server is probably just disabled, but I have written up terse instructions for you to follow anyway. It's a good thing to know!
Gateway
if you use route to manage your routing tables like I do, seting a default gateway is easy...
route add default gw 192.168.2.2
DNS
dns is really easy. Edit the file /etc/resolv.conf and add the line
nameserver 192.168.2.2
the routing table will need to be configured each time your computer starts. Fedora should provide a utility for setting the default gateway. /etc/resolv.conf is just a regular file, and will persist until changed by you or by automatic configuration via dhcp.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.