Category: NetworkingFix X11 Forwarding over SSH in Ubuntu 10.04 (Lucid)October 13, 2011 There is a bug in Ubuntu Lucid’s sshd (SSH server) that causes issues with IPv6-enabled network interfaces preventing X11 forwarding over SSH from working properly. The error in error: Failed to allocate internet-domain X11 display socket. To fix the issue, you need to tell sshd to only listen to IPv4. Add the following line at the top of AddressFamily inet Solution is from: http://www.se.cuhk.edu.hk/~hmleung/wordpress/?p=876 Categories: Linux, Networking Persistent Iptables in Ubuntu September 09, 2011 Fedora defaults to persisting iptables (the Linux firewall) between restarts, but this is not the default case in Ubuntu. To have iptables persist between reboots in Ubuntu, you can install the iptables-persistent package: sudo apt-get install iptables-persistentThe persistent tables will be stored in /etc/iptables/rules by default. You can save the live iptables to the persistent file using: sudo iptables-save< /etc/iptables/rules Solution is from https://help.ubuntu.com/community/IptablesHowTo#Configuration_on_startup Categories: Linux, Networking Install SNMP on Ubuntu May 06, 2011 To install SNMP on Ubuntu, run the commands below (as root):
apt-get install -y snmpd
CONFIG="/etc/snmp/snmpd.conf"
mv $CONFIG $CONFIG.bak
echo rocommunity public > $CONFIG
echo syslocation "put location here" >> $CONFIG
echo syscontact youremail@yourdomain.com >> $CONFIG
CONFIG="/etc/default/snmpd"
mv $CONFIG $CONFIG.bak
cat $CONFIG.bak | grep -v SNMPDOPTS > $CONFIG
echo "SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -I -smux -p /var/run/snmpd.pid \
-c /etc/snmp/snmpd.conf'" >> $CONFIG
service snmpd restart
echo "Installed snmpd"
If you have a firewall, you will also need to allow UDP traffic on port 161. If you use iptables this can be accomplished with iptables -A INPUT -p udp -m state --state NEW -m udp --dport 161 -j ACCEPT You can test if SNMP is working by running snmpwalk from another machine: snmpwalk -v 1 -c public -O e hostname This blog posted is based on documentation at http://www.it-slav.net/blogs/2009/02/05/install-and-configure-snmp-on-ubuntu. Categories: Linux, Networking Permanently Change Hostname in Ubuntu February 15, 2011 To permanently to change the hostname of an Ubuntu box, edit the file Categories: Linux, Networking Deleting a Route February 09, 2011 Use the route del -net DST netmask MASK replacing DST with the subnet IP and MASK with the subnet mask. For example, to delete a route for the subnet 169.254.0.0/16, run the command: route del -net 169.254.0.0 netmask 255.255.0.0 Categories: Linux, Networking Calculating IP Subnets December 28, 2010 Being in networking, I frequently need to determine subnet sizes, mask sizes, and address ranges. While I could do this all in my head, I like to use the handy Online IP Subnet Calculator. You can set any number of subnet parameters and get the resulting address range and broadcast address. Categories: Networking Tags: subnet Eeebuntu on ASUS EeePC 1000HA Missing Network Adapters May 24, 2010 A few weeks ago I helped a friend install Eeebuntu 3 on his ASUS EeePC 1000HA. After installation, no network adapters were being recognized--neither wired or wireless. The solution was to upgrade to the 2.6.30 Linux kernel, which adds the necessary support for the network hardware in the EeePC 1000HA. The necessary Debian packages can be downloaded from the Ubuntu kernel mirror to a flash drive using a different computer. Then, install the three necessary Debian packages on the EeePC in this order:
The solution to this issue originally came from an Eeebuntu forum post. Categories: Linux, Networking Monitor Network Usage with MRTG and DD-WRT January 26, 2010 I currently run DD-WRT on a Linksys WRT54GL. One of the great features of DD-WRT is its Simple Network Management Protocol (SNMP) functionality. You can setup a desktop to gather SNMP data from the router and provide it in nice graphical form. First, you need to configure the router running DD-WRT:
After DD-WRT is configured, MRTG needs to be configured. All the commands below are run as root. A few may be Fedora specific, but the commands are easily adaptable for other Linux distributions.
Categories: Linux, Networking Preventing Auto-Padding in C Structures January 05, 2010 Most networking applications written in C use structures to easily access the data in a packet header. If all the pieces are appropriately word aligned (i.e. one or more sequential parts of the header total 4-bytes in length), then a regular C structure works just fine. The standard IP, TCP, and UDP headers are all word aligned. However, the custom packet header I was using for a project was not word aligned. Using a regular structure without any special notation, caused the GNU C compiler (gcc) to automatically add padding to the structure to force one or more sequential variables to be 4-byte aligned. But, the packet should not contain this extra padding. The parts of the header need to be "packed." To force an entire structure to be packed, add __attribute__((packed))at the end of the structure definition. For example: struct mine {
short a;
int b;
}__attribute__((packed));
It is important to note that not all architectures will allow "packed" structures. Most RISC architectures require that variables be word-aligned, and generate a fault when memory is read across two words. The x86 and x86_64 architectures allow non-word-aligned variables for backwards compatibility to earlier processor versions. Wikipedia has more details on data structure alignment. (The original source of this solution is: http://tuxsudh.blogspot.com/2005/05/structure-packing-in-gcc.html) Categories: Development, Networking Tags: c Permanently Change Hostname in Fedora October 20, 2009 To permanently change the hostname of a Fedora box, edit the file Categories: Linux, Networking |
SearchCategories
Also see Emily & Aaron's Blog Tagsacm apt awk bash benchwork bibtex c compiz dd-wrt dia dvd eeebuntu eeepc eps excel fedora firefox flash freebsd gnome hostname iptables java kde latex mac os x mail merge mediawiki mercurial mrtg nvidia pdf perl phidgets postscript powerpoint printer putty pxe python R route scenery sed snmp ssh structures subnet subversion sudo ubuntu vegetarian vim visio windows word wrt54gl x11 yum Years |