1 => Open /etc/rc.local file and make entry like below given format.
#vim /etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
ifconfig eth0:0 192.168.1.101 netmask 255.255.255.0
route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.1.1 dev eth0:0
exit 0
~
#save file and exit
Note: Modify IP address according to your need .
2 => Restart the server
3 => check
#ifconfig
eth0 Link encap:Ethernet HWaddr 00:50:56:bc:20:ee
inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::250:56ff:febc:20ee/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:251416556 errors:0 dropped:12715298 overruns:0 frame:0
TX packets:133142418 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:205568847089 (205.5 GB) TX bytes:238098048978 (238.0 GB)
eth0:0 Link encap:Ethernet HWaddr 00:50:56:bc:20:ee
inet addr:192.168.1.101 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
############### Enjoy ###########################
No comments:
Post a Comment