Ask Your Question
0

Instance with two NICs to route traffic

asked 2015-10-21 15:22:32 -0500

bobyakov gravatar image

updated 2015-10-22 08:11:16 -0500

Hi ,

Need help setting up Ubuntu server as a router with two NICs to route traffic between two private subnets. Need to ping/connect from client1 to client2 via router instance.

Ex: Ubuntu Router Instance: nic1 10.2.1.8 nic2 192.168.1.4

Client1 nic1 10.2.1.6 gateway 10.2.1.8

Client2 nic1 192.168.1.6 gateway 192.168.1.4

Router Instance info:

sudo sysctl -p net.ipv4.ip_forward = 1

ubuntu@router-1:~$ ifconfig

eth0      Link encap:Ethernet  HWaddr fa:16:3e:aa:c4:05
          inet addr:10.2.1.8  Bcast:10.2.1.255  Mask:255.255.255.0
          inet6 addr: fe80::f816:3eff:feaa:c405/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1454  Metric:1
          RX packets:11466 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11410 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1121494 (1.1 MB)  TX bytes:1317588 (1.3 MB)

eth1      Link encap:Ethernet  HWaddr fa:16:3e:49:08:03
          inet addr:192.168.1.4  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::f816:3eff:fe49:803/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4381 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4130 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:426279 (426.2 KB)  TX bytes:381393 (381.3 KB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:17 errors:0 dropped:0 overruns:0 frame:0
          TX packets:17 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1680 (1.6 KB)  TX bytes:1680 (1.6 KB)

ubuntu@router-1:~$ route -n

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.2.1.1        0.0.0.0         UG    0      0        0 eth0
10.2.1.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
edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
0

answered 2015-10-22 09:32:53 -0500

bobyakov gravatar image

I was advised I can do it through neutron. (this worked) neutron port-update nicportid --allowed_address_pairs list=true type=dict ip_address=subnet Problem is this would require massive overhead, anyway to allow this for project user to do this?

edit flag offensive delete link more
0

answered 2015-10-22 04:51:42 -0500

mathias gravatar image

Hi,

router-1: - 10.2.1.0/24 - 192.168.1.0/24

client-1: - 10.10.10.5

client-2: - 192.168.1.0/24

1) Looks to me like your client-1 is not even connected to the 10.2.1.0/24 network that router-1 is connected to. 2) client-2 uses 192.168.1.3 as the default gateway while router-1 has 192.168.1.4

cheers mathias

edit flag offensive delete link more

Comments

My mistake, I was just entering the info as an example. I updated the information with the actual IP's

bobyakov gravatar imagebobyakov ( 2015-10-22 08:08:41 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2015-10-21 15:22:32 -0500

Seen: 59 times

Last updated: Oct 22 '15