利用兩張網卡讓ubuntu做簡易router

知道A,B,D點

A:10.200.14.94  (學校WAN IP)

D:10.200.14.89

B:163.17.210.254

 

1.開啟ip forwarding的功能

更改 /etc/sysctl.conf

net.ipv4.ip_forward=1

 

編好後,下

sysctl -p

檢查以下值

cat /proc/sys/net/ipv4/ip_forward 

 

2.編輯 /etc/network/interfaces


#d point
auto eth0
iface eth0 inet static
        address 10.200.14.94
        netmask 255.255.255.248
        gateway 10.200.14.89


#b point
auto eth1
iface eth1 inet static
        netmask 255.255.255.128
        network 163.17.210.129
        broadcast 163.17.210.255
        address 163.17.210.254




重新啟動網卡設定

/etc/init.d/networking restart

arrow
arrow
    全站熱搜

    igogo 發表在 痞客邦 留言(0) 人氣()