Results 1 to 4 of 4

Thread: Configuring route with different interfaces

  1. #1
    Join Date
    Feb 2013
    Beans
    3

    Exclamation Configuring route with different interfaces

    Hi,
    I have a PC with Ubuntu 10.04 running on it. The PC have 6 Ethernet interfaces. I want to configure all with static IP. The first one, eth0 si to be connected in a public domain and all the others to a private domain with same gateway and same netmask. The /etc/network/interfaces is like below :
    Code:
    auto eth0 eth1 eth2 eth3 eth4 eth5
    
    iface eth0 inet static
    address xx.4.8.180
    gateway xx.4.8.254
    netmask 255.255.255.0
    
    iface eth1 inet static
    address 192.168.1.201
    gateway 192.168.1.254
    netmask 255.255.255.0
    
    iface eth2 inet static
    address 192.168.1.202
    gateway 192.168.1.254
    netmask 255.255.255.0
    
    iface eth3 inet static
    address 192.168.1.203
    gateway 192.168.1.254
    netmask 255.255.255.0
    
    iface eth4 inet static
    address 192.168.1.204
    gateway 192.168.1.254
    netmask 255.255.255.0
    
    iface eth5 inet static
    address 192.168.1.205
    gateway 192.168.1.254
    netmask 255.255.255.0
    The end idea is to make the five Ethernet interfaces like an network switch. That is if I ping 192.168.1.101, I should get the reply if I connect the cable to each one of the interfaces. I could not do that currently. It works sometimes from eth1, sometimes from eth5.

    The route table is as below:
    Code:
    Kernel IP routing table
    Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
    192.168.1.0     *               255.255.255.0   U     0      0        0 eth1
    192.168.1.0     *               255.255.255.0   U     0      0        0 eth5
    192.168.1.0     *               255.255.255.0   U     0      0        0 eth2
    192.168.1.0     *               255.255.255.0   U     0      0        0 eth3
    192.168.1.0     *               255.255.255.0   U     0      0        0 eth4
    xx.4.8.0        *               255.255.255.0   U     0      0        0 eth0
    link-local      *               255.255.0.0     U     1000   0        0 eth5
    default         *               0.0.0.0         U     0      0        0 eth0
    default         192.168.1.254   0.0.0.0         UG    100    0        0 eth4
    default         192.168.1.254   0.0.0.0         UG    100    0        0 eth3
    default         192.168.1.254   0.0.0.0         UG    100    0        0 eth2
    default         192.168.1.254   0.0.0.0         UG    100    0        0 eth1
    default         192.168.1.254   0.0.0.0         UG    100    0        0 eth5
    Please help.

  2. #2
    Join Date
    Mar 2011
    Location
    UK
    Beans
    125
    Distro
    Ubuntu 13.04 Raring Ringtail

    Re: Configuring route with different interfaces

    Hi

    Ok so what your trying to do here is slightly complicated because each of your interfaces needs to have an ip address, making it more like a router than a switch which works entirely on mac addresses.

    here is some info on how you can do it:

    http://pontus.ullgren.com/view/multi...he_same_subnet

    Hope this helps!

    Barry
    Desktop: Z77X-UD5H, Intel i7 3770k, NVidia GeForce 660 Ti Sli 16GB DDR3 RAM 2TB HDD
    OSes: Mint 14 x64 Windows 7 Ultimate x64
    Laptop: Dell Latitude E6430
    OSes: Ubuntu 13.04 x64, Backtrack 5 R3

  3. #3
    Join Date
    Feb 2013
    Beans
    3

    Re: Configuring route with different interfaces

    Thank you Barry for your quick reply. I will check by the method proposed and will revert.

    Thanks,
    Ranjith

  4. #4
    Join Date
    Feb 2013
    Beans
    3

    Re: Configuring route with different interfaces

    Hello Barry,
    I am a relatively inexperienced in Linux. In the link posted by you, it says that there are some prerequisites - below values be enabled in the kernel:
    Code:
    CONFIG_IP_ADVANCED_ROUTER=y
    CONFIG_IP_MULTIPLE_TABLES=y
    CONFIG_IP_ROUTE_FWMARK=y
    CONFIG_IP_ROUTE_MULTIPATH=y
    CONFIG_IP_ROUTE_VERBOSE=y
    CONFIG_NETLINK_DEV=y
    When I surfed the net and some other forums, there was option given to make CONFIG_IP_ADVANCED_ROUTER=y by executing the line
    echo "1" > /proc/sys/net/ipv4/ip_forward
    I could not find any options to enable the other parameters.
    Please Help.
    Ranjith.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •