Setup-up Simple Network Settings

Sometimes when you install your OS, the network interfaces are not enabled, or the network setting has set to Static IP but with a wrong IP. So when you face these situations you should setup your network first, in order to get your server connected to the network.

The very first step is to know the current status of each network interface. To do so, there are many ways and among these, there are 3 ways which are easier and faster.You can read these 3 ways in this post.

But here  I’m going to use one of them ([tooltip content=”Short for Interface Configuration” url=”http://en.wikipedia.org/wiki/Ifconfig” ]ifconfig[/tooltip]):

ifconfig -a

or

/sbin/ifconfig -a

and by this command you will see the following output:

eth0      Link encap:Ethernet  HWaddr b8:ac:6f:65:31:e5
          inet addr:192.168.2.100  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: fe80::baac:6fff:fe65:31e5/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2697529 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2630541 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:2159382827 (2.0 GiB)  TX bytes:1389552776 (1.2 GiB)
          Interrupt:17
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:2849 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2849 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2778290 (2.6 MiB)  TX bytes:2778290 (2.6 MiB)
ppp0      Link encap:Point-to-Point Protocol
          inet addr:10.1.3.105  P-t-P:10.0.31.18  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1496  Metric:1
          RX packets:102800 errors:0 dropped:0 overruns:0 frame:0
          TX packets:63437 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:148532544 (141.6 MiB)  TX bytes:4425518 (4.2 MiB)
vmnet1    Link encap:Ethernet  HWaddr 00:50:56:c0:00:01
          inet addr:192.168.47.1  Bcast:192.168.47.255  Mask:255.255.255.0
          inet6 addr: fe80::250:56ff:fec0:1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:49 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
vmnet8    Link encap:Ethernet  HWaddr 00:50:56:c0:00:08
          inet addr:172.16.232.1  Bcast:172.16.232.255  Mask:255.255.255.0
          inet6 addr: fe80::250:56ff:fec0:8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:49 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

If your network interfaces are not enable, you can turn it on via this command:

ifconfig eth0 up

In the command line above, you should replace “eth0” with your desired interface name.

Each interface should have a configuration file named ifcfg-eth0, where eth0 is the network device name. For further setting for your network interfaces, you can edit these files. For example, you should use the following command:

nano /etc/sysconfig/network-scripts/ifcfg-eth0

You can also edit the following file:

nano /etc/sysconfig/networking/devices/ifcfg-eth0

This file contains the following lines:

# Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet
DEVICE=eth0
BOOTPROTO=static
BROADCAST=87.247.184.207
HWADDR=98:4B:E1:6F:35:10
IPADDR=87.247.184.199
NETMASK=255.255.255.240
NETWORK=87.247.184.192
ONBOOT=yes

In order to change the

 

 

There is also a temporary way to change your IP and Subnetmask of your network interface:

ifconfig eth0 192.168.1.53 netmask 255.255.255.0

in the code above, “eth0” is the target network interface, “192.168.1.53” is your desired IP that you want to set on the interface, “255.255.255.0” is the subnetmask for that interface.

You can also use the following command to setup in semi-graphical way

setup

After setting up, you should restart the network service by the following command:

service network restart

The setup command will be discussed in

[tooltip content=”I’m writing this page, please try again later ;)” url=”” ]another topic[/tooltip]

.

2 thoughts on “Setup-up Simple Network Settings”

  1. Everything is very open with a clear description of the issues.
    It was truly informative. Your site is extremely helpful.
    Many thanks for sharing! regards Propolis

Leave a Reply

Your email address will not be published. Required fields are marked *

This is new type of CAPTCHA, make the puzzle please !WordPress CAPTCHA