Biar gampang di cerna, kita buat contoh :
NIC 1 (enp5s0) ke Network 192.168.2.0/24
NIC 2 (enp6s0) ke Network 10.10.10.0/24
jangan lupa untuk menghubungkan kabel LAN nya ;) :P
setting manual IP untuk kedua NIC tersebut
## NIC 1 ifconfig enp5s0 up ip addr add 192.168.2.2 dev enp5s0 ## NIC 2 ifconfig enp6s0 up ip addr add 10.10.10.3 dev enp6s0
Coba cek konfigurasi IP-nya dengan
ifconfig
## output
enp5s0: flags=4163 mtu 1500
inet 192.168.2.2 netmask 255.255.255.224 broadcast 192.168.2.31
inet6 fe80::16cc:20ff:fe00:4cf2 prefixlen 64 scopeid 0x20
ether 14:cc:20:00:4c:f2 txqueuelen 1000 (Ethernet)
RX packets 31419606 bytes 25342522308 (23.6 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 38613713 bytes 23168645354 (21.5 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
enp6s0: flags=4163 mtu 1500
inet 10.10.10.3 netmask 255.255.255.248 broadcast 10.10.10.7
inet6 fe80::beee:7bff:fe9c:df76 prefixlen 64 scopeid 0x20
ether bc:ee:7b:9c:df:76 txqueuelen 1000 (Ethernet)
RX packets 949 bytes 171438 (167.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 628 bytes 76753 (74.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
sekarang jalankan perintah
sysctl net.ipv4.conf.all.rp_filter=2
agar kedua IP tersebut bisa diakses. Biar perubahan tersebut permanent jalankan perintah
echo "net.ipv4.conf.all.rp_filter = 2" >> /etc/sysctl.d/99-rp_filter.conf
Sekarang coba ping keluar
NIC 1
$ ping -c 6 -I enp5s0 google.com
PING google.com (118.98.111.44) from 192.168.2.2 enp5s0: 56(84) bytes of data.
64 bytes from 44.subnet118-98-111.astinet.telkom.net.id (118.98.111.44): icmp_seq=1 ttl=59 time=10.3 ms
64 bytes from 44.subnet118-98-111.astinet.telkom.net.id (118.98.111.44): icmp_seq=2 ttl=59 time=4.30 ms
64 bytes from 44.subnet118-98-111.astinet.telkom.net.id (118.98.111.44): icmp_seq=3 ttl=59 time=5.16 ms
64 bytes from 44.subnet118-98-111.astinet.telkom.net.id (118.98.111.44): icmp_seq=4 ttl=59 time=4.97 ms
64 bytes from 44.subnet118-98-111.astinet.telkom.net.id (118.98.111.44): icmp_seq=5 ttl=59 time=4.40 ms
64 bytes from 44.subnet118-98-111.astinet.telkom.net.id (118.98.111.44): icmp_seq=6 ttl=59 time=4.02 ms
--- google.com ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5004ms
rtt min/avg/max/mdev = 4.022/5.534/10.335/2.182 ms
NIC 2
$ ping -c 6 -I enp6s0 google.com
PING google.com (118.98.111.44) from 10.10.10.3 enp6s0: 56(84) bytes of data.
64 bytes from 44.subnet118-98-111.astinet.telkom.net.id (118.98.111.44): icmp_seq=1 ttl=59 time=6.32 ms
64 bytes from 44.subnet118-98-111.astinet.telkom.net.id (118.98.111.44): icmp_seq=2 ttl=59 time=6.25 ms
64 bytes from 44.subnet118-98-111.astinet.telkom.net.id (118.98.111.44): icmp_seq=3 ttl=59 time=4.60 ms
64 bytes from 44.subnet118-98-111.astinet.telkom.net.id (118.98.111.44): icmp_seq=4 ttl=59 time=3.92 ms
64 bytes from 44.subnet118-98-111.astinet.telkom.net.id (118.98.111.44): icmp_seq=5 ttl=59 time=4.14 ms
64 bytes from 44.subnet118-98-111.astinet.telkom.net.id (118.98.111.44): icmp_seq=6 ttl=59 time=5.33 ms
--- google.com ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5004ms
rtt min/avg/max/mdev = 3.924/5.097/6.323/0.956 ms
kedua-duanya bisa mengakses internet, sekarang coba ping dari LAN
$ ping -c6 10.10.10.3; ping -c6 192.168.2.2 PING 10.10.10.3 (10.10.10.3) 56(84) bytes of data. 64 bytes from 10.10.10.3: icmp_seq=1 ttl=64 time=0.446 ms 64 bytes from 10.10.10.3: icmp_seq=2 ttl=64 time=0.354 ms 64 bytes from 10.10.10.3: icmp_seq=3 ttl=64 time=0.383 ms 64 bytes from 10.10.10.3: icmp_seq=4 ttl=64 time=0.378 ms 64 bytes from 10.10.10.3: icmp_seq=5 ttl=64 time=0.369 ms 64 bytes from 10.10.10.3: icmp_seq=6 ttl=64 time=0.391 ms --- 10.10.10.3 ping statistics --- 6 packets transmitted, 6 received, 0% packet loss, time 4999ms rtt min/avg/max/mdev = 0.354/0.386/0.446/0.038 ms PING 192.168.2.2 (192.168.2.2) 56(84) bytes of data. 64 bytes from 192.168.2.2: icmp_seq=1 ttl=64 time=0.225 ms 64 bytes from 192.168.2.2: icmp_seq=2 ttl=64 time=0.248 ms 64 bytes from 192.168.2.2: icmp_seq=3 ttl=64 time=0.245 ms 64 bytes from 192.168.2.2: icmp_seq=4 ttl=64 time=0.230 ms 64 bytes from 192.168.2.2: icmp_seq=5 ttl=64 time=0.244 ms 64 bytes from 192.168.2.2: icmp_seq=6 ttl=64 time=0.247 ms --- 192.168.2.2 ping statistics --- 6 packets transmitted, 6 received, 0% packet loss, time 5000ms rtt min/avg/max/mdev = 0.225/0.239/0.248/0.021 ms
kedua NIC tersebut sudah bisa digunakan secara bersama-sama aka Channel Bonding. Contoh kegunaan menggunakan 2 NIC : bila NIC Server anda maksimal 100 Mbps dan ada 1 orang yang mendownload 100 Mbps maka otomatis semuanya disedot oleh orang tersebut, dengan channel bonding, anda masih memiliki cadangan 100 Mbps, dengan asumsi kedua NIC tersebut max 100 Mbps, jadi bila ada orang kedua yang mendownload dari server tersebut dia masih bisa mendapatkan 100 Mbps. Tetapi 1 user tidak bisa mendapatkan kecepatan penuh dari kedua NIC (200 Mbps) tersebut, karena maksimal 1 NIC hanya 100 Mbps.