红联Linux门户
Linux帮助

linux共享。上网

发布时间:2007-08-01 16:39:37来源:红联作者:comes
[root@localhost ~]# $iptables -t nat -A POSTROUTING -o eth0 -s 192.168.0.0/24
bash: -t: command not found
[root@localhost ~]# ipconfig
bash: ipconfig: command not found
[root@localhost ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 30:30:00:01:8C:1D
inet addr:192.168.18.5 Bcast:192.168.18.255 Mask:255.255.255.0
inet6 addr: fe80::3230:ff:fe01:8c1d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1444 errors:0 dropped:0 overruns:0 frame:0
TX packets:767 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:557204 (544.1 KiB) TX bytes:85583 (83.5 KiB)
Interrupt:185 Base address:0xe000

eth1 Link encap:Ethernet HWaddr 00:E0:4C:51:64:8C
inet addr:192.168.0.1 Bcast:192.168.255.255 Mask:255.255.0.0
inet6 addr: fe80::2e0:4cff:fe51:648c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:89 errors:0 dropped:0 overruns:0 frame:0
TX packets:59 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:8595 (8.3 KiB) TX bytes:7900 (7.7 KiB)
Interrupt:193

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:1601 errors:0 dropped:0 overruns:0 frame:0
TX packets:1601 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2872775 (2.7 MiB) TX bytes:2872775 (2.7 MiB)

[root@localhost ~]# iptables -t nat -A POSTROUTING -o eth0 -s 192.168.0.0/24 -j SNAT -to 192.168.18.5
Bad argument `192.168.18.5'
Try `iptables -h' or 'iptables --help' for more information.
[root@localhost ~]# iptables -t nat -A POSTROUTING -o eth0 -s 192.168.0.0/24 -j snat -to 192.168.18.5
Bad argument `192.168.18.5'
Try `iptables -h' or 'iptables --help' for more information.
[root@localhost ~]# iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth1 -j MASQUERADE
[root@localhost ~]# iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j MASQUERADE
文章评论

共有 0 条评论