LINUX做为网关,让其他机子共享上网。如何设置?
eth0 Link encap:Ethernet HWaddr 00:0C:29:48:3F:D9
inet addr:192.168.88.4 Bcast:192.168.88.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe48:3fd9/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:119 errors:0 dropped:0 overruns:0 frame:0
TX packets:125 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:14740 (14.3 KiB) TX bytes:17219 (16.8 KiB)
Interrupt:19 Base address:0x2000
eth1 Link encap:Ethernet HWaddr 00:0C:29:48:3F:E3
inet addr:192.168.99.200 Bcast:192.168.99.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe48:3fe3/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:79 errors:0 dropped:0 overruns:0 frame:0
TX packets:43 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:9103 (8.8 KiB) TX bytes:2646 (2.5 KiB)
Interrupt:16 Base address:0x2080
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:16436 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)
eth1 这个是内网给他们作为网关,让他们共享上网。
eth0 这个是别人分配的一个可连接互联网IP。
我要怎么样设置呢?才可以让192.168.99.201、192.168.99.202、192.168.99.203、192.168.99.20x……等机器上网呢?
主机:
IP:192.168.99.201
掩码:255.255.255.0
网关:192.168.99.200
DNS:192.168.99.200
这样上不了网……
------解决方案--------------------首先创建两张路由表,只需要添加到相应的文件中即可,Linux一共支持255个路由表,rt_tables文件中默认已经存在了三张路由表,分别是:
255 &