- 论坛徽章:
- 0
|
机器环境 b4.1 ppp拨号分别指定2个网卡的地址:rl0:192.168.1.2/23 ne3:192.168.1.3/24
- cat /etc/mygate
- 192.168.1.1
复制代码
客户机器环境:windows xp ip:192.168.1.8/24 网关设置成:192.168.1.1
rl0为拨号网卡
ne3为内网网卡,连接交换机
求个简单的pf规则可以让XP的机器通过OB上网
- # ifconfig
- lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33224
- groups: lo
- inet 127.0.0.1 netmask 0xff000000
- inet6 ::1 prefixlen 128
- inet6 fe80::1%lo0 prefixlen 64 scopeid 0x5
- rl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
- lladdr 00:0e:1f:01:13:3c
- media: Ethernet autoselect (100baseTX full-duplex)
- status: active
- inet 192.168.1.2 netmask 0xfffffe00 broadcast 192.168.1.255
- inet6 fe80::20e:1fff:fe01:133c%rl0 prefixlen 64 scopeid 0x1
- ne3: flags=8863<UP,BROADCAST,NOTRAILERS,RUNNING,SIMPLEX,MULTICAST> mtu 1500
- lladdr 00:40:26:5f:4d:9a
- media: Ethernet autoselect (10baseT)
- inet 192.168.1.3 netmask 0xffffff00 broadcast 192.168.1.255
- inet6 fe80::240:26ff:fe5f:4d9a%ne3 prefixlen 64 scopeid 0x2
- pflog0: flags=141<UP,RUNNING,PROMISC> mtu 33224
- enc0: flags=0<> mtu 1536
- tun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1488
- groups: tun egress
- inet 10.10.10.195 --> 10.1.1.1 netmask 0xffffffff
- ############################################
- # cat /etc/pf.conf
- int_if = "ne3" #内网
- ext_if = "tun0" #外网
- internal_net="192.168.1.3/24"
- external_addr="192.168.1.2/23"
- set optimization normal
- scrub in all
- nat on $ext_if from $internal_net to any -> ($ext_if)
- pass all
- #
复制代码
[ 本帖最后由 banyao 于 2007-9-15 16:02 编辑 ] |
|