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.
/sbin is the location of the executable programs called ifconfig and route.
So, to run them you have to include the location unless your logged in as root.
You can check the various options with man ifconfig
The example I used can be changed to match your needs... Basically, I said to add the ip address of 192.168.0.2 to the nic known as eth0 . I also said that the subnet mask is 255.255.255.0 and the next command said that my router is using the ip address of 192.168.0.1
I have found out that this will always reset on reboot like the previous message suggests, the only way to make it permanent is to set it via your distro's contaol panel.
To set it in the distros control panel do you need to be in a GUI? Would I be able to edit the config file that the distros control panel saves to? Or would it be different with each different distro?
Ok, so if you want to use the GUI tools in Redhat, Type the command:redhat-config-network which will open up a nice GUI.
If you want to add the ip address information manually, it would look something like this.... You can change the numbers and hostname around to suit yourself.
Edit the file /etc/sysconfig/network-scripts/ifcfg-eth0
Edit the file /etc/sysconfig/network-scripts/ifcfg-eth0 to use DHCP.
DEVICE=eth0
USERCTL=no
ONBOOT=yes
BOOTPROTO=dhcp
BROADCAST=
NETWORK=
NETMASK=
IPADDR=
Edit the file /etc/sysconfig/network to use DHCP.
NETWORKING=yes
HOSTNAME=
FORWARD_IPV4=yes
GATEWAYDEV=
GATEWAY=
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.