# Router OS Install

## sitation

- we have a mobile phone with access point
- SSID: threefold
- secret: planetfirst

The idea is we configure a routeros as client to the access point, we use NAT (network translation) to allow the ZOS computer which will be connected to the routerOS.


![](img/env_routeros_zos.png)

The 3Node will get IP address from the router and through the router get to the internet.

Because our computer is connected to same router over USB nic we can check the network connection is running.

Ofcourse we can replace the routerOS with any standard router which gives DHCP to our computer and Zero-OS.



### how to reset the routeros

It might be needed to reset the router, before we can make progress

> todo

## connect computer to routeros

![](img/routeros1.png)

In this case we have a wired connection (TP cat5) from computer over USB network card to the router os on port 2 (make sure its not port 1).

After resetting the router OS, the computer should receive an ip address on 192.168.88.... address, see below for how to reset.

now go to http://192.168.88.1/

### configure initial passwd

![](img/initialpasswd.png)

you should see above, which asks for passwd, we will for demo select planetfirst

(the initial passwd is empty)

![](img/routeros2.png)

You should now see something like this 


### install as client to mobile

![](img/cpe.png)

at right top chose config as CPE which is client to a wireless access point.

Now you should see something like:


![](img/cpe2.png)

![](img/planetfirst1.png)

see how to configure the wireless connection (threefold/planetfirst) at left side

click connect

![](img/cpe3.png)

Now you can see how it connects to our phone and has signal

It didn't get an ip address yet, this is because the DHCP client was not configured yet.

![](img/routeros_4.png)

See the configuration needed, 

- configure as router
- address acquisition is automatic
- make sure ip address is in range 192.168.88...
- make sure DHCP is given (server range can be put on empty)
- make sure NAT is on

Click on apply configuration


### get address DHCP

Not sure why this doesn't work but had to do a further work around to get a TCP address on the router.

Click on WebFig

Go to IP dhcpclient

![](img/ros_dhcpclient.png)


![](img/dhcp1.png)

click on the one entry and change it to wlan, click on apply

![](img/dhcp_wlan.png)

I've had situations where I couldn't select wlan and then I chose the generic bridge or I created a new bridge and that worked, was weird, anyhow here it was possible to select WLAN and it got ip address.

### test it works

I can now test on my computer

![](img/ping.png)

it works, ping to 8.8.8.8 which is DNS server of google.

Now the router is configured, I go over the USB nic to the internet

on routeros you can go to tools/ping


![](img/ros_ping.png)

there you can ping to 8.8.8.8 again and see how it responds, that shows you the router can access it, only useful to test if your computer would not be able to get there.

### reboot router 

lets make sure it all comes up, 

![](img/ros_reboot.png)

go to system reboot

go back to your terminal ping to 8.8.8.8 and see how it goes away and then comes back

![](img/ros_comesback.png)

We now know that the router has the config even after restart,

## connecto the zero-os node

now we can connect the ZOS node we want to configure

## remarks

- to test make sure your wirless is not on, you need to connect over USB network card, not wireless otherwise you don't know if the router is doing its work.

## troubleshooting

if for whatever reason it didn't work, best to reset the rooter and restart from scratch.

