# Some commands to get to 10.18.78.* machines via 172.24.0.240 : sudo ip route add 10.18.78.0/24 via 172.24.0.240 sudo route add default gw 207.172.223.184 eth2 # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # From http://www.yourownlinux.com/2013/07/how-to-configure-ubuntu-as-router.html : 1. Edited the network interfaces file: vi /etc/network/interfaces 2. Added the following lines: auto eth1 iface eth1 inet static address 10.0.1.42 netmask 255.255.0.0 gateway 207.172.223.184 auto eth2 iface eth2 inet static address 207.172.223.184 netmask 255.255.255.255 gateway 207.172.223.1 # I'm not sure that the "gateway" address for eth2 is correct, but I don't have # any way of knowing the ISP's machine's address, which may change over time. 3. Enable IP forwarding sudo sh -c “echo 1 /proc/sys/net/ipv4/ip forward’’ # Doesn't work at all echo '1' > /proc/sys/net/ipv4/ip_forward # Suggested later 4. edit /etc/sysctl.conf, and added net.ipv4.ip forward=1 5. IP masquerading: Suggests the commands: #iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE #iptables -A FORWARD -i eth0 -o eth2 -m state -–state RELATED,ESTABLISHED -j ACCEPT #-- This gets 'iptables v1.4.21: unknown option "state"' #iptables -A FORWARD -i eth2 -o eth0 -j ACCEPT Since one command gets an error, I've commented them out for now. -- Abandoned this approach -- # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # http://www.howtoforge.com/nat-gateway-iptables-port-forwarding-dns-and-dhcp-setup-ubuntu-8.10-server # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Autologin at boot Xubunto by default automatically logs some user (not you ;-) at boot, leaving the system wide-open after such things as power failures when nobody is around. This can be fixed by editing "/etc/lightdm/lightdm.conf" and commenting out the "autologin-user=" line. Or you might change the userid to an unprivileged user, if that's secure enough for you. # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Terminal colors in editors. Using vi or vm results in a lot of nearly illegible text because they like to color stuff based on some sort of syntactic analysis. There are lots of questions about this, but they all seem to suggest editing specific config files that don't exist on my system. Is there a way to disable colors in .virc or .vimrc? Even better would be a way to tell the Terminal app to use only a specific list of colors (background, text, selected, bold, and maybe a few more). # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Routing: Show the routing table: route (Symbolic values) route -n (Numeric values) # Assign (or add) an IP address and netmask to a port: ifconfig eth1 10.0.1.42 netmask 255.255.0.0 # 20221130 This worked on linux (kendy) for an ethernet port that connects # to a new Orbi router's ethernet ports (2022-11-30): sudo ifconfig eno1 192.168.1.40 netmask 255.255.0.0 # Add/delete a default route to an address on a port. Both address and port seem needed. route add default gw 207.172.223.184 eth1 route add default gw 192.168.1.17 eth1 route del default gw 192.168.1.17 eth1 # The port name isn't always needed, but it's not clear when. # Enable/disable a port. It's not clear whether the "up" commands do the same thing. # Start it working: ifconfig eth1 up ifup eth1 # Stop it: ifconfig eth1 down ifdown eth1 # Put interface in promiscuous mode: (How can we use this?) ifconfig eth1 -promisc # This seems to delete the first route in the table: ip route del # Use dig to get an IP address: dig google.com dig @192.168.1.42 google.com (Ask a specific DNS server) # Use nslookup to get an IP address: nslookup google.com nslookup google.com 192.168.1.17 (Ask a specific DNS server) # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #