FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Ubuntu > Ubuntu User

 
 
LinkBack Thread Tools
 
Old 01-06-2011, 12:09 PM
stan
 
Default a networking question

I have a workstation in my lab with 10.04 on it. I want to create a
situation where I can atache test devices on various 192.168.x.x subnets to
one of the switches it is already pluged in to. Taht is I want multiple
subnets on the smae physcial "wire" Here is what I have put in
/etc/network/interfaces:

auto lo
iface lo inet loopback
address 127.0.0.1
netmask 255.0.0.0

auto eth0
iface eth0 inet static
address 10.209.120.12
netmask 255.255.255.0
gateway 10.209.120.1


# auto eth1

# iface eth1 inet static
# address 192.168.1.5
# netmask 255.255.255.0

# iface eth1 inet static
# address 192.168.1.6
# netmask 255.255.255.0

# iface eth1 inet static
# address xxx.85.106.148
# netmask 255.255.255.128

auto br0
iface br0 inet static
address xxx.85.106.148
broadcast xxx.85.106.255
netmask 255.255.255.128
# gateway xxx.85.106.143
bridge_ports eth1
bridge_fd 2.5

auto eth1:0
iface eth1:0 inet static
name Ethernet alias LAN card
address 192.168.100.2
netmask 255.255.255.0
broadcast 192.168.100.255
network 192.168.100.0

auto eth1:1
auto eth1:1
iface eth1:1 inet static
name Ethernet 2nd alias LAN card
address 192.168.1.11
netmask 255.255.255.0
broadcast 192.168.1.255
network 192.168.1.0

And here is what netstat -rn reports:

stan@plabws1:/etc/network$ netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt
Iface
xxx.85.106.128 0.0.0.0 255.255.255.128 U 0 0 0
br0
192.168.100.0 0.0.0.0 255.255.255.0 U 0 0 0
eth1
10.209.120.0 0.0.0.0 255.255.255.0 U 0 0 0
eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0
eth1
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0
virbr0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0
eth0
0.0.0.0 10.209.120.1 0.0.0.0 UG 0 0 0
eth0

But I cannot ping something on 192.168.1.x What am I doing wrong?


--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 01-06-2011, 12:56 PM
Tapas Mishra
 
Default a networking question

On Thu, Jan 6, 2011 at 6:39 PM, stan <stanb@panix.com> wrote:
> I have a workstation in my lab with 10.04 on it. I want to create a
> situation where I can atache test devices on various 192.168.x.x subnets to
> one of the switches it is already pluged in to. Taht is I want multiple
> subnets on the smae physcial "wire" Here is what I have put in
> /etc/network/interfaces:
>
> auto lo
> iface lo inet loopback
> address 127.0.0.1
> netmask 255.0.0.0
>
> auto eth0
> iface eth0 inet static
> address 10.209.120.12
> netmask 255.255.255.0
> gateway 10.209.120.1
>
>
> # auto eth1
>
> # iface eth1 inet static
> # address 192.168.1.5
> # netmask 255.255.255.0
>
> # iface eth1 inet static
> # address 192.168.1.6
> # netmask 255.255.255.0
>
> # iface eth1 inet static
> # address xxx.85.106.148
> # netmask 255.255.255.128
>
> auto br0
> iface br0 inet static
> address xxx.85.106.148
> broadcast xxx.85.106.255
> netmask 255.255.255.128
> # gateway xxx.85.106.143
> bridge_ports eth1
> bridge_fd 2.5
>
> auto eth1:0
> iface eth1:0 inet static
> name Ethernet alias LAN card
> address 192.168.100.2
> netmask 255.255.255.0
> broadcast 192.168.100.255
> network 192.168.100.0
>
> auto eth1:1
> auto eth1:1
> iface eth1:1 inet static
> name Ethernet 2nd alias LAN card
> address 192.168.1.11
> netmask 255.255.255.0
> broadcast 192.168.1.255
> network 192.168.1.0
>
> And here is what netstat -rn reports:
>
> stan@plabws1:/etc/network$ netstat -rn
> Kernel IP routing table
> Destination * * Gateway * * * * Genmask * * * * Flags * MSS Window *irtt
> Iface
> xxx.85.106.128 *0.0.0.0 * * * * 255.255.255.128 U * * * * 0 0 * * * * *0
> br0
> 192.168.100.0 * 0.0.0.0 * * * * 255.255.255.0 * U * * * * 0 0 * * * * *0
> eth1
> 10.209.120.0 * *0.0.0.0 * * * * 255.255.255.0 * U * * * * 0 0 * * * * *0
> eth0
> 192.168.1.0 * * 0.0.0.0 * * * * 255.255.255.0 * U * * * * 0 0 * * * * *0
> eth1
> 192.168.122.0 * 0.0.0.0 * * * * 255.255.255.0 * U * * * * 0 0 * * * * *0
> virbr0
> 169.254.0.0 * * 0.0.0.0 * * * * 255.255.0.0 * * U * * * * 0 0 * * * * *0
> eth0
> 0.0.0.0 * * * * 10.209.120.1 * *0.0.0.0 * * * * UG * * * *0 0 * * * * *0
> eth0
>
> But I cannot ping something on 192.168.1.x What am I doing wrong?
>
You need to enable ip forwarding on the machine where bridge is.
Correct entry for a bridge is as follows

auto lo
iface lo inet loopback

# The primary network interface
auto eth2
iface eth2 inet manual

auto br0
iface br0 inet static
address 192.168.1.14
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.10
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 192.168.13.2
dns-search myserver.net
bridge_ports eth2
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp off

You can not have eth0 and br0 simultaneously at the same time.
The output of brctl show on my machine shows

brctl show
bridge name bridge id STP enabled interfaces
br0 8000.0026b9824238 no eth2
vnet0
vnet1
vnet2
vnet3
Paste your outputs on paste.ubuntu.com here it becomes cluttered to read.
--
http://mightydreams.blogspot.com

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 01-06-2011, 03:21 PM
stan
 
Default a networking question

On Thu, Jan 06, 2011 at 07:26:26PM +0530, Tapas Mishra wrote:
> On Thu, Jan 6, 2011 at 6:39 PM, stan <stanb@panix.com> wrote:
> > I have a workstation in my lab with 10.04 on it. I want to create a
> > situation where I can atache test devices on various 192.168.x.x subnets to
> > one of the switches it is already pluged in to. Taht is I want multiple
> > subnets on the smae physcial "wire" Here is what I have put in
> > /etc/network/interfaces:
> >
Thanks that is ahelp.
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 01-08-2011, 03:23 PM
stan
 
Default a networking question

On Thu, Jan 06, 2011 at 07:26:26PM +0530, Tapas Mishra wrote:
> On Thu, Jan 6, 2011 at 6:39 PM, stan <stanb@panix.com> wrote:
> > I have a workstation in my lab with 10.04 on it. I want to create a
> > situation where I can atache test devices on various 192.168.x.x subnets to
> > one of the switches it is already pluged in to. Taht is I want multiple
> > subnets on the smae physcial "wire" Here is what I have put in
> > /etc/network/interfaces:
> >
> >
> > But I cannot ping something on 192.168.1.x What am I doing wrong?
> >
> You need to enable ip forwarding on the machine where bridge is.
> Correct entry for a bridge is as follows
>
> auto lo
> iface lo inet loopback
>
> # The primary network interface
> auto eth2
> iface eth2 inet manual
>
> auto br0
> iface br0 inet static
> address 192.168.1.14
> netmask 255.255.255.0
> network 192.168.1.0
> broadcast 192.168.1.255
> gateway 192.168.1.10
> # dns-* options are implemented by the resolvconf package, if installed
> dns-nameservers 192.168.13.2
> dns-search myserver.net
> bridge_ports eth2
> bridge_fd 9
> bridge_hello 2
> bridge_maxage 12
> bridge_stp off
>
> You can not have eth0 and br0 simultaneously at the same time.
> The output of brctl show on my machine shows
>
> brctl show
> bridge name bridge id STP enabled interfaces
> br0 8000.0026b9824238 no eth2
> vnet0
> vnet1
> vnet2
> vnet3
> Paste your outputs on paste.ubuntu.com here it becomes cluttered to read.

I am still confused a bit. My setup is that I have 2 physical NIC's one
goes to the corportae lan. The 2nd goes to an interanl lan. Tis is the lan
that I also gave a bridge interface, so that I cna use VirtualBox on this
machine. In addition, I want the 2nd interface to be able to use varos
192.168.x.x subnets. eth0 is the corporate LAN, and eth1 is the internal
LAN.

--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 01-09-2011, 12:18 PM
Tapas Mishra
 
Default a networking question

On Sat, Jan 8, 2011 at 9:53 PM, stan <stanb@panix.com> wrote:
>> You need to enable ip forwarding on the machine where bridge is.
>> Correct entry for a bridge is as follows
>>
>> auto lo
>> iface lo inet loopback
>>
>> # The primary network interface
>> auto eth2
>> iface eth2 inet manual
>>
>> auto br0
>> iface br0 inet static
>> * * * * address 192.168.1.14
>> * * * * netmask 255.255.255.0
>> * * * * network 192.168.1.0
>> * * * * broadcast 192.168.1.255
>> * * * * gateway 192.168.1.10
>> * * * * # dns-* options are implemented by the resolvconf package, if installed
>> * * * * dns-nameservers 192.168.13.2
>> * * * * dns-search myserver.net
>> * * * * bridge_ports eth2
>> * * * * bridge_fd 9
>> * * * * bridge_hello 2
>> * * * * bridge_maxage 12
>> * * * * bridge_stp off
>>
>> You can not have eth0 and br0 simultaneously at the same time.
>> The output of brctl show on my machine shows
>>
>> brctl show
>> bridge name * bridge id * * * * * * * STP enabled * * interfaces
>> br0 * * * * * 8000.0026b9824238 * * * no * * * * * * *eth2
>> * * * * * * * * * * * * * * * * * * * * * * * * * * * vnet0
>> * * * * * * * * * * * * * * * * * * * * * * * * * * * vnet1
>> * * * * * * * * * * * * * * * * * * * * * * * * * * * vnet2
>> * * * * * * * * * * * * * * * * * * * * * * * * * * * vnet3
>> Paste your outputs on paste.ubuntu.com here it becomes cluttered to read.
>
> I am still confused a bit. My setup is that I have *2 physical NIC's one
> goes to the corportae lan. The 2nd goes to an interanl lan. Tis is the lan
> that I also gave a bridge interface, so that I cna use VirtualBox on this
> machine. In addition, I want the 2nd interface to be able to use varos
> 192.168.x.x subnets. eth0 is the corporate LAN, and eth1 is the internal
> LAN.

You don't have to worry much.I have not used Virtual Box actively.
I have a setup with 4 NICs.Which has a few guest Operating Systems
running on this server.
How ever I am using only one NIC for all the Virtual Machines and to
communicate with world outside
It acts as a bridge to 4 Guest Operating systems and connects them to internet.

In your case
1) Define a configuration file br0 as I posted in my previous mail
2) While giving parameters for networking in Virtual Box's console (or
some place in Virtual Box where you can specify a bridge to connect)
use this bridge
3) Create IPTABLES as how NIC1 will forward the packets to Bridge on NIC2


If you are have not seen this link then have a look
http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge
it is basics of bridged networking if this does not work then let me know.
Also for bridge to work NIC2 should be in promiscuous mode.
What you would be left with is to set up IPTABLES to communicate with
bridge and corporate network.

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 01-09-2011, 12:52 PM
Tapas Mishra
 
Default a networking question

On Sun, Jan 9, 2011 at 6:48 PM, Tapas Mishra <mightydreams@gmail.com> wrote:
> On Sat, Jan 8, 2011 at 9:53 PM, stan <stanb@panix.com> wrote:
>>> You need to enable ip forwarding on the machine where bridge is.
>>> Correct entry for a bridge is as follows
>>>
>>> auto lo
>>> iface lo inet loopback
>>>
>>> # The primary network interface
>>> auto eth2
>>> iface eth2 inet manual
>>>
>>> auto br0
>>> iface br0 inet static
>>> * * * * address 192.168.1.14
>>> * * * * netmask 255.255.255.0
>>> * * * * network 192.168.1.0
>>> * * * * broadcast 192.168.1.255
>>> * * * * gateway 192.168.1.10
>>> * * * * # dns-* options are implemented by the resolvconf package, if installed
>>> * * * * dns-nameservers 192.168.13.2
>>> * * * * dns-search myserver.net
>>> * * * * bridge_ports eth2
>>> * * * * bridge_fd 9
>>> * * * * bridge_hello 2
>>> * * * * bridge_maxage 12
>>> * * * * bridge_stp off
>>>
>>> You can not have eth0 and br0 simultaneously at the same time.
>>> The output of brctl show on my machine shows
>>>
>>> brctl show
>>> bridge name * bridge id * * * * * * * STP enabled * * interfaces
>>> br0 * * * * * 8000.0026b9824238 * * * no * * * * * * *eth2
>>> * * * * * * * * * * * * * * * * * * * * * * * * * * * vnet0
>>> * * * * * * * * * * * * * * * * * * * * * * * * * * * vnet1
>>> * * * * * * * * * * * * * * * * * * * * * * * * * * * vnet2
>>> * * * * * * * * * * * * * * * * * * * * * * * * * * * vnet3
I forgot to mention I came across a useful link
http://blog.agdunn.net/?p=416
excerpts from above link

"It is very important to do a ‘manual’ on the bridged interface as
that will prevent br0 from going out and trying to get an IP of its
own from your DHCP. If it did go get an IP you are going to have to
deal with route issues on the server, this I can assure you is very
frustrating. Also make sure you have STP enabled (yes) as it can cause
major issues for your network."


Also I would suggest to once have a look on
http://www.google.com/search?client=ubuntu&channel=fs&q=etc+network+inte rfaces&ie=utf-8&oe=utf-8
the above is what I searched to understand what each entry
means.Because if you do not understand that then
it might be arbit for you to make changes to that file and trying things.

--
http://mightydreams.blogspot.com

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 
Old 01-09-2011, 03:10 PM
Tapas Mishra
 
Default a networking question

On Sat, Jan 8, 2011 at 9:53 PM, stan <stanb@panix.com> wrote:
> On Thu, Jan 06, 2011 at 07:26:26PM +0530, Tapas Mishra wrote:
>> On Thu, Jan 6, 2011 at 6:39 PM, stan <stanb@panix.com> wrote:
>> > I have a workstation in my lab with 10.04 on it. I want to create a
>> > situation where I can atache test devices on various 192.168.x.x subnets to
>> > one of the switches it is already pluged in to. Taht is I want multiple
>> > subnets on the smae physcial "wire" Here is what I have put in
>> > /etc/network/interfaces:
>> >
>> >
>> > But I cannot ping something on 192.168.1.x What am I doing wrong?
>> >
>> You need to enable ip forwarding on the machine where bridge is.
>> Correct entry for a bridge is as follows
>>
>> auto lo
>> iface lo inet loopback
>>
>> # The primary network interface
>> auto eth2
>> iface eth2 inet manual
>>
>> auto br0
>> iface br0 inet static
>> * * * * address 192.168.1.14
>> * * * * netmask 255.255.255.0
>> * * * * network 192.168.1.0
>> * * * * broadcast 192.168.1.255
>> * * * * gateway 192.168.1.10
>> * * * * # dns-* options are implemented by the resolvconf package, if installed
>> * * * * dns-nameservers 192.168.13.2
>> * * * * dns-search myserver.net
>> * * * * bridge_ports eth2
>> * * * * bridge_fd 9
>> * * * * bridge_hello 2
>> * * * * bridge_maxage 12
>> * * * * bridge_stp off
>>
>> You can not have eth0 and br0 simultaneously at the same time.
>> The output of brctl show on my machine shows
>>
>> brctl show
>> bridge name * bridge id * * * * * * * STP enabled * * interfaces
>> br0 * * * * * 8000.0026b9824238 * * * no * * * * * * *eth2
>> * * * * * * * * * * * * * * * * * * * * * * * * * * * vnet0
>> * * * * * * * * * * * * * * * * * * * * * * * * * * * vnet1
>> * * * * * * * * * * * * * * * * * * * * * * * * * * * vnet2
>> * * * * * * * * * * * * * * * * * * * * * * * * * * * vnet3
>> Paste your outputs on paste.ubuntu.com here it becomes cluttered to read.
>
> I am still confused a bit. My setup is that I have *2 physical NIC's one
> goes to the corportae lan. The 2nd goes to an interanl lan. Tis is the lan
> that I also gave a bridge interface, so that I cna use VirtualBox on this
> machine. In addition, I want the 2nd interface to be able to use varos
> 192.168.x.x subnets. eth0 is the corporate LAN, and eth1 is the internal
> LAN.
Things change when you say you want to use a switch and when you say
it is Virtual Box.

Here are excerpts from Virtual Box's networking page

"As the virtual machine is connected to a private network internal to
VirtualBox and invisible to the host, network services on the guest
are not accessible to the host machine or to other computers on the
same network. However, like a physical router, VirtualBox can make
selected services available to the world outside the guest through
port forwarding. This means that VirtualBox listens to certain ports
on the host and resends all packets which arrive there to the guest,
on the same or a different port."

Here is the link
http://www.virtualbox.org/manual/ch06.html
So the Virtual Machines are accessing a network which is taken care by
Virtual box and not you unless you do some NAT etc on the base OS.

So the effort you are doing is not going in correct direction when you
say it was a switch.
Now I would like to ask a question do you have two NICs or is it just
that you are having one NIC and you give it 2 aliases and explain the
problem as above?
If this being the case then you need to re frame your question.

I remember a long time back some one came to me with a similar problem
and the problem was as simple as enabling some option via GUI in
advanced settings tab of Virtual box ( I do not remember the exact
thing)

From your post it appears you are not clear with how bridge works.(No
pun intended just want to point you to right direction that you should
look for)

When you use a bridge then the NIC will be running in promiscuous
mode.It will receive all the packets (whether they were intended for
it or not) and then when it finds any of the packet intended towards
the VM the bridge will respond.
Since you installed Virtual box so this part is now not handled by
Ubuntu it is your Virtual box or any other hypervisor that comes into
picture to handle it.

So you just need one entry for a bridge and if you actually have 2 NIC
(2 means 2 physically different and both are on a different subnet)

Here is how the /etc/network/interfaces file should look

# The primary network interface

auto lo
iface lo inet loopback

#stan here eth1 is NIC1 and I am assuming it gets corporate IP via
dhcp which is common in corporate setting
#if that is not then add address netmask gateway accordingly

auto eth1
iface eth1 inet dhcp

#stan here eth2 is NIC2 which you want a bridge to work
auto eth2
iface eth2 inet manual
#to understand what manual is
http://manpages.ubuntu.com/manpages/lucid/man5/interfaces.5.html
# you will use this type for bridge on 2nd NIC
auto br0
iface br0 inet static
address 192.168.1.14
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.10
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 192.168.13.2
dns-search myserver.net
bridge_ports eth2
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp off

#Note I have used both eth1 and eth2 in this file /etc/network/interface
Ubuntu will not do much when Virtualbox is running.
So just need a bridge on NIC2 with a configuration of bridge as I said
above and if both NIC1 and NIC2 are not in same subnet then IPTABLE
rules to forward traffice from NIC1 to NIC2 and vice versa.
Configuaration of NIC1 and NIC1 will be in same file
/etc/network/interface with an entry such as

iface eth1 inet static/dhcp

//then follows settings for nic1
iface eth2 inet (dhcp/static/manual)
//bridge br0 and settings for bridge assuming nic2 is absent you do
not have to make settings for nic2 and bride if you are to use nic2
for the bridge and nic1 does not falls in your bridge.

In case you have not described your situation correctly then it is a
different stuff all together.

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
 

Thread Tools




All times are GMT. The time now is 10:38 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org