Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
Hi,
I am using internet in my home PC using Red Hat 9. To assign static IP to my linux machine I use "System Settings....> Network" and then double click on "eth0" to assign the static IP.
Well these all settings by using GUI interface.Kindly guide me that if I use only command line interface "runlevel 1" then in that case which file should i edit and assign my
static IP,
Subnet Mask,
Default Gateway
DNS settings.
2- 2nd thing is,is there any way that I may open web broswer in command line? or the administrator should only use internet on Run Level 5 ?
Hi,
I am using internet in my home PC using Red Hat 9. To assign static IP to my linux machine I use "System Settings....> Network" and then double click on "eth0" to assign the static IP.
Well these all settings by using GUI interface.Kindly guide me that if I use only command line interface "runlevel 1" then in that case which file should i edit and assign my
static IP,
Subnet Mask,
Default Gateway
DNS settings.
2- 2nd thing is,is there any way that I may open web broswer in command line? or the administrator should only use internet on Run Level 5 ?
thanks in advance for the help.
gardenair
You can use this command to configure your network interface from Command line:
Quote:
#system-config-network
And you can use links or elinks command the view webpages in command line:
I think you are a little confused about run levels and virtual terminals. In run level 1 you won't find the network service working, but you can start the service with the following command.
Quote:
#service network start
Last edited by Sayan Acharjee; 03-26-2010 at 01:39 AM.
You can edit corresponding file in /etc/sysconfig/network-scripts/ifcfg-ethX and put all the information there. Take a look at my file and use it as reference.
And for your second issue, you can use internet on cli as well. You can use elinks for web browsing. And keep in mind, using root user for no reason is harmful. Create a normal user and su to root when needed.
Also you are using a VERY OLD distribution and it is not supported any more. You will not receive any updates on RH9 and you should consider upgrading to newer one.
thanks a lot for the help. Well i get the file but sorry i does't know which service how how to restart it.
Please mention the name and method to restart the service after configuring the IP address.
2- what is
USERCTL=no
PEERDNS=no
just explain a bit.thanks
Use the command below to restart the network service:
Quote:
#service network restart
If PEERDNS=yes then it modifies the /etc/resolv.conf (which is used to specify the dns server) if the DNS directive is set. If using DCHP, then yes is the default.
If PEERDNS=no then it doesn't modify /etc/resolv.conf.
If USERCTL=yes means Non-root users are allowed to control this device.
If USERCTL=no then non-root users are not allowed to control this device.
Thanks "Sayan acharjee" and "Hardcorelinux" for the replies.Well i am happy that we have another way (as hardcore mentioned) to configure the ip address.
ifconfig eth0 <yourstaticip> netmask <yournetmask> gateway <yourgateway> up
There is a little confusion that there is a space between then
example
ifconfig eth0 192.168.1.1 255.255.255.0 192.168.1.100 up
Thanks "Sayan acharjee" and "Hardcorelinux" for the replies.Well i am happy that we have another way (as hardcore mentioned) to configure the ip address.
ifconfig eth0 <yourstaticip> netmask <yournetmask> gateway <yourgateway> up
There is a little confusion that there is a space between then
example
ifconfig eth0 192.168.1.1 255.255.255.0 192.168.1.100 up
Example:
ifconfig eth0 192.168.1.1 netmask 255.255.255.0 gateway 192.168.1.100 up
EDIT: hardcorelinux posted it earlier.
Last edited by Sayan Acharjee; 03-26-2010 at 02:54 AM.
But I guess this change is not permanent. You will need to re assign the address once the system or the service restarts.
To make changes persistent over reboots you will need to edit the file.
Well i am little confuse now...I switch to (Runlevel 5) and in the terminal i edit the network interface eth0 file.It does't say to restart the service. but as "sayan_acharjee" wrote
Use the command below to restart the network service:
#service network restart
This command is use when we r using Runlevel 1 or 3 but what about If i use GUI, open the terminal (Just for testing and experiment purpose) and change the IP address then which command should I give to restart my network services?
2- If I give the command
ifconfig eth0 192.168.1.1 netmask 255.255.255.0 gateway 192.168.1.100 up
it say "bash: ifconfig:command not found"
Well i am little confuse now...I switch to (Runlevel 5) and in the terminal i edit the network interface eth0 file.It does't say to restart the service. but as "sayan_acharjee" wrote
Use the command below to restart the network service:
#service network restart
This command is use when we r using Runlevel 1 or 3 but what about If i use GUI, open the terminal (Just for testing and experiment purpose) and change the IP address then which command should I give to restart my network services?
You can open a terminal window in Runlevel 5 and issue same command.Most of the distributions have the options to right click on desktop and open a terminal option or else find out it from your start menu
Quote:
Originally Posted by gardenair
2- If I give the command
ifconfig eth0 192.168.1.1 netmask 255.255.255.0 gateway 192.168.1.100 up
it say "bash: ifconfig:command not found"
well where i am doing wrong ?
issue following command
which ifconfig
most probabaly it will be under /usr/sbin/ifconfig , so run command using full path of binary ie:
/usr/sbin/ifconfig eth0 192.168.1.1 netmask 255.255.255.0 gateway 192.168.1.100 up
Are you trying to do this as root user or a normal user ? If it is as a normal try this logged as root user..
Last edited by hardcorelinux; 03-26-2010 at 07:20 AM.
Reason: edit
Hello everybody,
I think editing the file /etc/sysconfig/network-scripts/ifcfg-ethx is a recommended way to assign static IP. I have tried this on CentOS and it worked for me. I would suggest few modifications in the settings given by linuxlover.chaitanya
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.