ããip å½ä»¤æ´åäºç³»ç»åæ¯ ifconfig, route, arp çå·¥å
·çåè½ï¼è¿å©ç¨äº linux kernel æ°å¼çä¸äºåè½è¾¾æç¹æ®é
ç½®ï¼è¿é½ä¸æ¯ifconfig ä¸ route çå·¥å
·å¯ä»¥è®¾å®åºã
ãã举ä¾ï¼
ãã1ãifconfig åªè½ç»ç½å¡å ä¸ä¸ªIPï¼å¦æè¦å å¤ä¸ªIPï¼éè¦ç¨aliasï¼å¯æ¯ipå°±ç´æ¥å¯è½ç»ä¸ä¸ªç½å¡å å¾å¤IPï¼
ããip addr add
ããIP1/æ©ç dev ç½å¡å
ããip addr add IP2/æ©ç dev
ããç½å¡å
ã 2ãrouteå½ä»¤åªè½å¨ç¼ºççè·¯ç±è¡¨ä¸æ·»å è·¯ç±ï¼å¯¹äºçç¥è·¯ç±æ è½ä¸ºåï¼
ããip route add ç½ç» via ç½å
³ dev ç½å¡
ããtable 100
ããç¶å
ããip rule add from IP table 100
ããè¿æ ·è®¾ç½®åï¼ä»IPæ¥çæ°æ®å
é½éè¿è·¯ç±è¡¨100æ¥æ¾è·¯ç±ã
温馨提示:答案为网友推荐,仅供参考