- 论坛徽章:
- 0
|
如题,详细见下面配置,只有一块网卡,虚拟出一个网卡,开启ip转发:\r\n\r\n# ifconfig -a\r\nlo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1\r\n inet 127.0.0.1 netmask ff000000 \r\npcn0: flags=1100843<UP,BROADCAST,RUNNING,MULTICAST,ROUTER,IPv4> mtu 1500 index 2\r\n inet 192.168.16.107 netmask ffffff00 broadcast 192.168.16.255\r\n ether 0:c:29:4f:e1:a6 \r\npcn0:1: flags=1100843<UP,BROADCAST,RUNNING,MULTICAST,ROUTER,IPv4> mtu 1500 index 2\r\n inet 10.10.168.176 netmask ff000000 broadcast 10.255.255.255\r\n# \r\n# ifconfig -a\r\nlo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1\r\n inet 127.0.0.1 netmask ff000000 \r\nbash-3.00# ifconfig -a\r\nlo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1\r\n inet 127.0.0.1 netmask ff000000 \r\npcn0: flags=1100843<UP,BROADCAST,RUNNING,MULTICAST,ROUTER,IPv4> mtu 1500 index 2\r\n inet 192.168.16.107 netmask ffffff00 broadcast 192.168.16.255\r\n ether 0:c:29:4f:e1:a6 \r\npcn0:1: flags=1100843<UP,BROADCAST,RUNNING,MULTICAST,ROUTER,IPv4> mtu 1500 index 2\r\n inet 10.10.168.176 netmask ff000000 broadcast 10.255.255.255\r\nbash-3.00# ping -i pcn0:1 -s 192.168.16.1\r\nPING 192.168.16.1: 56 data bytes\r\n64 bytes from 192.168.16.1: icmp_seq=0. time=239. ms\r\n64 bytes from 192.168.16.1: icmp_seq=1. time=169. ms\r\n64 bytes from 192.168.16.1: icmp_seq=2. time=11.9 ms\r\n64 bytes from 192.168.16.1: icmp_seq=3. time=2.17 ms\r\n64 bytes from 192.168.16.1: icmp_seq=4. time=314. ms\r\n64 bytes from 192.168.16.1: icmp_seq=5. time=76.3 ms\r\n^C\r\n----192.168.16.1 PING Statistics----\r\n6 packets transmitted, 6 packets received, 0% packet loss\r\nround-trip (ms) min/avg/max/stddev = 2.17/135./314./1.3e+02\r\nbash-3.00# traceroute -i pcn0:1 192.168.16.1\r\ntraceroute to 192.168.16.1 (192.168.16.1), 30 hops max, 40 byte packets\r\n 1 * * *\r\n 2 * * *\r\n 3 * * *\r\n 4 * * *\r\n 5 * * *\r\n 6 ^C\r\nbash-3.00# ndd -get /dev/ip ip_forwarding\r\n1\r\nbash-3.00# |
|