BisonRobotics / NRMC2018

The 2018 entry for the NASA Robotics Mining Competition for NDSU!
3 stars 0 forks source link

Network Config #97

Open jacobhuesman opened 6 years ago

jacobhuesman commented 6 years ago

Host IPs

The netmask for everything is 255.255.255.0

Robot Configuration

IP forwarding needs to be turned on, so uncomment the following line from /etc/sysctl.conf

net.ipv4.ip_forward=1

For the static ips, your interfaces in /etc/network/interfaces should look like this

# Wifi
auto wlp4s0
iface wlp4s0 inet static
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 192.168.1.1
wpa-driver nl80211
wpa-conf /etc/wpa_supplicant.conf

# Ethernet 1
auto enp2s0
iface enp2s0 inet static
address 192.168.10.1
netmask 255.255.255.0

# Ethernet 2
auto enp3s0
iface enp3s0 inet static
address 192.168.11.1
netmask 255.255.255.0

Node configuration

Change ETHERNET_INTERFACE to whatever ifconfig -a spits our for the interface, change address and gateway to the corresponding node and robot (gateway) ips

# Ethernet interface
auto ETHERNET_INTERFACE
iface ETHERNET_INTERFACE inet static
address 192.168.X.X
netmask 255.255.255.0
gateway 192.168.X.1
dns-nameservers 192.168.1.1

Router Configuration

Static Routes

In advanced routing, two static routes need to be specified, 1 to each node's network image image

DNS

Since we're using static ips, DNSMasq doesn't automatically detect the hostnames, to fix this we can manually specify them image This should allow you to specify hostnames instead of ips, so for example to ssh into the robot you could run

ssh nrmc@her-name
jacobhuesman commented 6 years ago

ROS doesn't use the default key algorithm that ubuntu uses, so first ssh needs to be done like this

ssh -oHostKeyAlgorithms='ssh-rsa' nrmc@node0
jacobhuesman commented 6 years ago

To transfer your public keys between computers, use this

ssh-copy-id -oHostKeyAlgorithms='ssh-rsa' nrmc@node0