So I started booting the test board and then pulled up the docs on a different screen to learn how to setup a few basics. Skimming the docs I learned that they seem to have taken a lesson from the routing industry and have created a Command Line Interface similar to popular commercial routers. You can have different users with different privileges and then there are different modes for working in the router. The first mode is called “Operational Mode” which allows you to run basic utilities for diagnostics and show settings for troubleshooting. To set anything you need to enter the “Configuration Mode” with the command configure, which allows you to change and commit settings. We’ll hit that in a minute. First let’s login. Default credentials are root with a password of vyatta for your privileged user, and username vyatta with password of vyatta for your non-privileged user. Now let’s check our connectivity and see if we can talk to the network we are plugged into. Vyatta has the familiar tab completion for commands found in both UNIX systems and commercial routers, which helps you muttle your way through with minimal referencing of the docs. Logged in as the root user I did the following….. Last login: Fri Aug 8 01:28:13 2008 from 192.168.60.1 Linux vyatta 2.6.23-1-486-vyatta #1 SMP Sat Apr 19 12:37:43 PDT 2008 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. vyatta:~# show interfaces ethernet Interface IP Address State Link Description eth0 192.168.60.252/24 up up eth1 - up down vyatta:~# Now you can see in this terminal output that I already have an address, but it didn’t to start with, so I need to configure that…… vyatta:~# configure [edit] root@vyatta# set interfaces ethernet eth0 address dhcp [edit] root@vyatta# Ok so far so good. Now let’s setup ssh so we don’t need a monitor and keyboard attached to it. root@vyatta# set service ssh port 22 [edit] root@vyatta# set service ssh allow-root [edit] root@vyatta# commit There should be some text here about generating the ssh keys and restarting the service. root@vyatta# exit exit vyatta:~# Ok so now we should be able to login to this thing. Let’s go find the IP address and check the interface. vyatta:~# show interfaces ethernet detail eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 00:16:ec:54:fd:e8 brd ff:ff:ff:ff:ff:ff inet 192.168.60.252/24 brd 192.168.60.255 scope global eth0 inet6 fe80::216:ecff:fe54:fde8/64 scope link valid_lft forever preferred_lft forever RX: bytes packets errors dropped overrun mcast 76484 719 0 0 0 0 TX: bytes packets errors dropped carrier collisions 54652 443 0 0 0 0 eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 00:40:05:08:9e:26 brd ff:ff:ff:ff:ff:ff RX: bytes packets errors dropped overrun mcast 0 0 0 0 0 0 TX: bytes packets errors dropped carrier collisions 0 0 0 0 0 0 vyatta:~# Looks good to me. Now go ssh over to it and play. I will post more to come 1、準備工作 到vyatta網站下載軟件http://www./download/,有兩個版本可以下載,一個是iso版本,另一個是虛擬機版本。 2、安裝系統(tǒng) iso版本安裝,將ISO文件通過nero刻錄到光盤;然后進入CMOS設置為CDROM為第一啟動設備,這需要你的機器真的擁有兩塊以上的網卡。 虛擬機版,直接在vmware中打開就可以可了,系統(tǒng)引導完畢后,將出現: vyatta login: root Password:vyatta ~ # 進入linux 的shell模式下 接著輸入xorpsh,進入路由器配置模式。 root@vyatta> 如果, vyatta login: vyatta Password:vyatta 會直接進入路由配置模式。 3、配置路由器 我們需要實現的任務很簡單,就是在路由器上做個nat,讓藏在后面的多臺pc可以共享上網。 將eth0作為外網口,eth1作為內網口,本人用的光電的小區(qū)寬帶且分配的是私有IP網段:10.113.18.244。 常用的命令 配置縮略圖: ![]() vyatta虛擬機安裝 2007年02月25日 星期日 11:23
|
|
|
來自: Frank_Chia > 《網絡》