LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   How to add IP address on Centos? (https://www.linuxquestions.org/questions/red-hat-31/how-to-add-ip-address-on-centos-4175475205/)

nomee786 08-29-2013 12:29 PM

How to add IP address on Centos?
 
Can some one tell me how to add IP address on Linux Centos?

Thanks.

ArcLinux 08-29-2013 02:44 PM

Are you looking to add a virtual interface to an existing or additional nic card or are you looking to get your network setup initially?

vipul_vaidya 08-31-2013 04:12 AM

There are couple of methods for assigning IP address
for newbies you should try
#system-config-network (On GUI)

OR


#system-config-network-tui (ON CLI)

SAbhi 09-01-2013 10:51 PM

Quote:

Can some one tell me how to add IP address on Linux Centos?

By default it takes the IP from the ISP's DHCPas soon as you are connected to a network. if you want to assign an IP manually:

#system-config-network
firing this from command line will give you a GUI interface.

OR

Code:

vi /etc/sysconfig/network-scripts/ifcfg-eth0
and make below changes:

DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
NETMASK=255.255.255.0
IPADDR=x.x.x.x                        # mention your IP address here

save and quit
restart the network service.

nomee786 01-29-2016 03:39 PM

Linux Laptop connectivity with Cisco Layer 3 switch
 
I have built two laptop with CentOS and I have configured ip addres and gateway as well.
I have cisco layer 3 switch which I am using as gateway.

But when I ping laptop to cisco switch or laptop to laptop I got an error "Host is unreachable".

Please advise.

thanks.

nomee786 01-29-2016 04:23 PM

Linux Laptop connectivity with Cisco Layer 3 switch


I have built two laptop with CentOS and I have configured ip addres and gateway as well.
I have cisco layer 3 switch which I am using as gateway.

But when I ping laptop to cisco switch or laptop to laptop I got an error "Host is unreachable".

Please advise.

thanks.

MrTux 02-03-2016 10:47 PM

Quote:

Originally Posted by SAbhi (Post 5020053)
By default it takes the IP from the ISP's DHCPas soon as you are connected to a network. if you want to assign an IP manually:

#system-config-network
firing this from command line will give you a GUI interface.

OR

Code:

vi /etc/sysconfig/network-scripts/ifcfg-eth0
and make below changes:

DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
NETMASK=255.255.255.0
IPADDR=x.x.x.x                        # mention your IP address here

save and quit
restart the network service.

You missed the gateway

GATEWAY=X.X.X.X


All times are GMT -5. The time now is 01:36 AM.