Saya baru menjadi admin sistem Linux dan saya belajar tentang tabel routing.
Saat ini saya memiliki dua antarmuka di mesin virtual saya:
vagrant@vagrant-ubuntu-trusty-64:~$ ifconfig
eth0 Link encap:Ethernet HWaddr 08:00:27:2e:8d:5d
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe2e:8d5d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3146 errors:0 dropped:0 overruns:0 frame:0
TX packets:2853 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:218526 (218.5 KB) TX bytes:212044 (212.0 KB)
eth1 Link encap:Ethernet HWaddr 08:00:27:5b:5e:65
inet addr:172.28.128.3 Bcast:172.28.128.255 Mask:255.255.255.0
inet6 addr: fe80::a00:27ff:fe5b:5e65/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:14 errors:0 dropped:0 overruns:0 frame:0
TX packets:31 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5080 (5.0 KB) TX bytes:4622 (4.6 KB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Ketika saya mengeksekusi route -
n, saya melihat tabel berikut:
vagrant@vagrant-ubuntu-trusty-64:~$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.0.2.2 0.0.0.0 UG 0 0 0 eth0
10.0.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
172.28.128.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
Saya tahu bahwa entri pertama adalah rute default. Hanya ingin tahu apa arti entri entri 2 dan 3 gateway (0.0.0.0) di sini?
ip addr
danip route
alat.