OEM Configuring Static IP on Vehicles
Static IP address is set in the file "/etc/network/interfaces".
- Copy that file to "/etc/network/interfaces.Microhard" to indicate it was used with the OEM radio.
- Edit the interfaces file to change the IP address to the vehicle's computer address and the gateway address to 192.168.1.1
The new interfaces file should look like this:
# This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo eth0 iface lo inet loopback iface eth0 inet static # X = IP address of the vehicle's computer (e.g., evan = 192.1681.1.175) address 192.168.1.X netmask 255.255.255.0 broadcast 192.168.1.255 gateway 192.168.1.1 # ONLY FOR UBUNUTU 12.04 and newer # (for prior to 12.04 you need a resolv.conf file) dns-nameservers 8.8.8.8 auto eth1 iface eth1 inet dhcp
Ubuntu systems prior to 12.04 require a manually-modified /etc/resolv.conf file:
# ONLY EDIT THIS FILE on Ubuntu version prior to 12.04 # On 12.04 and newer, add "dns-nameservers 8.8.8.8" following line to /etc/network/interfaces nameserver 8.8.8.8 nameserver 192.168.1.1
Also edit the /etc/hosts file to have quick access to the other known computers on the network:
# The computer this file is on should be assigned to localhost (this sample is for evan) 127.0.0.1 localhost 127.0.1.1 evan 192.168.1.170 jing 192.168.1.171 kirk 192.168.1.175 evan 192.168.1.176 felix 192.168.1.177 gus 192.168.1.178 hal 192.168.1.179 Ida 192.168.5.100 pabloE 192.168.6.100 pabloF 192.168.7.100 pabloG 192.168.8.100 pabloH 192.168.9.100 pabloI 192.168.10.100 pabloJ 192.168.11.100 pabloK 192.168.12.100 pabloL # The following lines are desirable for IPv6 capable hosts ::1 localhost ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters
Allow Robot to be Accessible Outside of the Lab
This is typically only used for troubleshooting. The following instructions describe the setup required to enable someone from outside of the lab's network to access one of the robots using SSH through port forwarding.
1) Use a web browser to access the lab router at 192.168.1.1
2) On the left hand side of the page click on the Security link under Router Settings
3) In the Security pane - click on the tab labeled Apps and Gaming
4) Select the heading 'Single Port Forwarding'
5) Scan the list to see if the IP/port forwarding is already there but not Enabled.
a) If it is on the list simply click on 'Edit' to set it to Enabled. Move on to step 6.
b) If the IP/port is not on the list click on 'Add a new Single Port Forwarding'
c) Choose an 'Application Name' that is descriptive - for this example we will use gusSSH because we are forwarding Gus' ssh port 22.
d) Choose an 'External Port' that will be used to access the 'Internal Port'. For our example we will select 9022.
e) For the 'Internal Port' select 22 as that is the default for SSH and will stay the same for Gus.
f) Keep the 'Protocol' set to 'Both'
g) The 'Device IP#' will be 192.168.1.177 as that is Gus' IP address in the local lab network.
h) 'Enabled' is checked.
i) Click on 'Save'
j) Click on 'Apply' at the very bottom of the page
6) Identify the external IP for the robot. While logged into Gus type this at the command prompt an note the IP address it responds with:
$ dig +short myip.opendns.com @resolver1.opendns.com
7) Access the robot from an external computer. At the command line log in with ssh with a couple of extra options. Remember to change out 'user', 'IP' and 'PORT' after -p to your appropriate values.
$ ssh user@IP -p 9022