Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
First of all you need to tell us how the machines are connected (where is the modem, router, IP subnets etc). If I guess correctly, you need to set IP forwarding between the interfaces with /etc/sysconfig/sysctl option IP_FORWARD="yes" in openSUSE 10.2 (this is probably the default). Depending on the type of traffic you want to route, this may not be enough.
If you need direct access to 192.168.0.10, you'll need to set up the intermediate machine as an ethernet bridge and put both networks on the 192.168.0.0/16 netblock.
Internet
|
ADSL Modem/Router (192.168.2.1)
|
|-----------------Various Machines (192.168.2.x - DHCP)
|
eth1 on Linux Box (192.168.2.99 - static)
|
eth0 on Linux Box (192.168.0.x - Assigned by DHCP)
|
Mailserver (192.168.0.10 - static)
|
DHCP Server
|
Internet
I have used his instructions to generate a br0 interface but now need to set the br0 with ifconfig. Do I have to set a static IP address as Paul Dwerryhouse describes? How does this affect the DHCP server on eth0?
I've just noticed that his example has the bridge connecting two networks both on the 10.1.9.x network. Am I on completely the wrong track?
#!/bin/sh
brctl addbr br0
brctl stp br0 off
brctl addif br0 eth0
brctl addif br0 eth1
ifconfig eth0 down
ifconfig eth1 down
ifconfig eth0 0.0.0.0 up
ifconfig eth1 0.0.0.0 up
ifconfig br0 192.168.2.99 netmask 255.255.255.0 up
route add default gw 192.168.2.99
echo "1" > /proc/sys/net/ipv4/ip_forward
iptables -P FORWARD DROP
iptables -F FORWARD
iptables -I FORWARD -j ACCEPT
iptables -I FORWARD -j LOG
iptables -I FORWARD -j DROP
iptables -A FORWARD -j DROP
iptables -x -v --line-numbers -L FORWARD
as once the eth1 went down I would lose contact with my (headless) linux box.
I thought that the script would continue to execute and bring up br0 on 192.168.2.99 which would give me a connection again. However, this does not happen and the linux box remains unresponsive until reboot....
How is the DHCP server connected to the internet? Does the ADSL router have 2 NICs? If so, you can simply set the router to route the traffic between the 192.168.0.x and 192.168.2.x networks.
If the ADSL router has one interface and is connected to a switch, to which are also connected the linux box and the 192.168.2.x network machines, then all you need for normal traffic (no broadcasts) is to set the ADSL router to route 192.168.0.x traffic to the linux box (eth1).
I think it would be better if you changed the topology like this: connect the linux box to the router (192.168.1.x network on eth0), connect the 192.168.2.x machines to the linux box on eth1 and add another NIC to connect the 192.168.0.x machines (eth3), and IP_FORWARD=1 will be enough for normal traffic to route between the networks. You can also make the linux box the DHCP server for both networks (192.168.2.x and 192.168.0.x) and firewall this way.
The link you provide works for the case that the linux box is the router, which seems that is not the case here, unless you do what I described above.
Then you can connect the 192.168.2.x machines on the router, as well as the linux box and set the router to allow routing between the 2 networks. eth0 and eth1 should be set to a 192.168.0.x address respectively. This setup will not allow broadcasts to propagate though, be warned.
I have tried as you suggested, but am having mixed results.
The Other network I'm trying to connect to has the IP 192.168.0.x and assigns new connections by DHCP.
My SMC Barricade router has 4 ports, each of which can be set to the default LAN or to a VLAN which is defined with the following parameters:
Name: OtherNetwork
IP Adress: 192.168.0.58 (I've specified this IP as I am assuming that the DHCP server allocates in a pool starting at 100 - from observation)
Subnet Mask: 255.255.255.0 (no problems there!)
Nat Domain: Private (the other option is 'Public')
IGMP Snooping: Disabled
IGMP Querier: Disabled
The problem is that once I've set this, wired connection with the router drops off and on randomly and periodically.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.