OS: CentOS6) q- a" m9 i# `2 ^; [
銝撘萇雯∠憭 Public IP:
: d) K% t# S! m2 [: }$ YLinux 蝬脰楝閮剖瑼摮曉具/etc/sysconfig/network-scripts鋆∴甇支隞亦洵銝撘萇雯∠閮剖瑼箝ifcfg-eth0(蝡航嗅摰鋆Centos撌亦撣怎閮剖,航賣疳fcfg-eth3銋銝銝摰)嚗憒閬隞亦洵銝撘萇雯∠箏箇嚗蝬摰憭 IP嚗芷閬具/etc/sysconfig/network-scripts桅銝剖遣蝡銝箝ifcfg-eth0-1(ifcfg-eth0:1,蝔勗航芸)瑼獢嚗閮剖孵憒銝嚗
2 L$ B8 z3 |2 }+ A2 I' a) D0 z& I+ x N
[root@KK ~ ]# cd /etc/sysconfig/network-scripts
. a7 H: }" J% C# f; w9 v[root@KK network-scripts ]# cp ifcfg-eth0 ifcfg-eth0-1
$ n8 M5 Y; g6 m5 ]* ?[root@KK network-scripts ]# vi ifcfg-eth0-1嚗蝺刻摩甇方身摰瑼嚗# g0 K/ B3 T" s& i0 N# q8 \
[root@KK network-scripts ]# ifup ifcfg-eth0-1嚗甇文撐蝬脣∴
' I( `7 y6 S& V8 o, U7 T; g% d# m' q1 ~- g
閮剖瑼靽格對
$ e5 U) @9 b4 b9 _5 h( p% V5 U* T# B" C# R# H4 B) E
DEVICE="eth0:1"
% z* s6 S, p$ H/ nBOOTPROTO="static"4 s2 A+ [( h. b1 z, D8 w2 o! N
DNS1="8.8.8.8"8 W$ B; l! Q; Y! Q
DNS2="8.8.4.4"
9 g6 n( K: ^8 z) A. C" LGATEWAY="xxx.xxx.xx.x" M$ `8 O& K" w6 H# p
IPADDR="xxx.xxx.xx.xx"
* `9 D/ ]. H3 M# k# Q, f- {' P9 xIPV6INIT="yes"
5 n* }; ^& l/ G1 ^/ k4 x! zIPV6_AUTOCONF="yes"
% V j' o' X8 w3 jNETMASK="255.255.255.0"
/ V. k4 a! y" q* u: n. \( wNM_CONTROLLED="yes"
* @; E9 X/ l% U! V* CONBOOT="yes"$ R- D) I% n: `& e% t
TYPE="Ethernet" u& X% _6 Y/ u1 |" s3 M' V5 ^# J
3 W4 Y/ O4 f: m; S憒閬蝬摰憭 IP 雿蝵殷芷閬閮剖瑼蝔勗閮剖瑼批捆銝剔eth0:x,x臭誑 1 ~ 254 嚗Linux 憭臭誑舀 255 IP
" s. J6 K+ i y/ C. l5 c& r, B9 n7 k9 P, x* _6 ?
Setup Virtual Private LAN:% R- b4 F; S4 g" D( E- H3 K/ y) D
急輯身摰蝺頝臭蝙臭誑銝餅皞,璈輯身摰憟賢幢inux銋/etc/sysconfig/network-scripts/銝撠Yifcfg-eth? 瑼獢 ?舀詨 (銝臭蝙甬fcfg-eth0,血∩)4 S8 h/ I0 H' p/ [7 ^1 }5 D
湔隘fcfg-eth1,批捆:
0 c* a( K) F6 [ONBOOT = yes
4 e9 B. E8 p1 f4 J0 ] J: c# \NM-CONTROLLED = yes
4 z3 l/ n9 g& j3 Q! BBOOTPROTO = static
* I2 h( A8 E1 c- c }0 `7 rIPADDR = 192.168.1.1
/ E! k% e9 s! ~; NNETMASK = 255.255.255.0; {) X# G6 f$ b, s& l1 m- P, f
HOTPLUG = no4 I) q! X* y' Y' U9 j$ e
摮瑼嗅蝬脣 ifup eth1
$ c! E' W, C( O' T8 w+ f=========================================================
9 V9 D9 o2 z# B4 |( _7 H瑼X亦雯頝舀臬阡撌亙:
. S+ c1 L* c, B" A#ip address show
+ n9 \# q$ ~- C+ Y3 ~#ip nei ip n //nei=neighbour
7 A% ^/ b9 t$ V5 t g% S! X d& }# j* E: D% n: v4 l5 V
( b9 h/ ^+ H w9 }# K* P8 K3 u+ l; n: X' p: o8 @: W; [
7 R$ V8 s+ A: y: X$ x- ]1 QP.S
4 e/ h( F# p6 S' j; ~ `ubuntu 祈: $ W4 ]3 \+ Y, h L& W6 P' O @
https://www.ionos.com/help/server-cloud-infrastructure/private-network/manually-setting-up-a-private-network-in-a-cloud-server/manually-setting-up-a-private-network-for-a-cloud-server-ubuntudebian/5 ~% V/ ]7 Y0 p. o3 D
% w3 P9 T1 H; U
, Y: t$ \9 ~# ]. }; j1 m0 r9 h- F
https://www.ionos.com/help/server-cloud-infrastructure/setting-up-a-private-network-for-dedicated-servers-ubuntudebian/1 ~" s Y( Z% b4 O& y- G; K) W
|
|