Maaf, mas kalo pertanyaan-e banyak banget. Ini nginep di kampus malem2 ga bisa tidur mikir isinya routing table molo... Bentar, enaknya pertanyaan saya ttg load balance ubuntu masukkan thread baru atau di thread ini saja yah??
Gini, intinya sama persis dengan punya-e black4rez. Dan saya implementasikan. Dan ini hasil kerjaan saya
=================== START ===============================
root@himaster-desktop:~# gedit /etc/network/interfaces
----/etc/network/interfaces------------
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 192.168.3.1
netmask 255.255.255.0
auto eth1
iface eth1 inet static
address 192.168.0.250
netmask 255.255.255.0
auto eth2
iface eth2 inet static
address 192.168.1.250
netmask 255.255.255.0
------------------------------------
root@himaster-desktop:~# /sbin/ip link set lo up
root@himaster-desktop:~# /sbin/ip link set eth0 up
root@himaster-desktop:~# /sbin/ip link set eth1 up
root@himaster-desktop:~# /sbin/ip link set eth2 up
root@himaster-desktop:~# gedit /etc/iproute2/rt_tables
------------------------------------
# reserved values
#
255 local
254 main
253 default
0 unspec
#
# local
#
#1 inr.ruhep
120 speedy1
121 speedy2
123 lan
------------------------------------
root@himaster-desktop:~# /sbin/ip route flush table speedy1
Nothing to flush.
root@himaster-desktop:~# /sbin/ip route flush table speedy2
Nothing to flush.
root@himaster-desktop:~# /sbin/ip route flush table lan
Nothing to flush.
root@himaster-desktop:~# /sbin/ip addr add 127.0.0.1/8 brd 127.0.0.255 dev lo
RTNETLINK answers: File exists
root@himaster-desktop:~# /sbin/ip addr add 192.168.0.250/24 brd 192.168.0.255 dev eth1
RTNETLINK answers: File exists
root@himaster-desktop:~# /sbin/ip addr add 192.168.1.250/24 brd 192.168.1.255 dev eth2
RTNETLINK answers: File exists
root@himaster-desktop:~# /sbin/ip addr add 192.168.3.1/24 brd 192.168.3.255 dev eth0
root@himaster-desktop:~# /sbin/ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 100
link/ether 00:15:17:28:71:ec brd ff:ff:ff:ff:ff:ff
inet 192.168.0.250/24 brd 192.168.0.255 scope global eth1
inet6 fe80::215:17ff:fe28:71ec/64 scope link
valid_lft forever preferred_lft forever
3: eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 100
link/ether 00:15:17:28:71:ea brd ff:ff:ff:ff:ff:ff
inet 192.168.1.250/24 brd 192.168.1.255 scope global eth2
inet6 fe80::215:17ff:fe28:71ea/64 scope link
valid_lft forever preferred_lft forever
4: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
link/ether 00:02:2a:d9:32:59 brd ff:ff:ff:ff:ff:ff
5: pan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN
link/ether a6:f7:74:09:83:db brd ff:ff:ff:ff:ff:ff
root@himaster-desktop:~# /sbin/ip rule add prio 10 table main
root@himaster-desktop:~# /sbin/ip rule add prio 20 table speedy1
root@himaster-desktop:~# /sbin/ip rule add prio 30 table speedy2
root@himaster-desktop:~# /sbin/ip rule add prio 40 table lan
root@himaster-desktop:~# /sbin/ip rule
0: from all lookup local
10: from all lookup main
20: from all lookup speedy1
30: from all lookup speedy2
40: from all lookup lan
32766: from all lookup main
32767: from all lookup default
himaster@himaster-desktop:~$ /sbin/ip route
192.168.1.0/24 dev eth2 proto kernel scope link src 192.168.1.250 metric 1
192.168.0.0/24 dev eth1 proto kernel scope link src 192.168.0.250 metric 1
169.254.0.0/16 dev eth2 scope link metric 1000
default via 192.168.1.1 dev eth2 proto static
root@himaster-desktop:~#
root@himaster-desktop:~# /sbin/ip route del default table main
himaster@himaster-desktop:~$ /sbin/ip route
192.168.1.0/24 dev eth2 proto kernel scope link src 192.168.1.250 metric 1
192.168.0.0/24 dev eth1 proto kernel scope link src 192.168.0.250 metric 1
169.254.0.0/16 dev eth2 scope link metric 1000
himaster@himaster-desktop:~$
root@himaster-desktop:~# /sbin/ip route del default table speedy1
RTNETLINK answers: No such process
root@himaster-desktop:~# /sbin/ip route del default table speedy2
RTNETLINK answers: No such process
root@himaster-desktop:~# /sbin/ip route del default table lan
RTNETLINK answers: No such process
root@himaster-desktop:~# /sbin/ip rule add prio 20 from 192.168.0.0/24 table speedy1
root@himaster-desktop:~# /sbin/ip route add default via 192.168.0.1 dev eth1 src 192.168.0.250 proto static table speedy1
root@himaster-desktop:~# /sbin/ip route append prohibit default table speedy1 metric 1 proto static
root@himaster-desktop:~# /sbin/ip rule add prio 30 from 192.168.1.0/24 table speedy2
root@himaster-desktop:~# /sbin/ip route add default via 192.168.1.1 dev eth2 src 192.168.1.250 proto static table speedy2
root@himaster-desktop:~# /sbin/ip route append prohibit default table speedy2 metric 5 proto static
root@himaster-desktop:~# /sbin/ip rule add prio 40 table lan
root@himaster-desktop:~# /sbin/ip route add default proto static table lan nexthop via 192.168.0.1 dev eth1 weight 1 nexthop via 192.168.1.1 dev eth2 weight 1
root@himaster-desktop:~# /sbin/ip rule
0: from all lookup local
10: from all lookup main
20: from all lookup speedy1
20: from 192.168.0.0/24 lookup speedy1
30: from all lookup speedy2
30: from 192.168.1.0/24 lookup speedy2
40: from all lookup lan
40: from all lookup lan
32766: from all lookup main
32767: from all lookup default
root@himaster-desktop:~# /sbin/ip route
192.168.1.0/24 dev eth2 proto kernel scope link src 192.168.1.250 metric 1
192.168.0.0/24 dev eth1 proto kernel scope link src 192.168.0.250 metric 1
169.254.0.0/16 dev eth2 scope link metric 1000
root@himaster-desktop:~# /bin/echo 1 > /proc/sys/net/ipv4/ip_forward
root@himaster-desktop:~# /sbin/iptables -F
root@himaster-desktop:~# /sbin/iptables -P INPUT DROP
root@himaster-desktop:~# /sbin/iptables -A INPUT -i eth0 -j ACCEPT
root@himaster-desktop:~# /sbin/iptables -A INPUT -i eth2 -p tcp -s 0/0 --dport 25 -j ACCEPT
root@himaster-desktop:~# /sbin/iptables -A INPUT -i eth1 -p tcp -s 0/0 --dport 25 -j ACCEPT
root@himaster-desktop:~# /sbin/iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
root@himaster-desktop:~# /sbin/iptables -A INPUT -p tcp -i eth2 -j REJECT --reject-with tcp-reset
root@himaster-desktop:~# /sbin/iptables -A INPUT -p tcp -i eth1 -j REJECT --reject-with tcp-reset
root@himaster-desktop:~# /sbin/iptables -A INPUT -p udp -i eth2 -j REJECT --reject-with icmp-port-unreachable
root@himaster-desktop:~# /sbin/iptables -A INPUT -p udp -i eth1 -j REJECT --reject-with icmp-port-unreachable
root@himaster-desktop:~# /sbin/iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to 192.168.0.250
root@himaster-desktop:~# /sbin/iptables -t nat -A POSTROUTING -o eth2 -j SNAT --to 192.168.1.250
==================== END ===============================
Setelah ini saya restart ubuntu-nya....
Dan setelah saya reboot, saya cek ping ke kedua gateway 192.168.1.1 dan 192.168.0.1 dan bisa. Trus saya coba ping ke internet (google.com), Ternyata ga mau... Trus saya cek lagi ke ip rule dan routenya. Hasilnya di ip rule ga kedeteksi adanya table speedy1,speedy2 dan lan yang sudah dibuat tadi. Intinya kayak dibawah ini hasil setelah restart, ip rule, ip route sama DNS...
=================== START ===============================
himaster@himaster-desktop:~$ /sbin/ip rule
0: from all lookup local
32766: from all lookup main
32767: from all lookup default
himaster@himaster-desktop:~$ /sbin/ip route
192.168.3.0/24 dev eth0 proto kernel scope link src 192.168.3.1
192.168.1.0/24 dev eth2 proto kernel scope link src 192.168.1.250
192.168.0.0/24 dev eth1 proto kernel scope link src 192.168.0.250
169.254.0.0/16 dev eth0 scope link metric 1000
himaster@himaster-desktop:~$ cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 192.168.0.1
=============== END =================================
1. Yang saya tanyakan, apa ada yang salah dalam implementasi??? Kalo ada yang mana??
2. "--dport 25" itu untuk apaan sih???
3. Sudah saya coba setting di client 192.168.3.2/24 dengan GW+DNS 192.168.3.1. tetep ga mau ngeping... Di server jg g mw ngeping. Trus gmn, aku pun makin bingung...
Mohon, minta bantuannya... Plis banget, buat tugas jaringan komputer kurang 3 hari lagi, sampe hari minggu besuk... Kasih clue, atau tolong analisis kenapa bisa begini. Thx
Oya, mohon sarannya, setiap kali restart, ip rule kembali seperti semula... Biar ga kembali seperti semula gmn??? thx