Setup IP address Linux
mamadzus@mamadzus:~$ sudo nano /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
allow-hotplug eth0
iface eth0 inet static
address 121.*.*.*
netmask 255.255.255.248
gateway 121.*.*.*
auto eth1
iface eth1 inet static
address 10.*.*.*
netmask 255.255.252.0
gateway 10.*.*.1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Setup Routing Table Linux
root@asterisk:~# route add default gw 121.*.*.134 eth0
root@asterisk:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
121.*.*.128 * 255.255.255.248 U 0 0 0 eth0
10.31.0.0 * 255.255.252.0 U 0 0 0 eth1
default 121.*.*.134 0.0.0.0 UG 0 0 0 eth0
default 10.31.0.1 0.0.0.0 UG 0 0 0 eth1
root@asterisk:~# route del default gw 10.31.0.1 eth1
root@asterisk:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
121.*.*.128 * 255.255.255.248 U 0 0 0 eth0
10.31.0.0 * 255.255.252.0 U 0 0 0 eth1
default 121.*.*.134 0.0.0.0 UG 0 0 0 eth0
root@asterisk:~# ping google.com
PING google.com (209.85.171.100) 56(84) bytes of data.
64 bytes from cg-in-f100.google.com (209.85.171.100): icmp_seq=1 ttl=238 time=191 ms
64 bytes from cg-in-f100.google.com (209.85.171.100): icmp_seq=2 ttl=238 time=188 ms
regard,
Mamadzus
ma2d_te@yahoo.com
+62 817 540 4448
0 comments:
Post a Comment