---
# System prepended metadata

title: Lab3
tags: [RCOM]

---

###### tags: `RCOM`
## Generalizações 

### Sobre o IP address 
Formato padrão IP `172.16.YR.X`. 
__Y__: Bancada.  
__R__: Rede da lan.  
__X__: Porta definida no guião.   

### Comando de adição de rotas  
```
route add -net [ip-destino] gw [ip-intermediario]   
route add -net 172.16.YR.0/24 gw 172.16.YR.Porta
```

__Y__: Bancada  
__R__: Rede  
__Lê-se__: Para chegar ao [ip-destino] devemos passar pelo [ip-intermediario].    

### Criar vlan 

```
configure terminal
vlan y0
end 
show vlan brief 
```

### Adicionar computador a LAN

```
configure terminal 
interface fastethernet 0/Porta
switchport mode access
switchport access vlan YR
end
```
---- 
# Lab3 

Considerando que estamos na:  
__Bancada__: 6  
__Sala__: 1  

Rodar nos computadores:   

```bash 
updateimage
```
## tux2 

```bash
ifconfig eth0 172.16.61.1/24                       # configura o endereço
route add -net 172.16.60.0/24 gw 172.16.61.253     # configura a rota

``` 

## tux3 

```bash
ifconfig eth0 172.16.60.1/24                       # configura o endereço 
route add -net 172.16.61.0/24 gw 172.16.60.254     # configura a rota
```

## tux4 

Neste tux temos de configurar duas portas.  

```
ifconfig eth0 172.16.60.254/24 
ifconfig eth1 172.16.61.253/24
``` 

## Transformar tux4 num router 

```
echo 1 > /proc/sys/net/ipv4/ip_forward
echo 0 > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts
```

## GTKTERM 
 
### Restart 

```bash 
enable
copy flash:tux6-clean startup-config 
reload 
```

### Configure lan 0 

```
configure terminal 
vlan 60 
end
``` 

### Configure lan 1 

```
configure terminal 
vlan 61 
end
```

### Adicionar computadores as lans 

Configurar assim:  
- __tux2__: Porta 2  
- __tux3__: Porta 6  
- __tux4 eth0__: Porta 4  
- __tux4 eth1__: Porta 8  


__TUX2__: 

```
configure terminal 
interface fastethernet 0/2
switchport mode access
switchport access vlan 61
end
```

__TUX3__: 

```
configure terminal 
interface fastethernet 0/6
switchport mode access
switchport access vlan 60
end
```

__TUX4__: 

```
configure terminal 
interface fastethernet 0/4
switchport mode access
switchport access vlan 60
end
```

```
configure terminal 
interface fastethernet 0/8
switchport mode access
switchport access vlan 61
end
```

