명령어라인에서 네트워크 설정하기
프롬프트상에서 네트워크를 설정하는 방법이다.
예전에는 자주 사용했었는데... 요즘엔 거의 사용하지 않는것 같다.
까먹기 전에 적어놓자.
[root@Test_Server ~]# ifconfig lo 127.0.0.1
[root@Test_Server ~]# ifconfig eth0 192.168.1.2 broadcast 192.168.1.255 netmask 255.255.255.0
[root@Test_Server ~]# route add -net 192.168.1.0 netmask 255.255.255.0
[root@Test_Server ~]# route add default gw 192.168.1.1 metric 1
[root@Test_Server ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:50:8B:D3:67:E0
inet addr:192.168.1.2 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:108489 errors:0 dropped:0 overruns:0 frame:0
TX packets:96877 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:15031920 (14.3 Mb) TX bytes:14596485 (13.9 Mb)
Interrupt:17 Base address:0x4000
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:168414 errors:0 dropped:0 overruns:0 frame:0
TX packets:168414 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:5088970 (4.8 Mb) TX bytes:5088970 (4.8 Mb)
[root@Test_Server ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
127.0.0.0 * 255.0.0.0 U 0 0 0 lo
default 192.168.1.1 0.0.0.0 UG 0 0 0 eth0