Set interfaces ethernet eth0 address 192.168.1.254/24 设置内网IP 地址
Set interfaces ethernet eth1 pppoe 0 user-id youhenduo 设置pppoe的拨号的账号,这里是“youhenduo ”
Set interfaces ethernet eth1 pppoe 0 password 123456
Set nat source rule 1 source address 192.168.1.0/24 添加NAT规则,并设置源地址
Set nat source rule 1 outbound-interface pppoe0 nat出口设置
Set nat source rule 1 translation address masquerade 开启 masquerade
相关命令:
1、show version
2、Commit 提交命令,在配置模式下,需要打commit命令才会生效
3、Set service ssh 开启ssh
4、Show interfaces pppoe 查看pppoe接口 ,这可帮助你了解是否拨号陈宫,如果成功会看到IP
5、Show interfaces pppoe pppoe0 log 查看拨号日志
安装
最少1G的引导分区和最小2G的自由空间,如果正使用大点还是好的。
安装命令:install image(安装完后关机,关机后把光盘取出,不要在从光盘引导。)
安装是全部默认即可,但是“yes”的地方一定要输入“yes”还有就要输入密码,看到有Enter password for
user 'vyatta':(输入密码) Retype password for user 'vyatta':(再次输入密码),而且有一个地方还有自由定制你可以输入www.57cto.com这样的名字。
Vyatty安装与配置
用户:vyatty 密码:vyatty
查看版本:show version
Boot via:livecd(并没有安装在线CD运行)
进入配置模式:configure
eth0口配置IP:set interfaces ethernet eth0 address 192.168.104.177/24 删除eth0IP:delete interfaces ethernet eth0 address 192.168.104.177/24 vyatty所有删除命令都是delete 配置提交:commit //(在配置模式下输入commit方可生效)
配置下一跳地址:set protocol static route 0.0.0.0/0 next-hop 192.168.104.254
打开SSH:set service ssh //(每次命令输入后需要commit提交,现在可以用SSH连接了)
Nat出口设置:set nat source rule 1 outbound-interface eth0 //(利用那一个接口或IP来做转换地址,我们是用eth0来做转换的。)
Nat需要转换的地址:set nat source rule 1 source address 192.168.1.0/24 //(内网网段)
启用地址伪装:set nat source rule 1 translation address masquerade //(也就是启用Nat)
pppoe用户配置:set interfaces ethernet eth1 pppoe 0 user-id 用户名 //(把用户名替换为你真实pppoe
用户名)
pppoe密码配置:set interfaces ethernet eth1 pppoe 0 password 密码 //(把密码替换为您真实pppoe密
码)
查看全局配置:show
配置完成后一定要保存配置:save
上面命令下面解释。
#set system host-name vr 主机名 设置 Vyatta 的域
#set system domain-name contoso.local 设置外部 IP – DHCP 模式
#set interfaces ethernet eth0 address dhcp 设置内部 IP - 静态模式
#set interfaces ethernet eth1 address 192.168.11.254/24 设置时区
#set system time-zone Asia/Chongqing 添加时间服务器
#set system ntp server time.windows.com 开启 DHCP Server
#set service dhcp-server shared-network-name LAN-IP-Pool #set service dhcp-server shared-network-name LAN-IP-Pool subnet 192.168.11.0/24 #set service dhcp-server shared-network-name LAN-IP-Pool dns-server 192.168.11.253 #set service dhcp-server shared-network-name LAN-IP-Pool start 192.168.11.1 stop 192.168.11.200
添加管理员用户
vyatta@vyatta#set system login user user - name level admin
vyatta@vyatta#set system login user user - name authentication
Plaintext - password password
#commit
添加操作员账户
vyatta@vyatta#set system login user user - name level admin
vyatta@vyatta#set system login user user - name authentication
Plaintext - password password
#commit
|