summaryrefslogtreecommitdiffstats
path: root/man/man8/ip.8
blob: 3efa0455cd8e503a5f732c8b1a2251be79cff067 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
.TH IP 8 "17 January 2002" "iproute2" "Linux"
.SH NAME
ip \- show / manipulate routing, devices, policy routing and tunnels
.SH SYNOPSIS

.ad l
.in +8
.ti -8
.B ip
.RI "[ " OPTIONS " ] " OBJECT " { " COMMAND " | "
.BR help " }"
.sp

.ti -8
.IR OBJECT " := { "
.BR link " | " addr " | " addrlabel " | " route " | " rule " | " neigh " | "\
 tunnel " | " maddr " | "  mroute " | " monitor " }"
.sp

.ti -8
.IR OPTIONS " := { "
\fB\-V\fR[\fIersion\fR] |
\fB\-s\fR[\fItatistics\fR] |
\fB\-r\fR[\fIesolve\fR] |
\fB\-f\fR[\fIamily\fR] {
.BR inet " | " inet6 " | " ipx " | " dnet " | " link " } | "
\fB\-o\fR[\fIneline\fR] }

.ti -8
.BI "ip link set " DEVICE
.RB "{ " up " | " down " | " arp " { " on " | " off " } |"
.br
.BR promisc " { " on " | " off " } |"
.br
.BR allmulticast " { " on " | " off " } |"
.br
.BR dynamic " { " on " | " off " } |"
.br
.BR multicast " { " on " | " off " } |"
.br
.B  txqueuelen
.IR PACKETS " |"
.br
.B  name
.IR NEWNAME " |"
.br
.B  address
.IR LLADDR " |"
.B  broadcast
.IR LLADDR " |"
.br
.B  mtu
.IR MTU " |"
.br
.B  netns
.IR PID " |"
.br
.B alias
.IR NAME  " |"
.br
.B vf
.IR NUM " ["
.B  mac
.IR LLADDR " ] ["
.B vlan
.IR VLANID " [ "
.B qos
.IR VLAN-QOS " ] ] ["
.B rate
.IR TXRATE " ]"
.BR " }"


.ti -8
.B ip link show
.RI "[ " DEVICE " ]"

.ti -8
.BR "ip addr" " { " add " | " del " } "
.IB IFADDR " dev " STRING

.ti -8
.BR "ip addr" " { " show " | " flush " } [ " dev
.IR STRING " ] [ "
.B  scope
.IR SCOPE-ID " ] [ "
.B  to
.IR PREFIX " ] [ " FLAG-LIST " ] [ "
.B  label
.IR PATTERN " ]"

.ti -8
.IR IFADDR " := " PREFIX " | " ADDR
.B  peer
.IR PREFIX " [ "
.B  broadcast
.IR ADDR " ] [ "
.B  anycast
.IR ADDR " ] [ "
.B  label
.IR STRING " ] [ "
.B  scope
.IR SCOPE-ID " ]"

.ti -8
.IR SCOPE-ID " := "
.RB "[ " host " | " link " | " global " | "
.IR NUMBER " ]"

.ti -8
.IR FLAG-LIST " := [ "  FLAG-LIST " ] " FLAG

.ti -8
.IR FLAG " := "
.RB "[ " permanent " | " dynamic " | " secondary " | " primary " | "\
tentative " | " deprecated " | " dadfailed " | " temporary " ]"

.ti -8
.BR "ip addrlabel" " { " add " | " del " } " prefix
.BR PREFIX " [ "
.B dev
.IR DEV " ] [ "
.B label
.IR NUMBER " ]"

.ti -8
.BR "ip addrlabel" " { " list " | " flush " }"

.ti -8
.BR "ip route" " { "
.BR list " | " flush " } "
.I  SELECTOR

.ti -8
.B  ip route get
.IR ADDRESS " [ "
.BI from " ADDRESS " iif " STRING"
.RB " ] [ " oif
.IR STRING " ] [ "
.B  tos
.IR TOS " ]"

.ti -8
.BR "ip route" " { " add " | " del " | " change " | " append " | "\
replace " | " monitor " } "
.I  ROUTE

.ti -8
.IR SELECTOR " := "
.RB "[ " root
.IR PREFIX " ] [ "
.B  match
.IR PREFIX " ] [ "
.B  exact
.IR PREFIX " ] [ "
.B  table
.IR TABLE_ID " ] [ "
.B  proto
.IR RTPROTO " ] [ "
.B  type
.IR TYPE " ] [ "
.B  scope
.IR SCOPE " ]"

.ti -8
.IR ROUTE " := " NODE_SPEC " [ " INFO_SPEC " ]"

.ti -8
.IR NODE_SPEC " := [ " TYPE " ] " PREFIX " ["
.B  tos
.IR TOS " ] [ "
.B  table
.IR TABLE_ID " ] [ "
.B  proto
.IR RTPROTO " ] [ "
.B  scope
.IR SCOPE " ] [ "
.B  metric
.IR METRIC " ]"

.ti -8
.IR INFO_SPEC " := " "NH OPTIONS FLAGS" " ["
.B  nexthop
.IR NH " ] ..."

.ti -8
.IR NH " := [ "
.B  via
.IR ADDRESS " ] [ "
.B  dev
.IR STRING " ] [ "
.B  weight
.IR NUMBER " ] " NHFLAGS

.ti -8
.IR OPTIONS " := " FLAGS " [ "
.B  mtu
.IR NUMBER " ] [ "
.B  advmss
.IR NUMBER " ] [ "
.B  rtt
.IR TIME " ] [ "
.B  rttvar
.IR TIME " ] [ "
.B  window
.IR NUMBER " ] [ "
.B  cwnd
.IR NUMBER " ] [ "
.B  ssthresh
.IR REALM " ] [ "
.B  realms
.IR REALM " ] [ "
.B  rto_min
.IR TIME " ]"

.ti -8
.IR TYPE " := [ "
.BR unicast " | " local " | " broadcast " | " multicast " | "\
throw " | " unreachable " | " prohibit " | " blackhole " | " nat " ]"

.ti -8
.IR TABLE_ID " := [ "
.BR local "| " main " | " default " | " all " |"
.IR NUMBER " ]"

.ti -8
.IR SCOPE " := [ "
.BR host " | " link " | " global " |"
.IR NUMBER " ]"

.ti -8
.IR NHFLAGS " := [ "
.BR onlink " | " pervasive " ]"

.ti -8
.IR RTPROTO " := [ "
.BR kernel " | " boot " | " static " |"
.IR NUMBER " ]"

.ti -8
.B  ip rule
.RB " [ " list " | " add " | " del " | " flush " ]"
.I  SELECTOR ACTION

.ti -8
.IR SELECTOR " := [ "
.B  from
.IR PREFIX " ] [ "
.B  to
.IR PREFIX " ] [ "
.B  tos
.IR TOS " ] [ "
.B  fwmark
.IR FWMARK[/MASK] " ] [ "
.B  iif
.IR STRING " ] [ "
.B  oif
.IR STRING " ] [ "
.B  pref
.IR NUMBER " ]"

.ti -8
.IR ACTION " := [ "
.B  table
.IR TABLE_ID " ] [ "
.B  nat
.IR ADDRESS " ] [ "
.BR prohibit " | " reject " | " unreachable " ] [ " realms
.RI "[" SRCREALM "/]" DSTREALM " ]"

.ti -8
.IR TABLE_ID " := [ "
.BR local " | " main " | " default " |"
.IR NUMBER " ]"

.ti -8
.BR "ip neigh" " { " add " | " del " | " change " | " replace " } { "
.IR ADDR " [ "
.B  lladdr
.IR LLADDR " ] [ "
.BR nud " { " permanent " | " noarp " | " stale " | " reachable " } ] | " proxy
.IR ADDR " } [ "
.B  dev
.IR DEV " ]"

.ti -8
.BR "ip neigh" " { " show " | " flush " } [ " to
.IR PREFIX " ] [ "
.B  dev
.IR DEV " ] [ "
.B  nud
.IR STATE " ]"

.ti -8
.BR "ip tunnel" " { " add " | " change " | " del " | " show " | " prl " }"
.RI "[ " NAME " ]"
.br
.RB "[ " mode
.IR MODE " ] [ "
.B remote
.IR ADDR " ] [ "
.B  local
.IR ADDR " ]"
.br
.RB "[ [" i "|" o "]" seq " ] [ [" i "|" o "]" key
.IR KEY " ] [ "
.RB "[" i "|" o "]" csum " ] ]"
.br
.RB "[ " encaplimit
.IR ELIM " ]"
.RB "[ " ttl
.IR TTL " ]"
.br
.RB "[ " tos
.IR TOS " ] [ "
.B flowlabel
.IR FLOWLABEL " ]"
.br
.RB "[ " prl-default
.IR ADDR " ] [ "
.B prl-nodefault
.IR ADDR " ] [ "
.B prl-delete
.IR ADDR " ]"
.br
.RB "[ [" no "]" pmtudisc " ]"
.RB "[ " dev
.IR PHYS_DEV " ]"
.RB "[ " "dscp inherit" " ]"

.ti -8
.IR MODE " := "
.RB " { " ipip " | " gre " | " sit " | " isatap " | " ip6ip6 " | " ipip6 " | " any " }"

.ti -8
.IR ADDR " := { " IP_ADDRESS " |"
.BR any " }"

.ti -8
.IR TOS " := { " NUMBER " |"
.BR inherit " }"

.ti -8
.IR ELIM " := {
.BR none " | "
.IR 0 ".." 255 " }"

.ti -8
.ti -8
.IR TTL " := { " 1 ".." 255 " | "
.BR inherit " }"

.ti -8
.IR KEY " := { " DOTTED_QUAD " | " NUMBER " }"

.ti -8
.IR TIME " := " NUMBER "[s|ms|us|ns|j]"

.ti -8
.BR "ip maddr" " [ " add " | " del " ]"
.IB MULTIADDR " dev " STRING

.ti -8
.BR "ip maddr show" " [ " dev
.IR STRING " ]"

.ti -8
.BR "ip mroute show" " ["
.IR PREFIX " ] [ "
.B  from
.IR PREFIX " ] [ "
.B  iif
.IR DEVICE " ]"

.ti -8
.BR "ip monitor" " [ " all " |"
.IR LISTofOBJECTS " ]"

.ti -8
.BR "ip xfrm"
.IR XFRM_OBJECT " { " COMMAND " }"

.ti -8
.IR XFRM_OBJECT " := { " state " | " policy " | " monitor " } "

.ti -8
.BR "ip xfrm state " { " add " | " update " } "
.IR ID " [ "
.IR XFRM_OPT " ] "
.RB " [ " mode
.IR MODE " ] "
.br
.RB " [ " reqid
.IR REQID " ] "
.RB " [ " seq
.IR SEQ " ] "
.RB " [ " replay-window
.IR SIZE " ] "
.br
.RB " [ " flag
.IR FLAG-LIST " ] "
.RB " [ " encap
.IR ENCAP " ] "
.RB " [ " sel
.IR SELECTOR " ] "
.br
.RB " [ "
.IR LIMIT-LIST " ] "

.ti -8
.BR "ip xfrm state allocspi "
.IR ID
.RB " [ " mode
.IR MODE " ] "
.RB " [ " reqid
.IR REQID " ] "
.RB " [ " seq
.IR SEQ " ] "
.RB " [ " min
.IR SPI
.B max
.IR SPI " ] "

.ti -8
.BR "ip xfrm state" " { " delete " | " get " } "
.IR ID

.ti -8
.BR "ip xfrm state" " { " deleteall " | " list " } [ "
.IR ID " ] "
.RB " [ " mode
.IR MODE " ] "
.br
.RB " [ " reqid
.IR REQID " ] "
.RB " [ " flag
.IR FLAG_LIST " ] "

.ti -8
.BR "ip xfrm state flush" " [ " proto
.IR XFRM_PROTO " ] "

.ti -8
.BR "ip xfrm state count"

.ti -8
.IR ID " := "
.RB " [ " src
.IR ADDR " ] "
.RB " [ " dst
.IR ADDR " ] "
.RB " [ " proto
.IR XFRM_PROTO " ] "
.RB " [ " spi
.IR SPI " ] "

.ti -8
.IR XFRM_PROTO " := "
.RB " [ " esp " | " ah " | " comp " | " route2 " | " hao " ] "

.ti -8
.IR MODE " := "
.RB " [ " transport " | " tunnel " | " ro " | " beet " ] "
.B (default=transport)

.ti -8
.IR FLAG-LIST " := "
.RI " [ " FLAG-LIST " ] " FLAG

.ti -8
.IR FLAG " := "
.RB " [ " noecn " | " decap-dscp " | " wildrecv " ] "

.ti -8
.IR ENCAP " := " ENCAP-TYPE " " SPORT " " DPORT " " OADDR

.ti -8
.IR ENCAP-TYPE " := "
.B espinudp
.RB " | "
.B espinudp-nonike

.ti -8
.IR ALGO-LIST " := [ "
.IR ALGO-LIST " ] | [ "
.IR ALGO " ] "

.ti -8
.IR ALGO " := "
.IR ALGO_TYPE
.IR ALGO_NAME
.IR ALGO_KEY

.ti -8
.IR ALGO_TYPE " := "
.RB " [ " enc " | " auth " | " comp " ] "

.ti -8
.IR SELECTOR " := "
.B src
.IR ADDR "[/" PLEN "]"
.B dst
.IR ADDR "[/" PLEN "]"
.RI " [ " UPSPEC " ] "
.RB " [ " dev
.IR DEV " ] "

.ti -8
.IR UPSPEC " := "
.B proto
.IR PROTO " [[ "
.B sport
.IR PORT " ] "
.RB " [ " dport
.IR PORT " ] | "
.br
.RB " [ " type
.IR NUMBER " ] "
.RB " [ " code
.IR NUMBER " ]] "

.ti -8
.IR LIMIT-LIST " := [ " LIMIT-LIST " ] |"
.RB " [ "limit
.IR LIMIT " ] "

.ti -8
.IR LIMIT " := "
.RB " [ [" time-soft "|" time-hard "|" time-use-soft "|" time-use-hard "]"
.IR SECONDS " ] | "
.RB "[ ["byte-soft "|" byte-hard "]"
.IR SIZE " ] | "
.br
.RB " [ ["packet-soft "|" packet-hard "]"
.IR COUNT " ] "

.ti -8
.BR "ip xfrm policy" " { " add " | " update " } " " dir "
.IR DIR
.IR SELECTOR " [ "
.BR index
.IR INDEX " ] "
.br
.RB " [ " ptype
.IR PTYPE " ] "
.RB " [ " action
.IR ACTION " ] "
.RB " [ " priority
.IR PRIORITY " ] "
.br
.RI " [ " LIMIT-LIST " ] [ "
.IR TMPL-LIST " ] "

.ti -8
.BR "ip xfrm policy" " { " delete " | " get " } " " dir "
.IR DIR " [ " SELECTOR " | "
.BR index
.IR INDEX
.RB " ] "
.br
.RB " [ " ptype
.IR PTYPE " ] "

.ti -8
.BR "ip xfrm policy" " { " deleteall " | " list " } "
.RB " [ " dir
.IR DIR " ] [ "
.IR SELECTOR " ] "
.br
.RB " [ " index
.IR INDEX " ] "
.RB " [ " action
.IR ACTION " ] "
.RB " [ " priority
.IR PRIORITY " ] "

.ti -8
.B "ip xfrm policy flush"
.RB " [ " ptype
.IR PTYPE " ] "

.ti -8
.B "ip xfrm count"

.ti -8
.IR PTYPE " := "
.RB " [ " main " | " sub " ] "
.B (default=main)

.ti -8
.IR DIR " := "
.RB " [ " in " | " out " | " fwd " ] "

.ti -8
.IR SELECTOR " := "
.B src
.IR ADDR "[/" PLEN "]"
.B dst
.IR ADDR "[/" PLEN] " [ " UPSPEC
.RB " ] [ " dev
.IR DEV " ] "

.ti -8
.IR UPSPEC " := "
.B proto
.IR PROTO " [ "
.RB " [ " sport
.IR PORT " ] "
.RB " [ " dport
.IR PORT " ] | "
.br
.RB " [ " type
.IR NUMBER " ] "
.RB " [ " code
.IR NUMBER " ] ] "

.ti -8
.IR ACTION " := "
.RB " [ " allow " | " block " ]"
.B (default=allow)

.ti -8
.IR LIMIT-LIST " := "
.RB " [ "
.IR LIMIT-LIST " ] | "
.RB " [ " limit
.IR LIMIT " ] "

.ti -8
.IR LIMIT " := "
.RB " [ [" time-soft "|" time-hard "|" time-use-soft "|" time-use-hard "]"
.IR SECONDS " ] | "
.RB " [ [" byte-soft "|" byte-hard "]"
.IR SIZE " ] | "
.br [ "
.RB "[" packet-soft "|" packet-hard "]"
.IR NUMBER " ] "

.ti -8
.IR TMPL-LIST " := "
.B " [ "
.IR TMPL-LIST " ] | "
.RB " [ " tmpl
.IR TMPL " ] "

.ti -8
.IR TMPL " := "
.IR ID " [ "
.B mode
.IR MODE " ] "
.RB " [ " reqid
.IR REQID " ] "
.RB " [ " level
.IR LEVEL " ] "

.ti -8
.IR ID " := "
.RB " [ " src
.IR ADDR " ] "
.RB " [ " dst
.IR ADDR " ] "
.RB " [ " proto
.IR XFRM_PROTO " ] "
.RB " [ " spi
.IR SPI " ] "

.ti -8
.IR XFRM_PROTO " := "
.RB " [ " esp " | " ah " | " comp " | " route2 " | " hao " ] "

.ti -8
.IR MODE " := "
.RB " [ " transport " | " tunnel " | " beet " ] "
.B (default=transport)

.ti -8
.IR LEVEL " := "
.RB " [ " required " | " use " ] "
.B (default=required)

.ti -8
.BR "ip xfrm monitor" " [ " all " | "
.IR LISTofOBJECTS " ] "

.in -8
.ad b

.SH OPTIONS

.TP
.BR "\-V" , " -Version"
print the version of the
.B ip
utility and exit.

.TP
.BR "\-s" , " \-stats", " \-statistics"
output more information.  If the option
appears twice or more, the amount of information increases.
As a rule, the information is statistics or some time values.

.TP
.BR "\-f" , " \-family"
followed by protocol family identifier:
.BR "inet" , " inet6"
or
.B link
,enforce the protocol family to use.  If the option is not present,
the protocol family is guessed from other arguments.  If the rest
of the command line does not give enough information to guess the
family,
.B ip
falls back to the default one, usually
.B inet
or
.BR "any" .
.B link
is a special family identifier meaning that no networking protocol
is involved.

.TP
.B \-4
shortcut for
.BR "-family inet" .

.TP
.B \-6
shortcut for
.BR "\-family inet6" .

.TP
.B \-0
shortcut for
.BR "\-family link" .

.TP
.BR "\-o" , " \-oneline"
output each record on a single line, replacing line feeds
with the
.B '\e\'
character. This is convenient when you want to count records
with
.BR wc (1)
 or to
.BR grep (1)
the output.

.TP
.BR "\-r" , " \-resolve"
use the system's name resolver to print DNS names instead of
host addresses.

.SH IP - COMMAND SYNTAX

.SS
.I OBJECT

.TP
.B link
- network device.

.TP
.B address
- protocol (IP or IPv6) address on a device.

.TP
.B addrlabel
- label configuration for protocol address selection.

.TP
.B neighbour
- ARP or NDISC cache entry.

.TP
.B route
- routing table entry.

.TP
.B rule
- rule in routing policy database.

.TP
.B maddress
- multicast address.

.TP
.B mroute
- multicast routing cache entry.

.TP
.B tunnel
- tunnel over IP.

.TP
.B xfrm
- framework for IPsec protocol.

.PP
The names of all objects may be written in full or
abbreviated form, f.e.
.B address
is abbreviated as
.B addr
or just
.B a.

.SS
.I COMMAND

Specifies the action to perform on the object.
The set of possible actions depends on the object type.
As a rule, it is possible to
.BR "add" , " delete"
and
.B show
(or
.B list
) objects, but some objects do not allow all of these operations
or have some additional commands.  The
.B help
command is available for all objects.  It prints
out a list of available commands and argument syntax conventions.
.sp
If no command is given, some default command is assumed.
Usually it is
.B list
or, if the objects of this class cannot be listed,
.BR "help" .

.SH ip link - network device configuration

.B link
is a network device and the corresponding commands
display and change the state of devices.

.SS ip link set - change device attributes

.TP
.BI dev " NAME " (default)
.I NAME
specifies network device to operate on. When configuring SR-IOV Virtual Fuction
(VF) devices, this keyword should specify the associated Physical Function (PF)
device.

.TP
.BR up " and " down
change the state of the device to
.B UP
or
.BR "DOWN" .

.TP
.BR "arp on " or " arp off"
change the
.B NOARP
flag on the device.

.TP
.BR "multicast on " or " multicast off"
change the
.B MULTICAST
flag on the device.

.TP
.BR "dynamic on " or " dynamic off"
change the
.B DYNAMIC
flag on the device.

.TP
.BI name " NAME"
change the name of the device.  This operation is not
recommended if the device is running or has some addresses
already configured.

.TP
.BI txqueuelen " NUMBER"
.TP
.BI txqlen " NUMBER"
change the transmit queue length of the device.

.TP
.BI mtu " NUMBER"
change the
.I MTU
of the device.

.TP
.BI address " LLADDRESS"
change the station address of the interface.

.TP
.BI broadcast " LLADDRESS"
.TP
.BI brd " LLADDRESS"
.TP
.BI peer " LLADDRESS"
change the link layer broadcast address or the peer address when
the interface is
.IR "POINTOPOINT" .

.TP
.BI netns " PID"
move the device to the network namespace associated with the process
.IR "PID".

.TP
.BI alias " NAME"
give the device a symbolic name for easy reference.

.TP
.BI vf " NUM"
specify a Virtual Function device to be configured. The associated PF device
must be specified using the
.B dev
parameter.

.in +8
.BI mac " LLADDRESS"
- change the station address for the specified VF. The
.B vf
parameter must be specified.

.sp
.BI vlan " VLANID"
- change the assigned VLAN for the specified VF. When specified, all traffic
sent from the VF will be tagged with the specified VLAN ID. Incoming traffic
will be filtered for the specified VLAN ID, and will have all VLAN tags
stripped before being passed to the VF. Setting this parameter to 0 disables
VLAN tagging and filtering. The
.B vf
parameter must be specified.

.sp
.BI qos " VLAN-QOS"
- assign VLAN QOS (priority) bits for the VLAN tag. When specified, all VLAN
tags transmitted by the VF will include the specified priority bits in the
VLAN tag. If not specified, the value is assumed to be 0. Both the
.B vf
and
.B vlan
parameters must be specified. Setting both
.B vlan
and
.B qos
as 0 disables VLAN tagging and filtering for the VF.

.sp
.BI rate " TXRATE"
- change the allowed transmit bandwidth, in Mbps, for the specified VF.
Setting this parameter to 0 disables rate limiting. The
.B vf
parameter must be specified.
.in -8

.PP
.B Warning:
If multiple parameter changes are requested,
.B ip
aborts immediately after any of the changes have failed.
This is the only case when
.B ip
can move the system to an unpredictable state.  The solution
is to avoid changing several parameters with one
.B ip link set
call.

.SS  ip link show - display device attributes

.TP
.BI dev " NAME " (default)
.I NAME
specifies the network device to show.
If this argument is omitted all devices are listed.

.TP
.B up
only display running interfaces.

.SH ip address - protocol address management.

The
.B address
is a protocol (IP or IPv6) address attached
to a network device.  Each device must have at least one address
to use the corresponding protocol.  It is possible to have several
different addresses attached to one device.  These addresses are not
discriminated, so that the term
.B alias
is not quite appropriate for them and we do not use it in this document.
.sp
The
.B ip addr
command displays addresses and their properties, adds new addresses
and deletes old ones.

.SS ip address add - add new protocol address.

.TP
.BI dev " NAME"
the name of the device to add the address to.

.TP
.BI local " ADDRESS " (default)
the address of the interface. The format of the address depends
on the protocol. It is a dotted quad for IP and a sequence of
hexadecimal halfwords separated by colons for IPv6.  The
.I ADDRESS
may be followed by a slash and a decimal number which encodes
the network prefix length.

.TP
.BI peer " ADDRESS"
the address of the remote endpoint for pointopoint interfaces.
Again, the
.I ADDRESS
may be followed by a slash and a decimal number, encoding the network
prefix length.  If a peer address is specified, the local address
cannot have a prefix length.  The network prefix is associated
with the peer rather than with the local address.

.TP
.BI broadcast " ADDRESS"
the broadcast address on the interface.
.sp
It is possible to use the special symbols
.B '+'
and
.B '-'
instead of the broadcast address.  In this case, the broadcast address
is derived by setting/resetting the host bits of the interface prefix.

.TP
.BI label " NAME"
Each address may be tagged with a label string.
In order to preserve compatibility with Linux-2.0 net aliases,
this string must coincide with the name of the device or must be prefixed
with the device name followed by colon.

.TP
.BI scope " SCOPE_VALUE"
the scope of the area where this address is valid.
The available scopes are listed in file
.BR "/etc/iproute2/rt_scopes" .
Predefined scope values are:

.in +8
.B global
- the address is globally valid.
.sp
.B site
- (IPv6 only) the address is site local, i.e. it is
valid inside this site.
.sp
.B link
- the address is link local, i.e. it is valid only on this device.
.sp
.B host
- the address is valid only inside this host.
.in -8

.SS ip address delete - delete protocol address
.B Arguments:
coincide with the arguments of
.B ip addr add.
The device name is a required argument.  The rest are optional.
If no arguments are given, the first address is deleted.

.SS ip address show - look at protocol addresses

.TP
.BI dev " NAME " (default)
name of device.

.TP
.BI scope " SCOPE_VAL"
only list addresses with this scope.

.TP
.BI to " PREFIX"
only list addresses matching this prefix.

.TP
.BI label " PATTERN"
only list addresses with labels matching the
.IR "PATTERN" .
.I PATTERN
is a usual shell style pattern.

.TP
.BR dynamic " and " permanent
(IPv6 only) only list addresses installed due to stateless
address configuration or only list permanent (not dynamic)
addresses.

.TP
.B tentative
(IPv6 only) only list addresses which have not yet passed duplicate
address detection.

.TP
.B deprecated
(IPv6 only) only list deprecated addresses.

.TP
.B dadfailed
(IPv6 only) only list addresses which have failed duplicate
address detection.

.TP
.B temporary
(IPv6 only) only list temporary addresses.

.TP
.BR primary " and " secondary
only list primary (or secondary) addresses.

.SS ip address flush - flush protocol addresses
This command flushes the protocol addresses selected by some criteria.

.PP
This command has the same arguments as
.B show.
The difference is that it does not run when no arguments are given.

.PP
.B Warning:
This command (and other
.B flush
commands described below) is pretty dangerous.  If you make a mistake,
it will not forgive it, but will cruelly purge all the addresses.

.PP
With the
.B -statistics
option, the command becomes verbose. It prints out the number of deleted
addresses and the number of rounds made to flush the address list.  If
this option is given twice,
.B ip addr flush
also dumps all the deleted addresses in the format described in the
previous subsection.

.SH ip addrlabel - protocol address label management.

IPv6 address label is used for address selection
described in RFC 3484.  Precedence is managed by userspace,
and only label is stored in kernel.

.SS ip addrlabel add - add an address label
the command adds an address label entry to the kernel.
.TP
.BI prefix " PREFIX"
.TP
.BI dev " DEV"
the outgoing interface.
.TP
.BI label " NUMBER"
the label for the prefix.
0xffffffff is reserved.
.SS ip addrlabel del - delete an address label
the command deletes an address label entry in the kernel.
.B Arguments:
coincide with the arguments of
.B ip addrlabel add
but label is not required.
.SS ip addrlabel list - list address labels
the command show contents of address labels.
.SS ip addrlabel flush - flush address labels
the command flushes the contents of address labels and it does not restore default settings.
.SH ip neighbour - neighbour/arp tables management.

.B neighbour
objects establish bindings between protocol addresses and
link layer addresses for hosts sharing the same link.
Neighbour entries are organized into tables. The IPv4 neighbour table
is known by another name - the ARP table.

.P
The corresponding commands display neighbour bindings
and their properties, add new neighbour entries and delete old ones.

.SS ip neighbour add - add a new neighbour entry
.SS ip neighbour change - change an existing entry
.SS ip neighbour replace - add a new entry or change an existing one

These commands create new neighbour records or update existing ones.

.TP
.BI to " ADDRESS " (default)
the protocol address of the neighbour. It is either an IPv4 or IPv6 address.

.TP
.BI dev " NAME"
the interface to which this neighbour is attached.

.TP
.BI lladdr " LLADDRESS"
the link layer address of the neighbour.
.I LLADDRESS
can also be
.BR "null" .

.TP
.BI nud " NUD_STATE"
the state of the neighbour entry.
.B nud
is an abbreviation for 'Neigh bour Unreachability Detection'.
The state can take one of the following values:

.in +8
.B permanent
- the neighbour entry is valid forever and can be only
be removed administratively.
.sp

.B noarp
- the neighbour entry is valid. No attempts to validate
this entry will be made but it can be removed when its lifetime expires.
.sp

.B reachable
- the neighbour entry is valid until the reachability
timeout expires.
.sp

.B stale
- the neighbour entry is valid but suspicious.
This option to
.B ip neigh
does not change the neighbour state if it was valid and the address
is not changed by this command.
.in -8

.SS ip neighbour delete - delete a neighbour entry
This command invalidates a neighbour entry.

.PP
The arguments are the same as with
.BR "ip neigh add" ,
except that
.B lladdr
and
.B nud
are ignored.

.PP
.B Warning:
Attempts to delete or manually change a
.B noarp
entry created by the kernel may result in unpredictable behaviour.
Particularly, the kernel may try to resolve this address even
on a
.B NOARP
interface or if the address is multicast or broadcast.

.SS ip neighbour show - list neighbour entries

This commands displays neighbour tables.

.TP
.BI to " ADDRESS " (default)
the prefix selecting the neighbours to list.

.TP
.BI dev " NAME"
only list the neighbours attached to this device.

.TP
.B unused
only list neighbours which are not currently in use.

.TP
.BI nud " NUD_STATE"
only list neighbour entries in this state.
.I NUD_STATE
takes values listed below or the special value
.B all
which means all states.  This option may occur more than once.
If this option is absent,
.B ip
lists all entries except for
.B none
and
.BR "noarp" .

.SS ip neighbour flush - flush neighbour entries
This command flushes neighbour tables, selecting
entries to flush by some criteria.

.PP
This command has the same arguments as
.B show.
The differences are that it does not run when no arguments are given,
and that the default neighbour states to be flushed do not include
.B permanent
and
.BR "noarp" .

.PP
With the
.B -statistics
option, the command becomes verbose.  It prints out the number of
deleted neighbours and the number of rounds made to flush the
neighbour table.  If the option is given
twice,
.B ip neigh flush
also dumps all the deleted neighbours.

.SH ip route - routing table management
Manipulate route entries in the kernel routing tables keep
information about paths to other networked nodes.
.sp
.B Route types:

.in +8
.B unicast
- the route entry describes real paths to the destinations covered
by the route prefix.

.sp
.B unreachable
- these destinations are unreachable.  Packets are discarded and the
ICMP message
.I host unreachable
is generated.
The local senders get an
.I EHOSTUNREACH
error.

.sp
.B blackhole
- these destinations are unreachable.  Packets are discarded silently.
The local senders get an
.I EINVAL
error.

.sp
.B prohibit
- these destinations are unreachable.  Packets are discarded and the
ICMP message
.I communication administratively prohibited
is generated.  The local senders get an
.I EACCES
error.

.sp
.B local
- the destinations are assigned to this host.  The packets are looped
back and delivered locally.

.sp
.B broadcast
- the destinations are broadcast addresses.  The packets are sent as
link broadcasts.

.sp
.B throw
- a special control route used together with policy rules. If such a
route is selected, lookup in this table is terminated pretending that
no route was found.  Without policy routing it is equivalent to the
absence of the route in the routing table.  The packets are dropped
and the ICMP message
.I net unreachable
is generated.  The local senders get an
.I ENETUNREACH
error.

.sp
.B nat
- a special NAT route.  Destinations covered by the prefix
are considered to be dummy (or external) addresses which require translation
to real (or internal) ones before forwarding.  The addresses to translate to
are selected with the attribute
.B Warning:
Route NAT is no longer supported in Linux 2.6.


.BR "via" .
.sp
.B anycast
.RI "- " "not implemented"
the destinations are
.I anycast
addresses assigned to this host.  They are mainly equivalent
to
.B local
with one difference: such addresses are invalid when used
as the source address of any packet.

.sp
.B multicast
- a special type used for multicast routing.  It is not present in
normal routing tables.
.in -8

.P
.B Route tables:
Linux-2.x can pack routes into several routing
tables identified by a number in the range from 1 to 255 or by
name from the file
.B /etc/iproute2/rt_tables
By default all normal routes are inserted into the
.B main
table (ID 254) and the kernel only uses this table when calculating routes.

.sp
Actually, one other table always exists, which is invisible but
even more important.  It is the
.B local
table (ID 255).  This table
consists of routes for local and broadcast addresses.  The kernel maintains
this table automatically and the administrator usually need not modify it
or even look at it.

The multiple routing tables enter the game when
.I policy routing
is used.

.SS ip route add - add new route
.SS ip route change - change route
.SS ip route replace - change or add new one

.TP
.BI to " TYPE PREFIX " (default)
the destination prefix of the route.  If
.I TYPE
is omitted,
.B ip
assumes type
.BR "unicast" .
Other values of
.I TYPE
are listed above.
.I PREFIX
is an IP or IPv6 address optionally followed by a slash and the
prefix length.  If the length of the prefix is missing,
.B ip
assumes a full-length host route.  There is also a special
.I PREFIX
.B default
- which is equivalent to IP
.B 0/0
or to IPv6
.BR "::/0" .

.TP
.BI tos " TOS"
.TP
.BI dsfield " TOS"
the Type Of Service (TOS) key.  This key has no associated mask and
the longest match is understood as: First, compare the TOS
of the route and of the packet.  If they are not equal, then the packet
may still match a route with a zero TOS.
.I TOS
is either an 8 bit hexadecimal number or an identifier
from
.BR "/etc/iproute2/rt_dsfield" .

.TP
.BI metric " NUMBER"
.TP
.BI preference " NUMBER"
the preference value of the route.
.I NUMBER
is an arbitrary 32bit number.

.TP
.BI table " TABLEID"
the table to add this route to.
.I TABLEID
may be a number or a string from the file
.BR "/etc/iproute2/rt_tables" .
If this parameter is omitted,
.B ip
assumes the
.B main
table, with the exception of
.BR local " , " broadcast " and " nat
routes, which are put into the
.B local
table by default.

.TP
.BI dev " NAME"
the output device name.

.TP
.BI via " ADDRESS"
the address of the nexthop router.  Actually, the sense of this field
depends on the route type.  For normal
.B unicast
routes it is either the true next hop router or, if it is a direct
route installed in BSD compatibility mode, it can be a local address
of the interface.  For NAT routes it is the first address of the block
of translated IP destinations.

.TP
.BI src " ADDRESS"
the source address to prefer when sending to the destinations
covered by the route prefix.

.TP
.BI realm " REALMID"
the realm to which this route is assigned.
.I REALMID
may be a number or a string from the file
.BR "/etc/iproute2/rt_realms" .

.TP
.BI mtu " MTU"
.TP
.BI "mtu lock" " MTU"
the MTU along the path to the destination.  If the modifier
.B lock
is not used, the MTU may be updated by the kernel due to
Path MTU Discovery.  If the modifier
.B lock
is used, no path MTU discovery will be tried, all packets
will be sent without the DF bit in IPv4 case or fragmented
to MTU for IPv6.

.TP
.BI window " NUMBER"
the maximal window for TCP to advertise to these destinations,
measured in bytes.  It limits maximal data bursts that our TCP
peers are allowed to send to us.

.TP
.BI rtt " TIME"
the initial RTT ('Round Trip Time') estimate. If no suffix is
specified the units are raw values passed directly to the
routing code to maintain compatability with previous releases.
Otherwise if a suffix of s, sec or secs is used to specify
seconds; ms, msec or msecs to specify milliseconds; us, usec
or usecs to specify microseconds; ns, nsec or nsecs to specify
nanoseconds; j, hz or jiffies to specify jiffies, the value is
converted to what the routing code expects.


.TP
.BI rttvar " TIME " "(2.3.15+ only)"
the initial RTT variance estimate. Values are specified as with
.BI rtt
above.

.TP
.BI rto_min " TIME " "(2.6.23+ only)"
the minimum TCP Retransmission TimeOut to use when communicating with this
destination.  Values are specified as with
.BI rtt
above.

.TP
.BI ssthresh " NUMBER " "(2.3.15+ only)"
an estimate for the initial slow start threshold.

.TP
.BI cwnd " NUMBER " "(2.3.15+ only)"
the clamp for congestion window.  It is ignored if the
.B lock
flag is not used.

.TP
.BI advmss " NUMBER " "(2.3.15+ only)"
the MSS ('Maximal Segment Size') to advertise to these
destinations when establishing TCP connections.  If it is not given,
Linux uses a default value calculated from the first hop device MTU.
(If the path to these destination is asymmetric, this guess may be wrong.)

.TP
.BI reordering " NUMBER " "(2.3.15+ only)"
Maximal reordering on the path to this destination.
If it is not given, Linux uses the value selected with
.B sysctl
variable
.BR "net/ipv4/tcp_reordering" .

.TP
.BI nexthop " NEXTHOP"
the nexthop of a multipath route.
.I NEXTHOP
is a complex value with its own syntax similar to the top level
argument lists:

.in +8
.BI via " ADDRESS"
- is the nexthop router.
.sp

.BI dev " NAME"
- is the output device.
.sp

.BI weight " NUMBER"
- is a weight for this element of a multipath
route reflecting its relative bandwidth or quality.
.in -8

.TP
.BI scope " SCOPE_VAL"
the scope of the destinations covered by the route prefix.
.I SCOPE_VAL
may be a number or a string from the file
.BR "/etc/iproute2/rt_scopes" .
If this parameter is omitted,
.B ip
assumes scope
.B global
for all gatewayed
.B unicast
routes, scope
.B link
for direct
.BR unicast " and " broadcast
routes and scope
.BR host " for " local
routes.

.TP
.BI protocol " RTPROTO"
the routing protocol identifier of this route.
.I RTPROTO
may be a number or a string from the file
.BR "/etc/iproute2/rt_protos" .
If the routing protocol ID is not given,
.B ip assumes protocol
.B boot
(i.e. it assumes the route was added by someone who doesn't
understand what they are doing).  Several protocol values have
a fixed interpretation.
Namely:

.in +8
.B redirect
- the route was installed due to an ICMP redirect.
.sp

.B kernel
- the route was installed by the kernel during autoconfiguration.
.sp

.B boot
- the route was installed during the bootup sequence.
If a routing daemon starts, it will purge all of them.
.sp

.B static
- the route was installed by the administrator
to override dynamic routing. Routing daemon will respect them
and, probably, even advertise them to its peers.
.sp

.B ra
- the route was installed by Router Discovery protocol.
.in -8

.sp
The rest of the values are not reserved and the administrator is free
to assign (or not to assign) protocol tags.

.TP
.B onlink
pretend that the nexthop is directly attached to this link,
even if it does not match any interface prefix.

.SS ip route delete - delete route

.B ip route del
has the same arguments as
.BR "ip route add" ,
but their semantics are a bit different.

Key values
.RB "(" to ", " tos ", " preference " and " table ")"
select the route to delete.  If optional attributes are present,
.B ip
verifies that they coincide with the attributes of the route to delete.
If no route with the given key and attributes was found,
.B ip route del
fails.

.SS ip route show - list routes
the command displays the contents of the routing tables or the route(s)
selected by some criteria.

.TP
.BI to " SELECTOR " (default)
only select routes from the given range of destinations.
.I SELECTOR
consists of an optional modifier
.RB "(" root ", " match " or " exact ")"
and a prefix.
.BI root " PREFIX"
selects routes with prefixes not shorter than
.IR PREFIX "."
F.e.
.BI root " 0/0"
selects the entire routing table.
.BI match " PREFIX"
selects routes with prefixes not longer than
.IR PREFIX "."
F.e.
.BI match " 10.0/16"
selects
.IR 10.0/16 ","
.IR 10/8 " and " 0/0 ,
but it does not select
.IR 10.1/16 " and " 10.0.0/24 .
And
.BI exact " PREFIX"
(or just
.IR PREFIX ")"
selects routes with this exact prefix. If neither of these options
are present,
.B ip
assumes
.BI root " 0/0"
i.e. it lists the entire table.

.TP
.BI tos " TOS"
.BI dsfield " TOS"
only select routes with the given TOS.

.TP
.BI table " TABLEID"
show the routes from this table(s).  The default setting is to show
.BR table main "."
.I TABLEID
may either be the ID of a real table or one of the special values:
.sp
.in +8
.B all
- list all of the tables.
.sp
.B cache
- dump the routing cache.
.in -8

.TP
.B cloned
.TP
.B cached
list cloned routes i.e. routes which were dynamically forked from
other routes because some route attribute (f.e. MTU) was updated.
Actually, it is equivalent to
.BR "table cache" "."

.TP
.BI from " SELECTOR"
the same syntax as for
.BR to ","
but it binds the source address range rather than destinations.
Note that the
.B from
option only works with cloned routes.

.TP
.BI protocol " RTPROTO"
only list routes of this protocol.

.TP
.BI scope " SCOPE_VAL"
only list routes with this scope.

.TP
.BI type " TYPE"
only list routes of this type.

.TP
.BI dev " NAME"
only list routes going via this device.

.TP
.BI via " PREFIX"
only list routes going via the nexthop routers selected by
.IR PREFIX "."

.TP
.BI src " PREFIX"
only list routes with preferred source addresses selected
by
.IR PREFIX "."

.TP
.BI realm " REALMID"
.TP
.BI realms " FROMREALM/TOREALM"
only list routes with these realms.

.SS ip route flush - flush routing tables
this command flushes routes selected by some criteria.

.sp
The arguments have the same syntax and semantics as the arguments of
.BR "ip route show" ,
but routing tables are not listed but purged.  The only difference is
the default action:
.B show
dumps all the IP main routing table but
.B flush
prints the helper page.

.sp
With the
.B -statistics
option, the command becomes verbose. It prints out the number of
deleted routes and the number of rounds made to flush the routing
table. If the option is given
twice,
.B ip route flush
also dumps all the deleted routes in the format described in the
previous subsection.

.SS ip route get - get a single route
this command gets a single route to a destination and prints its
contents exactly as the kernel sees it.

.TP
.BI to " ADDRESS " (default)
the destination address.

.TP
.BI from " ADDRESS"
the source address.

.TP
.BI tos " TOS"
.TP
.BI dsfield " TOS"
the Type Of Service.

.TP
.BI iif " NAME"
the device from which this packet is expected to arrive.

.TP
.BI oif " NAME"
force the output device on which this packet will be routed.

.TP
.B connected
if no source address
.RB "(option " from ")"
was given, relookup the route with the source set to the preferred
address received from the first lookup.
If policy routing is used, it may be a different route.

.P
Note that this operation is not equivalent to
.BR "ip route show" .
.B show
shows existing routes.
.B get
resolves them and creates new clones if necessary.  Essentially,
.B get
is equivalent to sending a packet along this path.
If the
.B iif
argument is not given, the kernel creates a route
to output packets towards the requested destination.
This is equivalent to pinging the destination
with a subsequent
.BR "ip route ls cache" ,
however, no packets are actually sent.  With the
.B iif
argument, the kernel pretends that a packet arrived from this interface
and searches for a path to forward the packet.

.SH ip rule - routing policy database management

.BR "Rule" s
in the routing policy database control the route selection algorithm.

.P
Classic routing algorithms used in the Internet make routing decisions
based only on the destination address of packets (and in theory,
but not in practice, on the TOS field).

.P
In some circumstances we want to route packets differently depending not only
on destination addresses, but also on other packet fields: source address,
IP protocol, transport protocol ports or even packet payload.
This task is called 'policy routing'.

.P
To solve this task, the conventional destination based routing table, ordered
according to the longest match rule, is replaced with a 'routing policy
database' (or RPDB), which selects routes by executing some set of rules.

.P
Each policy routing rule consists of a
.B selector
and an
.B action predicate.
The RPDB is scanned in the order of increasing priority. The selector
of each rule is applied to {source address, destination address, incoming
interface, tos, fwmark} and, if the selector matches the packet,
the action is performed.  The action predicate may return with success.
In this case, it will either give a route or failure indication
and the RPDB lookup is terminated. Otherwise, the RPDB program
continues on the next rule.

.P
Semantically, natural action is to select the nexthop and the output device.

.P
At startup time the kernel configures the default RPDB consisting of three
rules:

.TP
1.
Priority: 0, Selector: match anything, Action: lookup routing
table
.B local
(ID 255).
The
.B local
table is a special routing table containing
high priority control routes for local and broadcast addresses.
.sp
Rule 0 is special. It cannot be deleted or overridden.

.TP
2.
Priority: 32766, Selector: match anything, Action: lookup routing
table
.B main
(ID 254).
The
.B main
table is the normal routing table containing all non-policy
routes. This rule may be deleted and/or overridden with other
ones by the administrator.

.TP
3.
Priority: 32767, Selector: match anything, Action: lookup routing
table
.B default
(ID 253).
The
.B default
table is empty.  It is reserved for some post-processing if no previous
default rules selected the packet.
This rule may also be deleted.

.P
Each RPDB entry has additional
attributes.  F.e. each rule has a pointer to some routing
table.  NAT and masquerading rules have an attribute to select new IP
address to translate/masquerade.  Besides that, rules have some
optional attributes, which routes have, namely
.BR "realms" .
These values do not override those contained in the routing tables.  They
are only used if the route did not select any attributes.

.sp
The RPDB may contain rules of the following types:

.in +8
.B unicast
- the rule prescribes to return the route found
in the routing table referenced by the rule.

.B blackhole
- the rule prescribes to silently drop the packet.

.B unreachable
- the rule prescribes to generate a 'Network is unreachable' error.

.B prohibit
- the rule prescribes to generate 'Communication is administratively
prohibited' error.

.B nat
- the rule prescribes to translate the source address
of the IP packet into some other value.
.in -8

.SS ip rule add - insert a new rule
.SS ip rule delete - delete a rule

.TP
.BI type " TYPE " (default)
the type of this rule.  The list of valid types was given in the previous
subsection.

.TP
.BI from " PREFIX"
select the source prefix to match.

.TP
.BI to " PREFIX"
select the destination prefix to match.

.TP
.BI iif " NAME"
select the incoming device to match.  If the interface is loopback,
the rule only matches packets originating from this host.  This means
that you may create separate routing tables for forwarded and local
packets and, hence, completely segregate them.

.TP
.BI oif " NAME"
select the outgoing device to match.  The outgoing interface is only
available for packets originating from local sockets that are bound to
a device.

.TP
.BI tos " TOS"
.TP
.BI dsfield " TOS"
select the TOS value to match.

.TP
.BI fwmark " MARK"
select the
.B fwmark
value to match.

.TP
.BI priority " PREFERENCE"
the priority of this rule.  Each rule should have an explicitly
set
.I unique
priority value.
The options preference and order are synonyms with priority.

.TP
.BI table " TABLEID"
the routing table identifier to lookup if the rule selector matches.
It is also possible to use lookup instead of table.

.TP
.BI realms " FROM/TO"
Realms to select if the rule matched and the routing table lookup
succeeded.  Realm
.I TO
is only used if the route did not select any realm.

.TP
.BI nat " ADDRESS"
The base of the IP address block to translate (for source addresses).
The
.I ADDRESS
may be either the start of the block of NAT addresses (selected by NAT
routes) or a local host address (or even zero).
In the last case the router does not translate the packets, but
masquerades them to this address.
Using map-to instead of nat means the same thing.

.B Warning:
Changes to the RPDB made with these commands do not become active
immediately.  It is assumed that after a script finishes a batch of
updates, it flushes the routing cache with
.BR "ip route flush cache" .

.SS ip rule flush - also dumps all the deleted rules.
This command has no arguments.

.SS ip rule show - list rules
This command has no arguments.
The options list or lst are synonyms with show.

.SH ip maddress - multicast addresses management

.B maddress
objects are multicast addresses.

.SS ip maddress show - list multicast addresses

.TP
.BI dev " NAME " (default)
the device name.

.SS ip maddress add - add a multicast address
.SS ip maddress delete - delete a multicast address
these commands attach/detach a static link layer multicast address
to listen on the interface.
Note that it is impossible to join protocol multicast groups
statically.  This command only manages link layer addresses.

.TP
.BI address " LLADDRESS " (default)
the link layer multicast address.

.TP
.BI dev " NAME"
the device to join/leave this multicast address.

.SH ip mroute - multicast routing cache management
.B mroute
objects are multicast routing cache entries created by a user level
mrouting daemon (f.e.
.B pimd
or
.B mrouted
).

Due to the limitations of the current interface to the multicast routing
engine, it is impossible to change
.B mroute
objects administratively, so we may only display them.  This limitation
will be removed in the future.

.SS ip mroute show - list mroute cache entries

.TP
.BI to " PREFIX " (default)
the prefix selecting the destination multicast addresses to list.

.TP
.BI iif " NAME"
the interface on which multicast packets are received.

.TP
.BI from " PREFIX"
the prefix selecting the IP source addresses of the multicast route.

.SH ip tunnel - tunnel configuration
.B tunnel
objects are tunnels, encapsulating packets in IP packets and then
sending them over the IP infrastructure.
The encapulating (or outer) address family is specified by the
.B -f
option.  The default is IPv4.

.SS ip tunnel add - add a new tunnel
.SS ip tunnel change - change an existing tunnel
.SS ip tunnel delete - destroy a tunnel

.TP
.BI name " NAME " (default)
select the tunnel device name.

.TP
.BI mode " MODE"
set the tunnel mode. Available modes depend on the encapsulating address family.
.br
Modes for IPv4 encapsulation available:
.BR ipip ", " sit ", " isatap " and " gre "."
.br
Modes for IPv6 encapsulation available:
.BR ip6ip6 ", " ipip6 " and " any "."

.TP
.BI remote " ADDRESS"
set the remote endpoint of the tunnel.

.TP
.BI local " ADDRESS"
set the fixed local address for tunneled packets.
It must be an address on another interface of this host.

.TP
.BI ttl " N"
set a fixed TTL
.I N
on tunneled packets.
.I N
is a number in the range 1--255. 0 is a special value
meaning that packets inherit the TTL value.
The default value for IPv4 tunnels is:
.BR "inherit" .
The default value for IPv6 tunnels is:
.BR "64" .


.TP
.BI tos " T"
.TP
.BI dsfield " T"
.TP
.BI tclass " T"
set a fixed TOS (or traffic class in IPv6)
.I T
on tunneled packets.
The default value is:
.BR "inherit" .

.TP
.BI dev " NAME"
bind the tunnel to the device
.I NAME
so that tunneled packets will only be routed via this device and will
not be able to escape to another device when the route to endpoint
changes.

.TP
.B nopmtudisc
disable Path MTU Discovery on this tunnel.
It is enabled by default.  Note that a fixed ttl is incompatible
with this option: tunnelling with a fixed ttl always makes pmtu
discovery.

.TP
.BI key " K"
.TP
.BI ikey " K"
.TP
.BI okey " K"
.RB ( " only GRE tunnels " )
use keyed GRE with key
.IR K ". " K
is either a number or an IP address-like dotted quad.
The
.B key
parameter sets the key to use in both directions.
The
.BR ikey " and " okey
parameters set different keys for input and output.

.TP
.BR csum ", " icsum ", " ocsum
.RB ( " only GRE tunnels " )
generate/require checksums for tunneled packets.
The
.B ocsum
flag calculates checksums for outgoing packets.
The
.B icsum
flag requires that all input packets have the correct
checksum.  The
.B csum
flag is equivalent to the combination
.BR "icsum ocsum" .

.TP
.BR seq ", " iseq ", " oseq
.RB ( " only GRE tunnels " )
serialize packets.
The
.B oseq
flag enables sequencing of outgoing packets.
The
.B iseq
flag requires that all input packets are serialized.
The
.B  seq
flag is equivalent to the combination
.BR "iseq oseq" .
.B It isn't work. Don't use it.

.TP
.BR "dscp inherit"
.RB ( " only IPv6 tunnels " )
Inherit DS field between inner and outer header.

.TP
.BI encaplim " ELIM"
.RB ( " only IPv6 tunnels " )
set a fixed encapsulation limit.  Default is 4.

.TP
.BI flowlabel " FLOWLABEL"
.RB ( " only IPv6 tunnels " )
set a fixed flowlabel.

.SS ip tunnel prl - potential router list (ISATAP only)

.TP
.BI dev " NAME"
mandatory device name.

.TP
.BI prl-default " ADDR"
.TP
.BI prl-nodefault " ADDR"
.TP
.BI prl-delete " ADDR"
.RB "Add or delete " ADDR
as a potential router or default router.

.SS ip tunnel show - list tunnels
This command has no arguments.

.SH ip monitor and rtmon - state monitoring

The
.B ip
utility can monitor the state of devices, addresses
and routes continuously.  This option has a slightly different format.
Namely, the
.B monitor
command is the first in the command line and then the object list follows:

.BR "ip monitor" " [ " all " |"
.IR LISTofOBJECTS " ]"

.I OBJECT-LIST
is the list of object types that we want to monitor.
It may contain
.BR link ", " address " and " route "."
If no
.B file
argument is given,
.B ip
opens RTNETLINK, listens on it and dumps state changes in the format
described in previous sections.

.P
If a file name is given, it does not listen on RTNETLINK,
but opens the file containing RTNETLINK messages saved in binary format
and dumps them.  Such a history file can be generated with the
.B rtmon
utility.  This utility has a command line syntax similar to
.BR "ip monitor" .
Ideally,
.B rtmon
should be started before the first network configuration command
is issued. F.e. if you insert:
.sp
.in +8
rtmon file /var/log/rtmon.log
.in -8
.sp
in a startup script, you will be able to view the full history
later.

.P
Certainly, it is possible to start
.B rtmon
at any time.
It prepends the history with the state snapshot dumped at the moment
of starting.

.SH ip xfrm - setting xfrm
xfrm is an IP framework, which can transform format of the datagrams,
.br
i.e. encrypt the packets with some algorithm. xfrm policy and xfrm state
are associated through templates
.IR TMPL_LIST "."
This framework is used as a part of IPsec protocol.

.SS ip xfrm state add - add new state into xfrm

.SS ip xfrm state update - update existing xfrm state

.SS ip xfrm state allocspi - allocate SPI value

.TP
.I MODE
is set as default to
.BR transport ","
but it could be set to
.BR tunnel "," ro " or " beet "."

.TP
.I FLAG-LIST
contains one or more flags.

.TP
.I FLAG
could be set to
.BR noecn ", " decap-dscp " or " wildrecv "."

.TP
.I ENCAP
encapsulation is set to encapsulation type
.IR ENCAP-TYPE ", source port " SPORT ", destination port "  DPORT " and " OADDR "."

.TP
.I ENCAP-TYPE
could be set to
.BR espinudp " or " espinudp-nonike "."

.TP
.I ALGO-LIST
contains one or more algorithms
.I ALGO
which depend on the type of algorithm set by
.IR ALGO_TYPE "."
It can be used these algoritms
.BR enc ", " auth " or " comp "."

.SS ip xfrm policy add - add a new policy

.SS ip xfrm policy update - update an existing policy

.SS ip xfrm policy delete - delete existing policy

.SS ip xfrm policy get - get existing policy

.SS ip xfrm policy deleteall - delete all existing xfrm policy

.SS ip xfrm policy list - print out the list of xfrm policy

.SS ip xfrm policy flush - flush policies
It can be flush
.BR all
policies or only those specified with
.BR ptype "."

.TP
.BI dir " DIR "
directory could be one of these:
.BR "inp", " out " or " fwd".

.TP
.IR SELECTOR
selects for which addresses will be set up the policy. The selector
is defined by source and destination address.

.TP
.IR UPSPEC
is defined by source port
.BR sport ", "
destination port
.BR dport ", " type
as number and
.B code
also number.

.TP
.BI dev " DEV "
specify network device.

.TP
.BI index " INDEX "
the number of indexed policy.

.TP
.BI ptype " PTYPE "
type is set as default on
.BR "main" ,
could be switch on
.BR "sub" .

.TP
.BI action " ACTION "
is set as default on
.BR "allow".
It could be switch on
.BR "block".

.TP
.BI priority " PRIORITY "
priority is a number. Default priority is set on zero.

.TP
.IR LIMIT-LIST
limits are set in seconds, bytes or numbers of packets.

.TP
.IR TMPL-LIST
template list is based on
.IR ID ","
.BR mode ", " reqid " and " level ". "

.TP
.IR ID
is specified by source address, destination address,
.I proto
and value of
.IR spi "."

.TP
.IR XFRM_PROTO
values:
.BR esp ", " ah ", " comp ", " route2 " or " hao "."

.TP
.IR MODE
is set as default on
.BR transport ","
but it could be set on
.BR tunnel " or " beet "."

.TP
.IR LEVEL
is set as default on
.BR required
and the other choice is
.BR use "."

.TP
.IR UPSPEC
is specified by
.BR sport ", "
.BR dport ", " type
and
.B code
(NUMBER).

.SS ip xfrm monitor - is used for listing all objects or defined group of them.
The
.B xfrm monitor
can monitor the policies for all objects or defined group of them.

.SH HISTORY
.B ip
was written by Alexey N. Kuznetsov and added in Linux 2.2.
.SH SEE ALSO
.BR tc (8)
.br
.RB "IP Command reference " ip-cref.ps
.br
.RB "IP tunnels " ip-cref.ps
.br
.RB "User documentation at " http://lartc.org/ ", but please direct bugreports and patches to: " <netdev@vger.kernel.org>

.SH AUTHOR
Original Manpage  by Michail Litvak <mci@owl.openwall.com>