2012-03-17

Ubuntu 雙網卡與 Internet 連線


# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
#iface eth0 inet dhcp
iface eth0 inet static
     address 192.168.1.11
     netmask 255.255.255.0
     gateway 192.168.1.1

# The 2nd network interface
auto eth1
iface eth1 inet static
     address 192.168.0.11
     netmask 255.255.255.0
     gateway 192.168.0.1

# 第二張網卡設了 gateway,需另外增加 route 規則才能讓  LAN 網路暢通。
# Add static route for eth1
up route add -net 192.168.0.0/24 gw 192.168.0.1 dev eth1

# 若要能連上 internet,需再加設 route 規則才能連。
# Add static route for internet connection via eth0
up route add -net 0.0.0.0/0 gw 192.168.1.1 dev eth0

沒有留言:

張貼留言