Cara seting ip address
linux redhat
1.
Backup file Konfigurasi di folder \bkup
–
Buat folder \bkup untuk backup file konfigurasi ip address
[root@localhost
/]# cd /
[root@localhost /]# mkdir bkup
[root@localhost /]# ls
bin boot etc initrd lost+found mnt proc sbin tmp var
bkup dev home lib misc opt root tftpboot usr
[root@localhost /]#
[root@localhost /]# mkdir bkup
[root@localhost /]# ls
bin boot etc initrd lost+found mnt proc sbin tmp var
bkup dev home lib misc opt root tftpboot usr
[root@localhost /]#
–
Copy file ifcfg-eth0 ke folder /bkup
[root@localhost
/]# cp /etc/sysconfig/network-scripts/ifcfg-eth0 /bkup/ifcfg-eth0.backup
2.
Setting IP Address Static dgn ip 192.168.1.10
–
Edit file ifcfg-eth0
[root@localhost
/]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
–
Lalu isi file ini sesuai konfigurasi dibawah ini
DEVICE=eth0
BOOTPROTO=static
BROADCAST=192.168.1.255
IPADDR=192.168.1.10
NETMASK=255.255.255.0
NETWORK=192.168.1.0
ONBOOT=yes
USERCTL=no
PEERDNS=no
TYPE=Ethernet
BOOTPROTO=static
BROADCAST=192.168.1.255
IPADDR=192.168.1.10
NETMASK=255.255.255.0
NETWORK=192.168.1.0
ONBOOT=yes
USERCTL=no
PEERDNS=no
TYPE=Ethernet
–
Restart Network Service
[root@localhost
/]# sudo service network restart
Shutting
down interface
eth0:
[ OK ]
Shutting down loopback interface: [ OK ]
Setting network parameters: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
[root@localhost /]#
Shutting down loopback interface: [ OK ]
Setting network parameters: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: [ OK ]
[root@localhost /]#
–
Melihat konfigurasi IP address
[root@localhost
/]# ifconfig
eth0
Link encap:Ethernet HWaddr 08:00:27:6D:9A:29
inet addr:192.168.1.10 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:
RX packets:2193 errors:0 dropped:0 overruns:0 frame:0
TX packets:1227 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:254060 (248.1 Kb) TX bytes:331620 (323.8 Kb)
Interrupt:10 Base address:0xd020
inet addr:192.168.1.10 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:
RX packets:2193 errors:0 dropped:0 overruns:0 frame:0
TX packets:1227 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:254060 (248.1 Kb) TX bytes:331620 (323.8 Kb)
Interrupt:10 Base address:0xd020
lo
Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:14926 errors:0 dropped:0 overruns:0 frame:0
TX packets:14926 errors:0 dropped:0 overruns:0
collisions:0 txqueuelen:0
RX bytes:1019594 (995.6 Kb) TX bytes:1019594 (995.6 Kb)
[root@localhost /]#
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:14926 errors:0 dropped:0 overruns:0 frame:0
TX packets:14926 errors:0 dropped:0 overruns:0
collisions:0 txqueuelen:0
RX bytes:1019594 (995.6 Kb) TX bytes:1019594 (995.6 Kb)
[root@localhost /]#
–
Test ping untuk melakukan pengujian
[root@localhost
/]# ping 192.168.1.10
PING 192.168.1.10 (192.168.1.10) 56(84) bytes of data.
64 bytes from 192.168.1.10: icmp_seq=1 ttl=64 time=0.453 ms
64 bytes from 192.168.1.10: icmp_seq=2 ttl=64 time=0.131 ms
64 bytes from 192.168.1.10: icmp_seq=3 ttl=64 time=0.083 ms
64 bytes from 192.168.1.10: icmp_seq=4 ttl=64 time=0.137 ms
PING 192.168.1.10 (192.168.1.10) 56(84) bytes of data.
64 bytes from 192.168.1.10: icmp_seq=1 ttl=64 time=0.453 ms
64 bytes from 192.168.1.10: icmp_seq=2 ttl=64 time=0.131 ms
64 bytes from 192.168.1.10: icmp_seq=3 ttl=64 time=0.083 ms
64 bytes from 192.168.1.10: icmp_seq=4 ttl=64 time=0.137 ms
—
192.168.1.10 ping statistics —
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 0.083/0.201/0.453/0.146 ms
[root@localhost /]#
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 0.083/0.201/0.453/0.146 ms
[root@localhost /]#
No comments:
Post a Comment