vyatta路由配置

Last login: Tue Jan  1 00:04:04 2002
vyatta@vyatta:~$ configure
[edit]
vyatta@vyatta# set pas
      
[edit]
vyatta@vyatta# set service nat rule 1
[edit]
vyatta@vyatta# edit service nat rule 1
[edit service nat rule 1]
vyatta@vyatta# set type source 
[edit service nat rule 1]
vyatta@vyatta# set tra
      
[edit service nat rule 1]
vyatta@vyatta# set tran
      
[edit service nat rule 1]
vyatta@vyatta# set     
description         inbound-interface   outside-address
destination         inside-address      protocol
disable             log                 source
exclude             outbound-interface  type
[edit service nat rule 1]
vyatta@vyatta# set 
Possible completions:
  description   Rule description
  destination   NAT destination parameters
  disable       Disable NAT rule
  exclude       Exclude packets matching this rule from NAT
  inbound-interface
                Inbound interface of NAT traffic
  inside-address
                Inside NAT IP (used by destination NAT only)
  log           NAT rule logging
  outbound-interface
                Outbound interface for NAT traffic
  outside-address
                Outside NAT IP (used by source NAT only)
  protocol      Protocol to NAT 
  source        NAT source parameters
  type          Type of NAT [REQUIRED]
      
[edit service nat rule 1]
vyatta@vyatta# set tr
      
[edit service nat rule 1]
vyatta@vyatta# set tr
      
[edit service nat rule 1]
vyatta@vyatta# set tra
      
[edit service nat rule 1]
vyatta@vyatta# set tra
      
[edit service nat rule 1]
vyatta@vyatta# set type 
destination  masquerade   source       
[edit service nat rule 1]
vyatta@vyatta# set type 
Possible completions:
  source        Source NAT
  destination   Destination NAT
  masquerade    Masquerade NAT
      
[edit service nat rule 1]
vyatta@vyatta# set ou   
outbound-interface  outside-address     
[edit service nat rule 1]
vyatta@vyatta# set out
outbound-interface  outside-address     
[edit service nat rule 1]
vyatta@vyatta# set outbound-interface 
eth0  eth1  lo    
[edit service nat rule 1]
vyatta@vyatta# set outbound-interface 
Possible completions:
  <interface>   Interface name
      
[edit service nat rule 1]
vyatta@vyatta# set outbound-interface et
eth0  eth1  
[edit service nat rule 1]
vyatta@vyatta# set outbound-interface eth
eth0  eth1  
[edit service nat rule 1]
vyatta@vyatta# set outbound-interface eth1
[edit service nat rule 1]
vyatta@vyatta# set protocol al
Possible completions:
  <text>        IP protocol name from /etc/protocols (e.g. "tcp" or "udp")
  <0-255>       IP protocol number
  tcp_udp       Both TCP and UDP
  all           All IP protocols
  !<protocol>   All IP protocols except for the specified name or number (negation)
      
[edit service nat rule 1]
vyatta@vyatta# set protocol all
[edit service nat rule 1]
vyatta@vyatta# set tr
      
[edit service nat rule 1]
vyatta@vyatta# set   
description         inbound-interface   outside-address
destination         inside-address      protocol
disable             log                 source
exclude             outbound-interface  type
[edit service nat rule 1]
vyatta@vyatta# set type 
destination  masquerade   source       
[edit service nat rule 1]
vyatta@vyatta# set type 
Possible completions:
  source        Source NAT
  destination   Destination NAT
  masquerade    Masquerade NAT
      
[edit service nat rule 1]
vyatta@vyatta# set type masquerade 
[edit service nat rule 1]
vyatta@vyatta# set source 
address  port     
[edit service nat rule 1]
vyatta@vyatta# set source ne
      
[edit service nat rule 1]
vyatta@vyatta# set source   
address  port     
[edit service nat rule 1]
vyatta@vyatta# set source 
Possible completions:
  address       Source IPv4 address, subnet, or range
  port          Source port
      
[edit service nat rule 1]
vyatta@vyatta# set source address 0.0.0.0/0
[edit service nat rule 1]
vyatta@vyatta# top
[edit]
vyatta@vyatta# commit
[edit]
vyatta@vyatta# save
Saving configuration to '/opt/vyatta/etc/config/config.boot'...
Done
[edit]
vyatta@vyatta
vyatta@vyatta# set system gateway-address 220.178.8.225
[edit]
vyatta@vyatta# commit
[edit]
vyatta@vyatta# show interfaces 
 ethernet eth0 {
     address 192.168.1.250/24
     hw-id 00:30:48:83:9e:c8
 }
 ethernet eth1 {
     address 220.178.8.220/24
     hw-id 00:30:48:83:9e:c9
 }
 loopback lo {
 }
[edit]
vyatta@vyatta# ifocnfig
vbash: ifocnfig: command not found
[edit]
vyatta@vyatta# ifconfig
vbash: ifconfig: command not found
[edit]
vyatta@vyatta# set system host-name pk
[edit]
vyatta@vyatta# commit
[edit]
vyatta@vyatta# exit
Warning: configuration changes have not been saved.
exit
vyatta@vyatta:~$ exit
logout

Welcome to Vyatta
Linux vyatta 2.6.32-1-586-vyatta #1 SMP Mon Aug 2 22:57:10 PDT 2010 i686
Welcome to Vyatta.
This system is open-source software. The exact distribution terms for 
each module comprising the full system are described in the individual 
files in /usr/share/doc/*/copyright.
Last login: Tue Jan  1 15:29:52 2002 from 220.178.8.220
vyatta@pk:~$ configure
[edit]
vyatta@pk# show interfaces 
 ethernet eth0 {
     address 192.168.1.250/24
     hw-id 00:30:48:83:9e:c8
 }
 ethernet eth1 {
     address 220.178.8.220/24
     hw-id 00:30:48:83:9e:c9
 }
 loopback lo {
 }
[edit]
vyatta@pk# set system name-server 202.102.192.68
[edit]
vyatta@pk# commit
[edit]
vyatta@pk# set system gateway-address 220.178.8.225
[edit]
vyatta@pk# show 
 interfaces {
     ethernet eth0 {
         address 192.168.1.250/24
         hw-id 00:30:48:83:9e:c8
     }
     ethernet eth1 {
         address 220.178.8.220/24
         hw-id 00:30:48:83:9e:c9
     }
     loopback lo {
     }
 }
 service {
     https
     nat {
         rule 1 {
             outbound-interface eth1
             protocol all
             source {
                 address 0.0.0.0/0
             }
             type masquerade
         }
     }
     ssh {
     }
     telnet {
     }
 }
 system {
     gateway-address 220.178.8.225
     host-name pk
     login {
         user vyatta {
             authentication {
                 encrypted-password $1$4XHPj9eT$G3ww9B/pYDLSXC8YVvazP0
             }
         }
     }
     name-server 202.102.192.68
     ntp-server 0.vyatta.pool.ntp.org
     package {
         repository community {
             components main
             distribution stable
             url http://packages.vyatta.com/vyatta
         }
     }
     syslog {
         global {
             facility all {
                 level notice
             }
             facility protocols {
                 level debug
             }
         }
     }
 }
[edit]
vyatta@pk
[edit]
vyatta@pk# set service dh
dhcp-relay     dhcp-server    dhcpv6-relay   dhcpv6-server  
[edit]
vyatta@pk# set service dhcp-
dhcp-relay   dhcp-server  
[edit]
vyatta@pk# set service dhcp-server shared-network-name com
Possible completions:
  <text>        DHCP shared network [REQUIRED]
      
[edit]
vyatta@pk# set service dhcp-server shared-network-name s  
Possible completions:
  <text>        DHCP shared network [REQUIRED]
      
[edit]
vyatta@pk# set service dhcp-server shared-network-name  
Possible completions:
  <text>        DHCP shared network [REQUIRED]
      
[edit]
vyatta@pk# set service dhcp-server shared-network-name com
Possible completions:
  <text>        DHCP shared network [REQUIRED]
      
[edit]
vyatta@pk# set service dhcp-server shared-network-name com
Possible completions:
  <text>        DHCP shared network [REQUIRED]
      
[edit]
vyatta@pk# set service dhcp-server shared-network-name    
Possible completions:
  <text>        DHCP shared network [REQUIRED]
      
[edit]
vyatta@pk# set service dhcp-server shared-network-name 
Possible completions:
  <text>        DHCP shared network [REQUIRED]
      
[edit]
vyatta@pk# set service dhcp-server shared-network-name D
Possible completions:
  <text>        DHCP shared network [REQUIRED]
      
[edit]
vyatta@pk# set service dhcp-server shared-network-name  
Possible completions:
  <text>        DHCP shared network [REQUIRED]
      
[edit]
vyatta@pk# set service dhcp-server shared-network-name 
Possible completions:
  <text>        DHCP shared network [REQUIRED]
      
[edit]
vyatta@pk# set service dhcp-server shared-network-name 
Possible completions:
  <text>        DHCP shared network [REQUIRED]
      
[edit]
vyatta@pk# set service dhcp-server shared-network-name 
Possible completions:
  <text>        DHCP shared network [REQUIRED]
      
[edit]
vyatta@pk# set service dhcp-server shared-network-name 
Possible completions:
  <text>        DHCP shared network [REQUIRED]
      
[edit]
vyatta@pk# set service dhcp-server shared-network-name com
Possible completions:
  <text>        DHCP shared network [REQUIRED]
      
[edit]
vyatta@pk# set service dhcp-server shared-network-name com
Possible completions:
  <text>        DHCP shared network [REQUIRED]
      
[edit]
vyatta@pk# set service dhcp-server shared-network-name su 
Possible completions:
  <text>        DHCP shared network [REQUIRED]
      
[edit]
vyatta@pk# set service dhcp-server shared-network-name su
Possible completions:
  <text>        DHCP shared network [REQUIRED]
      
[edit]
vyatta@pk# set service dhcp-server shared-network-name 192.168.1.0/24
invalid DHCP pool name "192.168.1.0/24"
Set failed
[edit]
vyatta@pk# set service dhcp-server shared-network-name p192.168.1.0/24
Possible completions:
  <text>        DHCP shared network [REQUIRED]
      
[edit]
vyatta@pk# set service dhcp-server shared-network-name po192.168.1.0/24
Possible completions:
  <text>        DHCP shared network [REQUIRED]
      
[edit]
vyatta@pk# set service dhcp-server shared-network-name                 
[edit]
vyatta@pk# set service dh 
dhcp-relay     dhcp-server    dhcpv6-relay   dhcpv6-server  
[edit]
vyatta@pk# set service dhcp-
dhcp-relay   dhcp-server  
[edit]
vyatta@pk# set service dhcp-server shared-network-name sub
Possible completions:
  <text>        DHCP shared network [REQUIRED]
      
[edit]
vyatta@pk# set service dhcp-server shared-network-name d  
Possible completions:
  <text>        DHCP shared network [REQUIRED]
      
[edit]
vyatta@pk# set service dhcp-server shared-network-name d
Possible completions:
  <text>        DHCP shared network [REQUIRED]
      
[edit]
vyatta@pk# set service dhcp-server shared-network-name  
Possible completions:
  <text>        DHCP shared network [REQUIRED]
      
[edit]
vyatta@pk# set service dhcp-server shared-network-name 
Possible completions:
  <text>        DHCP shared network [REQUIRED]
      
[edit]
vyatta@pk# set service dhcp-server                     
disabled             global-parameters    
dynamic-dns-update   shared-network-name  
[edit]
vyatta@pk# set service dhcp-server 
Possible completions:
  disabled      Option to disable DHCP server
  dynamic-dns-update
                DHCP server to dynamically update the Domain Name System (DNS)
  global-parameters
                Additional global parameters for DHCP server. You must 
                use the syntax of dhcpd.conf in this text-field. Using this 
                without proper knowledge may result in a crashed DHCP server.
                Check system log to look for errors.
  shared-network-name
                DHCP shared network [REQUIRED]
      
[edit]
vyatta@pk# set service dhcp-server shared-network-name 
Possible completions:
  <text>        DHCP shared network [REQUIRED]
      
[edit]
vyatta@pk# set service dhcp-server global-parameters   
Possible completions:
  <text>        Additional global parameters for DHCP server. You must 
                use the syntax of dhcpd.conf in this text-field. Using this 
                without proper knowledge may result in a crashed DHCP server.
                Check system log to look for errors.
      
[edit]
vyatta@pk# set service dhcp-server                   
disabled             global-parameters    
dynamic-dns-update   shared-network-name  
[edit]
vyatta@pk# set service dhcp-server 
Possible completions:
  disabled      Option to disable DHCP server
  dynamic-dns-update
                DHCP server to dynamically update the Domain Name System (DNS)
  global-parameters
                Additional global parameters for DHCP server. You must 
                use the syntax of dhcpd.conf in this text-field. Using this 
                without proper knowledge may result in a crashed DHCP server.
                Check system log to look for errors.
  shared-network-name
                DHCP shared network [REQUIRED]
      
[edit]
vyatta@pk# set service dhcp-server shared-network-name 
Possible completions:
  <text>        DHCP shared network [REQUIRED]
      
[edit]
vyatta@pk# set service dhcp-server shared-network-name 
Possible completions:
  <text>        DHCP shared network [REQUIRED]
      
[edit]
vyatta@pk# set service dhcp-server shared-network-name te
Possible completions:
  <text>        DHCP shared network [REQUIRED]
      
[edit]
vyatta@pk# set service dhcp-server shared-network-name   
Possible completions:
  <text>        DHCP shared network [REQUIRED]
      
[edit]
vyatta@pk# set interfaces openvpn v                    
Possible completions:
  <text>        Configure OpenVPN tunnel interface
      
[edit]
vyatta@pk# set interfaces openvpn  
Possible completions:
  <text>        Configure OpenVPN tunnel interface
      
[edit]
vyatta@pk# set interfaces openvpn 
Possible completions:
  <text>        Configure OpenVPN tunnel interface
      
[edit]
vyatta@pk# set interfaces openvpn 
Possible completions:
  <text>        Configure OpenVPN tunnel interface
      
[edit]
vyatta@pk# set interfaces openvpn 
Possible completions:
  <text>        Configure OpenVPN tunnel interface
      
[edit]
vyatta@pk# set interfaces openvpn tu
Possible completions:
  <text>        Configure OpenVPN tunnel interface
      
[edit]
vyatta@pk# set interfaces openvpn tu
Possible completions:
  <text>        Configure OpenVPN tunnel interface
      
[edit]
vyatta@pk# set interfaces openvpn   
Possible completions:
  <text>        Configure OpenVPN tunnel interface
      
[edit]
vyatta@pk# set interfaces openvpn 
Possible completions:
  <text>        Configure OpenVPN tunnel interface
      
[edit]
vyatta@pk# commit                 
[  service dhcp-server shared-network-name  ] 
  invalid DHCP pool name ""
Commit failed
[edit]
vyatta@pk# set service dhcp-server shared-network-name pk
[edit]
vyatta@pk# commit
No DHCP lease subnets configured for shared network name 'pk'.
At least one DHCP lease subnet must be configured for each shared network.
DHCP server configuration commit aborted due to error(s).
Commit failed
[edit]
vyatta@pk# set service dhcp-server shared-network-name pk subnet 192.168.1.0/24
[edit]
vyatta@pk# set service dhcp-server shared-network-name pk subnet 192.168.1.0/24 default-router 202.102.192.68
[edit]
vyatta@pk# set service dhcp-server shared-network-name pk subnet 192.168.1.0/24 st                           
start           static-mapping  static-route    
[edit]
vyatta@pk# set service dhcp-server shared-network-name pk subnet 192.168.1.0/24 start 192.168.1.5 stop 192.168.1.150
[edit]
vyatta@pk# commit
[edit]
vyatta@pk# save
Saving configuration to '/opt/vyatta/etc/config/config.boot'...
Done
[edit]
vyatta@pk# show
 interfaces {
     ethernet eth0 {
         address 192.168.1.250/24
         hw-id 00:30:48:83:9e:c8
     }
     ethernet eth1 {
         address 220.178.8.220/24
         hw-id 00:30:48:83:9e:c9
     }
     loopback lo {
     }
 }
 service {
     dhcp-server {
         shared-network-name pk {
             subnet 192.168.1.0/24 {
                 default-router 202.102.192.68
:
 interfaces {
     ethernet eth0 {
         address 192.168.1.250/24
         hw-id 00:30:48:83:9e:c8
     }
     ethernet eth1 {
         address 220.178.8.220/24
         hw-id 00:30:48:83:9e:c9
     }
     loopback lo {
     }
 }
 service {
     dhcp-server {
         shared-network-name pk {
             subnet 192.168.1.0/24 {
                 default-router 202.102.192.68
                 start 192.168.1.5 {
                     stop 192.168.1.150
                 }
             }
         }
     }
     https
     nat {
         rule 1 {
             outbound-interface eth1
             protocol all
             source {
                 address 0.0.0.0/0
             }
             type masquerade
         }
     }
     ssh {
     }
     telnet {
     }
 }
 system {
     gateway-address 220.178.8.225
     host-name pk
     login {
         user vyatta {
             authentication {
                 encrypted-password $1$4XHPj9eT$G3ww9B/pYDLSXC8YVvazP0
             }
         }
     }
     name-server 202.102.192.68
     ntp-server 0.vyatta.pool.ntp.org
     package {
         repository community {
             components main
             distribution stable
             url http://packages.vyatta.com/vyatta
         }
     }
     syslog {
         global {
             facility all {
                 level notice
             }
             facility protocols {
                 level debug
             }
         }
     }
 }
[edit]

配置过程中参数不清楚的可以用 Tab来补全。


本文转自 liang3391 51CTO博客,原文链接:http://blog.51cto.com/liang3391/456523
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值