Wednesday, December 28, 2011

Problems with Realtek r8169 & Debian

I've run into a problem with Proxmox (technically, Debian 5) and Realtek NIC's, specifically Realtek R8169. Some probably know about this bug, and most system admins know almost automatically realtek = unacceptable. However, I am just going to jot down a few things I learned in the process of deducing this that I found useful. 

First: 

lshw -class network
Example of output are:
*-network
       description: Ethernet interface
       product: VT6105 [Rhine-III]
       vendor: VIA Technologies, Inc.
       physical id: 7
       bus info: pci@03:07.0
       logical name: eth0
       version: 9a
       serial: 00:88:88
       width: 32 bits
       clock: 33MHz
       capabilities: bus_master cap_list ethernet physical
       configuration: broadcast=yes driver=via-rhine driverversion=2.6.22-14-generic latency=32 maxlatency=8 mingnt=3 multicast=yes
       resources: ioport=d300-d3ff iomemory:d8883888-d88838ff
 
Also: 
 
awk '/:/ { sub(":", "", $1); print $1 }' /proc/net/dev 
Which lead me into looking into sed & awk. Good thing I have a copy of Linux + Guide to Linux Certification.
I think I understand these commands a littler better now, and how to better use them.
 
Also:
 
lspci -v : a lot of good information about the components of your system
 
I also ran into " Interface eth0 does not exist - e1000e/e1000 " when running:
 
/etc/init.d/networking restart
 
Which lead me to wonder how eth0 was assigned to an interface. What, or who does the assigning?
Udev. That is the answer, to the best of my knowledge.  
 
 
"I would suspect the same thing.  If that is what it is doing, delete

this file, unless you really need it for some custom settings, and reboot.

/etc/udev/rules.d/70-persistent-net.rules

Mine starts with a 70, yours may vary.  The key thing is the net part.

Once you reboot, it should reset itself."
 
I also ran into this because I discovered odd entries in my /etc/network/config folder, things like eth1_rename, eth2_rename, etc.
I found out the way to clear that is through this /etc/udev/70-persistent-net.rules file. However, even after modifying this file, I was not
sucessful. I had to delete it completely along with /etc/networking/interfaces, which I added back after I rebooted. I assigned eth0 and eth1
to my intel dual port NIC, and it was smooth sailing from there. This comes as a bit of a blow, however, because I was going to have
one of the Realtek NICs bridged into my dynamips-server to attach to the routers themselves. I wasn't sure this was possible, but for now
it looks like I will not be able to implement that as planned. 

You can see here my Realtek NICs are not functioning properly, as they obviously have the same [incorrect] MAC addresses:
More to come on this as I decided to try and update the kernel to the newest version.
 
 

Saturday, December 24, 2011

Hacking Cisco: Lab 6 - OSPF Multi-Area Network

Hacking Cisco: Lab 6 - OSPF Multi-Area Network: Prerequisites: CCNP level skills. In the next few labs I am going to use the following topology. Topology Pic. 1 - OSPF Multi-Area Topo...

Thursday, December 22, 2011

Scribble 2

Second part of this setup was engineering the domain, and an important part of this is DNS. I stumbled upon this "solution" by accident, but it all seems to be working for now.


Scribble

Well I finally got my VLANs up and running, in the process I had to put some linux skills to use, as I had to delve into Proxmox and learn a little bit about Bridging and Bonding. This is a topic I am not too familiar with although I have had a lecture on an older linux guru who designed the lab for our room. He used a pentium 3 machine with only a couple (if not only one) interface to do the routing for our lab. He did this with a variety of BSD likely using Bridging and Bonding, maybe VLANs, and maybe something like iptables?

Anyway I have this functional now, and I followed this to get it done:

Network Interfaces Setup


It's actually quite easy to setup VLAN support.
  • Note: It is probably best to have a console connection or be prepared to change your switch interface after making the changes and restarting the PVE interface.
First step after setting up the VLANS you want on your switch is to edit your /etc/network/interfaces file. It will probably look similar to the one below depending on how many interfaces you have:
# network interface settings
 auto lo
 iface lo inet loopback
 iface eth0 inet manual
 iface eth1 inet manual
 auto vmbr0
 iface vmbr0 inet static
   address  192.168.0.2
   netmask  255.255.255.0
   gateway  192.168.0.1
   bridge_ports eth0
   bridge_stp off
   bridge_fd 0
 auto vmbr1
 iface vmbr1 inet static
   address  10.10.10.2
   netmask  255.255.255.0
   bridge_ports eth1
   bridge_stp off
   bridge_fd 0
The first step we need to do is to create the bonded interfaces for each of the vlans. In this example I am adding Vlans 5 and 9.
auto bond0
iface bond0 inet manual
        slaves eth0 eth1
        bond_miimon 100
        bond_mode 4

auto bond0.5
iface bond0.5 inet manual
        vlan-raw-device bond0

auto bond0.9
iface bond0.9 inet manual
        vlan-raw-device bond0
The next step is to edit your bridge_ports interfaces to match the vlans you are using for management.
auto vmbr0
 iface vmbr0 inet static
   address  192.168.0.2
   netmask  255.255.255.0
   gateway  192.168.0.1
   bridge_ports bond0.5
   bridge_stp off
   bridge_fd 0
 auto vmbr1
 iface vmbr1 inet static
   address  10.10.10.2
   netmask  255.255.255.0
   bridge_ports bond0.9
   bridge_stp off
   bridge_fd 0
So now, your interfaces file should look similar to this (Be sure that you have indented properly):
# network interface settings
 auto lo
 iface lo inet loopback
 iface eth0 inet manual
 iface eth1 inet manual

auto bond0
iface bond0 inet manual
        slaves eth0 eth1
        bond_miimon 100
        bond_mode 4

auto bond0.5
iface bond0.5 inet manual
        vlan-raw-device bond0

auto bond0.9
iface bond0.9 inet manual
        vlan-raw-device bond0

auto vmbr0
 iface vmbr0 inet static
   address  192.168.0.2
   netmask  255.255.255.0
   gateway  192.168.0.1
   bridge_ports bond0.5
   bridge_stp off
   bridge_fd 0
 auto vmbr1
 iface vmbr1 inet static
   address  10.10.10.2
   netmask  255.255.255.0
   bridge_ports bond0.5
   bridge_stp off
   bridge_fd 0
You should be able to rename your vmbr devices so that they reflect your vlan.
You can now restart your interface. You will want to now make sure that your switch port that is plugged into the PVE machine is trunked using dot1q encapsulation.
/etc/init.d/networking restart
Ignoring all the warnings but verify everything is correct using:
ifconfig
Reboot your PVE and login to the web interface. You should see your interfaces listed. To add a VM to a specific vlan simply add the proper vmbrX as a network interface and enjoy. 



Friday, December 16, 2011

Network Infastructure

Second time writing this. Ok. Trying to get a good network infrastructure down here in time for next semester. Trying to make use of VLANs to simplify my life, get things segmented, make use of that Cisco 3550XL I bought ages ago. I am trying to integrate a management network into my infrastructure, move Proxmox over to its own subnet, segment PPTP users so nobody is poking around on my LAN, all that good stuff.

Unfortunately, I am having trouble with pfsense VLANs again. I followed the guides on the pf site and the directions in the definitive guide, yet I am not getting DHCP leases from any of the access ports I assigned to my VLANs on the switch. It is probably a firewall issue, or something in the switch I missed. I didn't sleep well last night so I am thinking about posting to reddit or something to get help with the issue since I really need to get this up and running and move on.

Anyway I made a small little visio this morning to illustrate my current config:

Thursday, December 15, 2011

Timeout from the typical

I am going to take a timeout from the typical techno-babble to write about my last semester in review. This semester is FINALLY coming to a close. I feel as though it could not possibly come quick enough. I have literally been glued to my desk for the past two weeks. I thought everything was going well until about two weeks ago, when the instructors started piling on final projects. The amount of work was insurmountable/impossible, and it has me a bit peeved at the education system, my instructors, myself, and life in general. I've worked harder this semester then I have ever worked at school my entire life, and yet I am still faced with this bitter taste in my mouth that everything I have attempted to learn was lost, everything I have attempted to do well at was simply inadequate. All the hard work and dedication was pointless. At this point in time I am seriously debating whether to go on to another semester (as I have in the past, although I was faced with academic suspension at that time), or whether it was even a good idea to go to college in the first place. I am even debating whether my chosen field is really what I want to do anymore. In this economy, and with IT shrinking and having the ability for huge systems to be managed by less people, you really have to stand out. You have to know your stuff, you have to have good people skills, you have to be able to organize and communicate and be professional. I have none of that. I feel I haven't really LEARNED anything again and that it was all just a big struggle to get all the homework done. That's always what it is, and I am sick of it to the point where it has caused me health problems. Why is the education so homework-oriented rather then finding a way to effectively and efficiently teach people things without bombarding them with requirements and projects? 


I did a little reading today and I found a few interesting quotes:


"If students enroll in an average course load of 15 hours at a 1:3 classroom-to-coursework ratio, they should expect to spend 15 hours in class each week. That means 45 hours spent on homework, a total of 60 hours weekly. If attending college were a waged job, the last 20 hours would be considered overtime. That leaves little time for a part-time job, something many students need in a sluggish economy. A 2006 study by consulting firm O’Donnell and Associates found that 49 percent of college students work part-time about 16 hours per week — a possible grand total of 76 hours spent each week.The idea of a college student working 76 hours, mostly unpaid, defies America’s image of the typical college student — a John Belushi-type frat boy who does keg stands and crashes on couches of stacked pizza boxes. Indeed, the 2010 National Survey of Student Engagement reports that only nine percent of seniors surveyed at major research universities study more than 30 hours per week. But what the survey doesn’t explore are the vast differences between expectations of liberal arts students and those in professional programs. "

Add to this the rest of your classes, and you are looking at around 5-6 hours of homework EVERY night. So school ends at 3:00 pm and most students will get home around 4. This means that with all of the homework, the student cannot hope to go to sleep before 10:30, accounting for dinner and short breaks during studying. This leaves no time to "enjoy life," as I like to say, because life has turned into work. For students in after school activities, they are lucky to finish their homework by midnight. I know some students who work until 2 am every morning because they must in order to finish all of their homework. I do not think that homework is meant to work students to death.


Now if you will pardon me, I have to get ready to go take a math final... 


Monday, December 12, 2011

Adding hard disk for Proxmox Storage

SSH into the Proxmox box:


I had to go in with fdisk and clean up my disk before I could add it, I wanted the entire disk visible to proxmox so I cleaned off any of the remaining partitions. You can find out using fdisk -l as you can see here, I needed /dev/sda. Then, you can create the physical volume:
 
Then create the volume group:
 
The storage is then present: